python-pandas常用函数

DataFrame

drop_duplicates() #删除重复

dropna()  #删除空值

fillna(0)  #空值补全为0

reset_index(drop=True)  #重置索引,TRUE原来的索引index列去掉,False就是保留原来的索引

apply(lambda x:int(x.row_id)*2,axis=1)  #其中lambda  为匿名函数,等于 def x():   return  int(x.row_id)*2

df.loc[:,'priority_level']  #获取priority_level列所有的数据

merge()  # https://zhuanlan.zhihu.com/p/391094106

apply(): 用于加载自定义函数,参见:https://blog.csdn.net/qq_38727995/article/details/124459704

shape[0]: 返回行数,shape[1]:返回列数

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容