Pandas DataFrame GroupBy 由多个列组成,具有均值、标准差和计数统计信息

Pandas DataFrame GroupBy by several columns with mean, StdDev and count statistics

我如何计算数据框中 ['Value'] 列的摘要统计信息(计数、平均值、Stddev),这些列由 ['Product']、['Parameter' 等其他列分组] 和 ['statistics']?谢谢

您正在寻找 describe:

In [11]: df = pd.DataFrame([[1, 2, "a"], [3, 4, "b"]], columns=["A", "B", "C"])

In [12]: df
Out[12]:
   A  B  C
0  1  2  a
1  3  4  b

In [13]: df.describe()
Out[13]:
              A         B
count  2.000000  2.000000
mean   2.000000  3.000000
std    1.414214  1.414214
min    1.000000  2.000000
25%    1.500000  2.500000
50%    2.000000  3.000000
75%    2.500000  3.500000
max    3.000000  4.000000