@[TOC](pandas pandas中value_counts()的使用)
import pandas as pd
import numpy as np
df = pd.DataFrame({'城市':['北京','广州', '天津', '上海', '杭州', '成都', '澳门', '南京','北京','北京'],
'收入':[10000, 10000, 5000, 5002, 40000, 50000, 8000, 5000,5000,5000],
'年龄':[50, 43, 34, 40, 25, 25, 45, 32,25,25]})
df.set_index([["一","二","三","四","五","六","七","八","九","十"]],inplace=True)
df
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)