-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Pandas read_excel: only read first few lines #16645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sure, could support this, although |
I'm looking into adding this functionality. Thanks. |
You can add one line in your code below where you are reading your file. For example, if you want to read first 10 rows of the file then you can do this. workbook_dataframe = pd.read_excel(workbook_filename) or even you can simply do this so that your data frame now contains only first 10 rows. |
To get nrows without reading the entire worksheet:
|
Could I take a crack at this issue? I'm new to open source and would really like to start contributing. If the last line in @gmlander 's code is valid, I'd just have to identify where to place the code right? Thanks for any suggestions in advance! |
Code Sample, a copy-pastable example if possible
Problem description
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).
The above doesn't work but illustrates the goal (example reading 10 data rows).
The text was updated successfully, but these errors were encountered: