Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandas question
#4
This is an old question, the problem was:
- The original author created "good looking" column headers: 2 rows with nice colors.
- But columns need only 1 header name:
So: sometimes it was in row 0, sometimes in row 1.
Sometimes in both rows, when the top row title "groups" a few columns from row 1. (Like "name", groups "first name, family name" below)

I had speculated you could explain to pandas which header name to pick alternatively from row 0 or 1, but that does not work.
As suggested manual correction is always possible, but not for a few hundred excels.

I skipped the headers, (re)named them programmatically, and did not look back.
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
Pandas question - by DPaul - Mar-27-2023, 03:32 PM
RE: Pandas question - by farshid - Apr-20-2023, 04:30 PM
RE: Pandas question - by deanhystad - Apr-20-2023, 08:42 PM
RE: Pandas question - by DPaul - Apr-22-2023, 05:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How is pandas modifying all rows in an assignment - python-newbie question markm74 1 747 Nov-28-2023, 10:36 PM
Last Post: deanhystad
  Question on pandas.dataframe merging two colums shomikc 4 892 Jun-29-2023, 11:30 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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