2
は、私がdplyr :: summarizeに相当するパンダがありますか? R/dplyrで
summarise(iris, max_width=max(Sepal.Width), min_width=min(Sepal.Width))
を行うことができますし、取得:
max_width min_width
1 4.4 2
はパンダでsummarise
のようなものはありますか?私はdescribe()
を知っていますが、結果には、すべての列のすべてのサマリー統計ではなく、特定の列の所与のサマリー統計のみを含めることを望みます。パンダでは、iris.describe()
は与える:
sepal_length sepal_width petal_length petal_width
count 150.000000 150.000000 150.000000 150.000000
mean 5.843333 3.057333 3.758000 1.199333
std 0.828066 0.435866 1.765298 0.762238
min 4.300000 2.000000 1.000000 0.100000
25% 5.100000 2.800000 1.600000 0.300000
50% 5.800000 3.000000 4.350000 1.300000
75% 6.400000 3.300000 5.100000 1.800000
max 7.900000 4.400000 6.900000 2.500000
Dupe:http://stackoverflow.com/questions/22235245/calculate-summary-statistics-of-columns-in-dataframe/22235393#22235393、基本的に['describe'](http://pandas.pydata。あなたのケースでは、 'iris [list_of_cols] .describe()の要約情報を表示するcolのリストを渡すことでサブセレクションすることができます。org/pandas-docs/stable/generated/pandas.DataFrame.describe.html) ) ''または '' iris ['sepal_length']。describe() 'はその列の統計だけを返します。 – EdChum
特定の統計の後であれば、' 'iris ['sepal_width']。 ['min'、 'max']] ' – EdChum
これらの計算だけをしたいのであれば、' pd.Series(dict(max_width = iris.sepal_width.max()、min_width = iris.sepal_width.min ())) 'dplyrとほぼ同じ出力を得ることができます。 – joris