ee.FeatureCollection.aggregate_stats

コレクション内のオブジェクトの指定されたプロパティを集計し、選択されたプロパティの合計、最小値、最大値、平均値、標本標準偏差、標本分散、母集団標準偏差、母集団分散を計算します。

用途戻り値
FeatureCollection.aggregate_stats(property)Dictionary
引数タイプ詳細
これ: collectionFeatureCollection集計するコレクション。
property文字列コレクションの各要素から使用するプロパティ。

コードエディタ(JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
             .filter('country_lg == "Belgium"');

print('Power plant capacities (MW) summary stats',
      fc.aggregate_stats('capacitymw'));

/**
 * Expected ee.Dictionary output
 *
 * {
 *   "max": 2910,
 *   "mean": 201.34242424242427,
 *   "min": 1.8,
 *   "sample_sd": 466.4808892319684,
 *   "sample_var": 217604.42001864797,
 *   "sum": 13288.600000000002,
 *   "sum_sq": 16819846.24,
 *   "total_count": 66,
 *   "total_sd": 462.9334545609107,
 *   "total_var": 214307.38335169878,
 *   "valid_count": 66,
 *   "weight_sum": 66,
 *   "weighted_sum": 13288.600000000002
 * }
 */

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

from pprint import pprint

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')

print('Power plant capacities (MW) summary stats:')
pprint(fc.aggregate_stats('capacitymw').getInfo())

# Expected ee.Dictionary output

#  {
#   "max": 2910,
#    "mean": 201.34242424242427,
#    "min": 1.8,
#    "sample_sd": 466.4808892319684,
#    "sample_var": 217604.42001864797,
#    "sum": 13288.600000000002,
#    "sum_sq": 16819846.24,
#    "total_count": 66,
#    "total_sd": 462.9334545609107,
#    "total_var": 214307.38335169878,
#    "valid_count": 66,
#    "weight_sum": 66,
#    "weighted_sum": 13288.600000000002
#  }