【Pandas】读取、保存表格(.xls / .xlsm / .xlsx)文本(.csv / .txt) | 您所在的位置:网站首页 › xlsm文件打开乱码 › 【Pandas】读取、保存表格(.xls / .xlsm / .xlsx)文本(.csv / .txt) |
【Pandas分组聚合】 groupby()、agg() 方法的使用
qq_54351137: 博主你好,我在使用groupby求一年逐日数据的月平均值时agg报错:AttributeError:'DataArrayGroupBy' object has no attribute 'agg',请问是哪里出了问题呢? 感谢! 【Pandas】读取、保存表格(.xls / .xlsm / .xlsx)文本(.csv / .txt)胡桃の壶: pd.read_excel() 没有index这个参数,有index_col参数,用来指定某(几)列作为行索引。 【Pandas】读取、保存表格(.xls / .xlsm / .xlsx)文本(.csv / .txt)wangmuba: [code=python] def loadfile(): neg=pd.read_excel('D:/code/Sentiment-Analysis-master/data/neg.xls',header=None,index=None) pos=pd.read_excel('D:/code/Sentiment-Analysis-master/data/pos.xls',header=None,index=None) [/code] 博主,我这个报错TypeError: read_excel() got an unexpected keyword argument 'index'是什么原因呢 【Pandas】读取、保存表格(.xls / .xlsm / .xlsx)文本(.csv / .txt)胡桃の壶: 你的路径有问题:r"C:\Users\29781\Desktop"/data.csv, 引号放到最后,保存为名为data.csv文件 r"C:\Users\29781\Desktop\data.csv" 【Pandas】读取、保存表格(.xls / .xlsm / .xlsx)文本(.csv / .txt)以梦为龙ღ: 你好,最近在学pandas导入导出文件,请问一下导出.csv文件报错'DataFrame' object has no attribute 'csv'该怎么处理[code=python] bankloan=pd.DataFrame(data=data) bankloan.to_csv(r"C:\Users\29781\Desktop"/data.csv,sep='\t') [/code] |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |