Reputation: 3764
Using pandas read_excel on about 100 excel files - some are large - I want to read the first few lines of each (header and first few rows of data).
This doesn't work but illustrates the goal (example reading 10 data rows):
workbook_dataframe = pd.read_excel(workbook_filename, nrows = 10)
This is my current workaround:
workbook_dataframe = pd.read_excel(workbook_filename).head(10)
Problem with the workaround is it has to read the entire excel file before taking the head. I've also tried experimenting with skiprows and skip_footer, giving it negative numbers which just produces errors.
Upvotes: 5
Views: 6150
Reputation: 36545
This isn't currently supported although looking at the code it doesn't look like it should be too hard. You can open an issue on the Github project page at https://github.com/pandas-dev/pandas/issues.
Upvotes: 1