counts = series.value_counts() #(series)计算series中元素频数,元素以索引的形式存储,频数以值存储
series.index #取出index
series.divide(data['remarks'].size) #series中的值都除以data['remarks'].size
series.describe([0.25,0.5,0.75]) #返回series,'count'计数,'unique'去重数,'top'众数,'freq':众数频数
data['remarks'].dtype.kind #返回数据类型,单字母表示一个数据类型,如i : signed integer
for name, series in dataframe.items():#name指字段名,series指name对应字段的值数组
pandas两列数据比较
data["flag"] = data[["a", "b"]].max(axis=1)
网友评论