数值的pandas转换为numpy格式注意事项:np_arr = np.array(dataframe, dtype=float),需要有float项
文章目录
- pandas读写excel文件
- numpy构建DataFrame
- 拿出数据
- 选择数据
- 增加、删除
- 修改
- 数据清洗
pandas读写excel文件
pandas读取excel文件
pandas.read_excel('.xlsx文件名(或路径)') 或 pandas.read_excel('.xlsx文件名(或路径)','Sheet1') # header=None不分析文档中的表头,把表头也当作数据。skiprows=2跳过两行表头。 pandas.read_excel('.xlsx文件名(或路径)', header=None, skiprows=2)保存为excel文件
df.to_excel('文件名.xlsx或路径') df.to_excel('文件名.xlsx', index=False) # index=False 不导出 行索引df=df.loc[:,~df.