Python Forum
pandas.read_excel and skiprows - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: pandas.read_excel and skiprows (/thread-2138.html)



pandas.read_excel and skiprows - metalray - Feb-21-2017

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]


RE: pandas.read_excel and skiprows - Larz60+ - Feb-21-2017

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


RE: pandas.read_excel and skiprows - metalray - Feb-22-2017

Hi Larz60+
Many thanks for you help. I corrected the skip_footer.

skiprows=17,skipfooter=38

Bye


RE: pandas.read_excel and skiprows - buran - Feb-22-2017

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...