Python Forum
How to change row 2 to column header within a dataframe
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change row 2 to column header within a dataframe
#2
Yes, there is an easy way built in to pandas to do exactly that. Have you looked at the docs???

https://pandas.pydata.org/pandas-docs/st...d_csv.html

Take a look at the 'header' parameter.
"So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth!" - Tim the Enchanter
Reply


Messages In This Thread
RE: How to change row 2 to column header within a dataframe - by Marbelous - Aug-20-2020, 03:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding PD DataFrame column bsben 2 410 Mar-08-2024, 10:46 PM
Last Post: deanhystad
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 825 Dec-04-2023, 09:48 PM
Last Post: sanky1990
  Difference one column in a dataframe Scott 0 708 Feb-10-2023, 08:41 AM
Last Post: Scott
  splitting a Dataframe Column in two parts nafshar 2 1,046 Jan-30-2023, 01:19 PM
Last Post: nafshar
  Change a numpy array to a dataframe Led_Zeppelin 3 1,207 Jan-26-2023, 09:01 PM
Last Post: deanhystad
  How to assign a value to pandas dataframe column rows based on a condition klllmmm 0 912 Sep-08-2022, 06:32 AM
Last Post: klllmmm
  renaming the 0 column in a dataframe Led_Zeppelin 5 1,744 Aug-16-2022, 04:07 PM
Last Post: deanhystad
  How to change UTC time to local time in Python DataFrame? SamKnight 2 1,724 Jul-28-2022, 08:23 AM
Last Post: Pedroski55
  Python create a spreadsheet with column and row header ouruslife 4 1,809 Jul-09-2022, 11:01 AM
Last Post: Pedroski55
  Copy a column from one dataframe to another dataframe Led_Zeppelin 17 12,164 Jul-08-2022, 08:40 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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