ArcGIS Desktop

  • ドキュメント
  • サポート

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS for Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcMap

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

要約統計量 (Summary Statistics)

  • サマリー
  • 使用法
  • 構文
  • コードのサンプル
  • 環境
  • ライセンス情報

サマリー

テーブル内のフィールドの要約統計量を求めます。

使用法

  • [出力テーブル] は、統計演算の結果を含むフィールドで構成されます。

  • このツールで実行できる統計演算は、合計値、平均値、最大値、最小値、範囲、標準偏差、データ数、最初のレコード、および最後のレコードです。中央値を求める演算はできません。

  • 以下の命名規則に従って、各統計情報タイプごとにフィールドが作成されます。SUM_<field>、MAX_<field>、MIN_<field>、RANGE_<field>、STD_<field>、FIRST_<field>、 LAST_<field>、COUNT_<field>(<フィールド> は、統計情報を計算する入力フィールドの名前です)。出力テーブルが dBASE である場合、フィールド名は 10 文字に切詰められます。

  • [ケース フィールド] が指定されている場合、統計値は一意の属性情報ごとに個別に計算されます。[ケース フィールド] が指定されない場合は、[出力テーブル] にはレコードが 1 つだけ含まれます。指定されている場合は [ケース フィールド] の値ごとに 1 つのレコードが示されます。

  • すべての統計情報計算から NULL 値が除外されます。たとえば、10、5、および NULL の平均値は 7.5 です ((10+5)/2)。COUNT ツールは、統計情報計算に含まれている値の数を返しますが、この例では 2 を返します。

  • [統計フィールド] パラメーターの [フィールドの追加] ボタンは、ModelBuilder だけで使用されます。ModelBuilder では、先のツールが実行されていないか、出力データが存在しないために、[統計フィールド] パラメーターにフィールド名が表示されない場合があります。[フィールドの追加] ボタンを使用すると、[要約統計量 (Summary Statistics)] ダイアログを完了してモデルの作成を続行できるように、必要なフィールドが追加されます。

  • レイヤーを使用する場合、統計情報の計算には現在選択されているフィーチャだけが使用されます。

構文

Statistics_analysis (in_table, out_table, statistics_fields, {case_field})
パラメーター説明データ タイプ
in_table

統計情報の計算に使用するフィールドを含む入力テーブル入力テーブルには、INFO テーブル、dBASE テーブル、OLE DB テーブル、VPF テーブル、あるいはフィーチャクラスを指定できます。

Table View; Raster Layer
out_table

計算された統計情報を格納する、出力 dBASE またはジオデータベース テーブル

Table
statistics_fields
[[field, statistics_type],...]

属性値を含み、特定の統計情報の計算に使用される数値フィールド複数の統計情報とフィールドの組み合わせを指定できます。すべての統計情報計算から NULL 値が除外されます。

[フィールドの追加] ボタンは ModelBuilder だけで使用され、ダイアログ ボックスを完了してモデルの作成を続行できるように、必要なフィールドが追加されます。

使用可能な統計情報のタイプは以下のとおりです。

  • SUM - 指定されたフィールドの値の合計を追加します。
  • MEAN - 指定されたフィールドの平均を計算します。
  • MIN - 指定されたフィールドのすべてのレコードの中で最も小さい値を検出します。
  • MAX - 指定されたフィールドのすべてのレコードの中で最も大きい値を検出します。
  • RANGE - 指定されたフィールドの値の範囲 (MAX - MIN) を検出します。
  • STD - 指定されたフィールドの値の標準偏差を検出します。
  • COUNT - 統計情報の計算に含まれる値の数を検出します。NULL 値以外の値の数がカウントされます。フィールドの NULL 値の数を特定するには、問題のフィールドで COUNT 統計情報を使用し、NULL を含まない異なるフィールド (ある場合は OID など) で COUNT 統計情報を使用して、2 つの値で減算を行います。
  • FIRST - 入力テーブルの最初の値を検出し、その指定されたフィールドの値を使用します。
  • LAST - 入力テーブルの最後の値を検出し、その指定されたフィールドの値を使用します。
