任务是将excel的前五列读入数据框:
def cqtreader(spec_path, sheet):
data = pd.read_excel(spec_path, sheet_name=sheet, header=None, usecols='A:F')
有时前几行中有一些不必要的数据。它改变了pd.read_excel的行为
案例1:熊猫读取4列而不是5列
案例2:删除第一个空行,熊猫读取所有5列:
案例3:从单元格D2中删除字符串“VMS”,pandas读取所有5列:
如何使熊猫始终阅读5列
Tags:
我无法写评论,但您的问题可能类似于this
相关问题 更多 >
编程相关推荐