python 删除excel前几行并删除空白行和空白列

import pandas as pd

df=pd.read_excel(r'C:\Users\Administrator\Desktop\02测试.xls',"1")
dfcl = pd.read_excel('C:\\Users\\Thinkpad\\Desktop\\应变计组1.xlsx' ,skiprows= 6)  #读取从第7行开始的数据
df.dropna(axis=0,how="all",inplace=True)#删除excel空白行代码
df.dropna(axis=1,how="all",inplace=True)#删除excel空白列代码
df.to_excel(r'C:\Users\Administrator\Desktop\02测试.xls',"1")

你可能感兴趣的:(python,pandas,开发语言)