Python Forum
pandas.read_excel and skiprows
Thread Rating:
  • 3 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pandas.read_excel and skiprows
#1
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]
Reply
#2
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
Reply
#3
Hi Larz60+
Many thanks for you help. I corrected the skip_footer.

skiprows=17,skipfooter=38

Bye
Reply
#4
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...
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020