数据分析之Pandas学习笔记(三)
数据分析之Pandas学习笔记(三)(统计) df.describe() 常用统计方法 相关系数、协方差 唯一化 计数(频率) df.describe() 数值型,一种结果 官方文档 describe参数详解,统计应用 分位数例子 df = pd . DataFrame ( np . arange ( 4 * 4 ) . reshape ( ( 4 , 4 ) ) , index = index_name , columns = columns_name , ) print ( df ) print ( '********************************************' ) print ( df . describe ( ) ) 比如对上述这样的,全部是数字的DataFrame,discribe()方法返回的结果为: count: 计数 mean: 平均值 std: 标准差 min: 最小值 25%: 25%分位数 50%: 50%分位数(中位数) 75%: 75%分位数 max: 最大值 非数值型,另一种结果 count: 非空数值 unique: 唯一值数 top: 频率最高者 freq: 最高频数 常用统计方法 mean std var cumsum cumprod diff quantile ... 相关系数、协方差 obj.corr() 相关系数