Value Table
case_field
[case_field,...]
(オプション)

一意の属性値 (または、複数フィールドが指定された場合には属性値の組み合わせ) ごとに、統計情報を個別に計算するために使用される、入力テーブルのフィールド

Field

コードのサンプル

Statistics (統計情報) の例 (Python ウィンドウ)

次の Python ウィンドウ スクリプトは、イミディエイト モードで Statistics (統計情報) ツールを使用する方法を示しています。

import arcpy
from arcpy import env
env.workspace = "C:/data/Habitat_Analysis.gdb"
arcpy.Statistics_analysis("futrds", "C:/output/output.gdb/stats", [["Shape_Length", "SUM"]], "NM")
Statistics (統計情報) の例 2 (スタンドアロン スクリプト)

次のスタンドアロン スクリプトは、幹線道路から 150 フィート以内の領域の植生に関するデータを集計します。

# Name: Statistics_Example2.py
# Description: Summarize the vegetation by area within 150 feet of major roads
 
# Import system modules
import arcpy
from arcpy import env
 
# Set environment settings
env.workspace = "C:/data"
 
# Set local variables
inRoads = "majorrds.shp"
outBuffer = "C:/output/output.gdb/buffer_out"
bufferDistance = "250 feet"
inVegetation = "Habitat_Analysis.gdb/vegtype"
outClip = "C:/output/output.gdb/clip_out"
joinField = "HOLLAND95"
joinTable = "c:/data/vegtable.dbf"
joinedField = "HABITAT"
outStatsTable = "C:/output/output.gdb/stats_out"
statsFields = [["Shape_Area", "SUM"]]
 
# Execute Buffer to get a buffer of major roads
arcpy.Buffer_analysis(inRoads, outBuffer, bufferDistance, dissolve_option = "ALL")
 
# Execute Clip using the buffer output to get a clipped feature class
#  of vegetation
arcpy.Clip_analysis(inVegetation, outBuffer, outClip)
 
# Execute JoinField to add the vegetation type
arcpy.JoinField_management(outClip, joinField, joinTable, joinField, joinedField)
 
# Execute Statistics to get the area of each vegetation type within
#  the clipped buffer.
arcpy.Statistics_analysis(outClip, outStatsTable, statsFields, joinedField)
Statistics (統計情報) の例 3 (スタンドアロン スクリプト)

次のスタンドアロン スクリプトは、データセットの属性フィールドをループ処理して、[統計フィールド] パラメーターを作成し、その結果、SUM 統計情報が各数値フィールドで計算されます。

# Name: Statistics_Example3_SUM_All.py
# Description: Script that runs the Summary Statistic tool to calculate the
#   Sum statistic for every numeric field based on a unique case field

# Import system modules
import arcpy

# Set environment settings
env.workspace = "C:/data/f.gdb"

# Set local variables
intable = "intable"
outtable = "sumstats"
casefield = "Name"
stats = []

# Loop through all fields in the Input Table
for field in arcpy.ListFields(intable):
    # Just find the fields that have a numeric type
    if field.type in ("Double", "Integer", "Single", "SmallInteger"):
        # Add the field name and Sum statistic type
        #    to the list of fields to summarize
        stats.append([field.name, "Sum"])
# Correct formatting of stats [["Field1", "Sum"], ["Field2", "Sum"], ...]

# Run the Summary Statistics tool with the stats list
arcpy.Statistics_analysis(intable, outtable, stats, casefield)

環境

  • 出力データのコンフィグレーション キーワード
  • 現在のワークスペース
  • テンポラリ ワークスペース

ライセンス情報

  • ArcGIS Desktop Basic: はい
  • ArcGIS Desktop Standard: はい
  • ArcGIS Desktop Advanced: はい

関連トピック

  • 統計情報ツールセットの概要

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS プラットフォーム

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • スタッフ ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
© Copyright 2016 Environmental Systems Research Institute, Inc. | プライバシー | リーガル