Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot rename Columns in df
#12
skiprows accepts callable as argument so maybe use lambda to determine empty rows?

Quote:skiprows

list-like, int, or callable, optional

Line numbers to skip (0-indexed) or number of lines to skip (int) at the start of the file. If callable, the callable function will be evaluated against the row indices, returning True if the row should be skipped and False otherwise. An example of a valid callable argument would be lambda x: x in [0, 2].
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
Cannot rename Columns in df - by tester_V - Aug-25-2023, 04:59 PM
RE: Cannot rename Columns in df - by deanhystad - Aug-25-2023, 05:16 PM
RE: Cannot rename Columns in df - by tester_V - Aug-25-2023, 06:30 PM
RE: Cannot rename Columns in df - by snippsat - Aug-25-2023, 06:59 PM
RE: Cannot rename Columns in df - by tester_V - Aug-25-2023, 07:38 PM
RE: Cannot rename Columns in df - by snippsat - Aug-25-2023, 08:01 PM
RE: Cannot rename Columns in df - by tester_V - Aug-25-2023, 10:34 PM
RE: Cannot rename Columns in df - by snippsat - Aug-26-2023, 12:28 AM
RE: Cannot rename Columns in df - by deanhystad - Aug-26-2023, 01:16 AM
RE: Cannot rename Columns in df - by tester_V - Aug-26-2023, 03:50 AM
RE: Cannot rename Columns in df - by deanhystad - Aug-26-2023, 10:40 PM
RE: Cannot rename Columns in df - by perfringo - Aug-27-2023, 06:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to rename dataframe columns based on the content in an index? ar_mahdavi 2 2,534 Jun-07-2021, 06:09 AM
Last Post: ricslato

Forum Jump:

User Panel Messages

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