Python Forum
Removing the index column from df
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing the index column from df
#2
Are you sure it doesn't work? df.reset_index(drop=True) does not work in place. It creates a new Dataframe that is the return value of the function call. Are you doing this:
new_df = df.reset_index(drop=True)
Reply


Messages In This Thread
Removing the index column from df - by bnadir55 - Apr-05-2022, 07:03 AM
RE: Removing the index column from df - by deanhystad - Apr-05-2022, 07:14 AM
RE: Removing the index column from df - by bnadir55 - Apr-05-2022, 08:36 AM
RE: Removing the index column from df - by bnadir55 - Apr-05-2022, 11:55 AM
RE: Removing the index column from df - by snippsat - Apr-05-2022, 12:50 PM
RE: Removing the index column from df - by bnadir55 - Apr-05-2022, 01:27 PM
RE: Removing the index column from df - by snippsat - Apr-05-2022, 02:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pandas pivot table: How to find count for each group in Index and Column JaneTan 0 3,441 Oct-23-2021, 04:35 AM
Last Post: JaneTan
  Index error - columns vs non-column Vinny 3 5,051 Aug-09-2021, 04:46 PM
Last Post: snippsat
  How to define index column name using df.to_csv SriRajesh 0 1,814 Feb-13-2020, 03:45 PM
Last Post: SriRajesh
  How get row index of matching row in column 0 Sri 7 3,798 Apr-10-2019, 08:26 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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