美文网首页
Pandas统计计算和描述

Pandas统计计算和描述

作者: b485c88ab697 | 来源:发表于2017-09-07 23:52 被阅读43次

Pandas统计计算和描述

import numpy as np
import pandas as pd

常用的统计计算

df_obj = pd.DataFrame(np.random.randn(5,4), columns = ['a', 'b', 'c', 'd'])
df_obj
Paste_Image.png
df_obj.sum()
a    0.827302
b   -2.022970
c    1.722957
d    2.859766
dtype: float64
df_obj.max()
a    0.544118
b    0.746669
c    1.420332
d    1.886597
dtype: float64
df_obj.min(axis=1)
0   -2.703075
1    0.211598
2   -0.831059
3    0.343832
4   -0.865607
dtype: float64

统计描述

df_obj.describe()
Paste_Image.png

相关文章

网友评论

      本文标题:Pandas统计计算和描述

      本文链接:https://www.haomeiwen.com/subject/opwwjxtx.html