1 df[i]   其中i是0,1,2,3,...  此时选中的是dataframe的第i列

2 dataframe查看每一列是否有缺失值

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
1 temp = data.isnull().any() #列中是否存在空值
2 print(type(temp)) 3 print(temp)  #若为False,则无缺失值,为True,则有缺失值

 3 dataframe 更换列名
a.  更换所有的列名  如下将1,2,3的列名全部更换

1 df=df[[0,1,2,3,4,5,6,7,10]]
2 df.columns=['id','ggid','createtime','sccc','gghyid','sptype','spid','ggzhid','price']

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