Python Forum

Full Version: pandas.read_excel and skiprows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Pandas Experts,
I used the pandas (pd) skiprow attribute to set the first 18 rows to be skipped.
Those are just headings and descriptions.
However, it looks like skiprows was interpreted as max rows to select or so because I only actually see 18 out of the 200+ rows.
Does someone have a suggestion why that might be? I can play around with skiprows to set it to 1-18 or even 40-18 the result is always very odd.

Please the linked image for additional informaiton.

pd.read_excel('Energy Indicators.xls','Energy',skiprows=18,skip_footer=245)
[Image: skiprows.png]
Quote:skip_footer : int, default 0 -- DEPRECATED: use the skipfooter parameter instead, as they are identical
and skipfooter = number of rows at end of file to skip
Hi Larz60+
Many thanks for you help. I corrected the skip_footer.

skiprows=17,skipfooter=38

Bye
I think skipfooter=245 means skip all 245 (0-based) lines starting bottom-up, i.e. skip last 245 lines and not skip line 245 (0-based) starting from the top.
I see Larz told you the same...