简体   繁体   English

Pandas:读取没有列标题且数据不从第一行开始的 excel

[英]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.

相关问题 Pandas Python:read_excel:是否可以只读取特定数据类型的列标题(将标题读取为字符串)? - Pandas Python: read_excel: Is it possible to only read the column headers in a certain data type (read the headers as strings)? 第一行数据已成为Pandas表中的一列 - First row of data has become a column in Pandas table 在 pandas 列标题上方插入一行以在 csv / excel 文件的第一个单元格中保存标题名称 - Inserting a row above pandas column headers to save a title name in the first cell of csv / excel file Python:当列标题中包含特殊字符时,使用Pandas读取Excel文件 - Python: read an Excel file using Pandas when the file has special characters in column headers pandas.read_excel,第一行值 - pandas.read_excel, first row values 在Pandas数据框中将列标题转到第一行,并将行标题转到第一列 - Turn the column headers into the first row and row headers into the first column in Pandas dataframe 如何使用 Pandas 读取不包含标题的 CSV 文件,仅捕获第一列中的数据并执行删除? - How to read a CSV file that contains no headers using Pandas, capture data in the first column only and perform deletion? Python pandas 读取具有多个行标题的 Excel 文件 - Python pandas to read an Excel file with more than one row headers 如何将列标题设置为 Pandas dataframe 中的第一行? - How to set column headers to the first row in Pandas dataframe? 从excel文档导入数据标题,使用熊猫搜索网络,然后导出到同一excel文档中的特定行/列 - Import data headers from excel doc, search web using pandas, then export to specific row/column in same excel doc
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM