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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With