[英]Pandas: Read excel that has no column headers and data doesn't start at the first row
I have an excel file which has data rows starting from the 28th row.我有一个 excel 文件,其中包含从第 28 行开始的数据行。 The column headers aren't available.
列标题不可用。
df = xl.parse(sheetName, header=None, names=<list of column names>)
How do I specify that I need custom headers, and that my data starts at the 28th row?如何指定我需要自定义标题,并且我的数据从第 28 行开始?
I would do that with:我会这样做:
df.columns = ['a','b','c']
df = df.iloc[27:]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.