2021
03-30
03-30
pandas快速处理Excel,替换Nan,转字典的操作
pandas读取Excelimportpandasaspd#参数1:文件路径,参数2:sheet名pf=pd.read_excel(path,sheet_name='sheet1')删除指定列#通过列名删除指定列pf.drop(['序号','替代','签名'],axis=1,inplace=True)替换列名#旧列名新列名对照columns_map={'列名1':'newname_1','列名2':'newname_2','列名3':'newname_3','列名4':'newname_4','列名5':'newname_5',#没有列名的情况'Unnamed:10...
继续阅读 >