Python Forum
[Solved] df.to_excel: certain rows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] df.to_excel: certain rows
#2
One way is to feed .to_excel with filtered dataframe. For first three rows it would be:

df.iloc[:3].to_excel(writer, startrow=1, sheet_name='row_1_to_3')  
ju21878436312 likes this post
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: df.to_excel: certain rows - by perfringo - May-26-2021, 06:21 AM
RE: df.to_excel: certain rows - by ju21878436312 - Jun-15-2021, 09:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas .to_excel() Dropping First Row of Data When Run from Anaconda Prompt kazoli 0 2,359 Mar-15-2018, 04:52 PM
Last Post: kazoli

Forum Jump:

User Panel Messages

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