Python Forum
How to drop column in pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to drop column in pandas
#1
Hi,
I have below DataFrame,

Group Category Subject  AC1         AC2    AC3     BM1        BM2    NJ1        NJ2     NJ3  
Va    Vb       Vc       Datecode    Run1   Status  Datecode   Rank   Datecode   Power voltage
HY    JK       KL       2019-08-01   23    29      2019-08-12 0      2019-08-03  123   110   
HH    MK       VN       2019-08-09   28    45      2019-08-06 32     2019-08-13  125   220 


I want to delete columns with column name 'Datecode" in "zeroth row", I can not use df.drop
df.drop(['Datecode'], axis=1), but it does not work. Kindly help, how to do this.
Reply


Messages In This Thread
How to drop column in pandas - by SriMekala - Aug-26-2019, 02:10 PM
RE: How to drop column in pandas - by ThomasL - Aug-26-2019, 05:00 PM
RE: How to drop column in pandas - by perfringo - Aug-26-2019, 05:26 PM
RE: How to drop column in pandas - by snippsat - Aug-26-2019, 06:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  HTML Decoder pandas dataframe column mbrown009 3 962 Sep-29-2023, 05:56 PM
Last Post: deanhystad
  pandas column percentile nuncio 7 2,383 Aug-10-2022, 04:41 AM
Last Post: nuncio
  pandas: Compute the % of the unique values in a column JaneTan 1 1,759 Oct-25-2021, 07:55 PM
Last Post: jefsummers
  Pandas Data frame column condition check based on length of the value aditi06 1 2,655 Jul-28-2021, 11:08 AM
Last Post: jefsummers
  How to move each team row to a new column. Pandas vladiwnl 0 1,696 Jun-13-2021, 08:10 AM
Last Post: vladiwnl
  iretate over columns in df and calculate euclidean distance with one column in pandas Pit292 0 3,269 May-09-2021, 06:46 PM
Last Post: Pit292
Question Pandas - Creating additional column in dataframe from another column Azureaus 2 2,919 Jan-11-2021, 09:53 PM
Last Post: Azureaus
  Pandas: summing columns conditional on the column labels ddd2332 0 2,078 Sep-10-2020, 05:58 PM
Last Post: ddd2332
  Pandas DataFrame and unmatched column sritsv19 0 2,991 Jul-07-2020, 12:52 PM
Last Post: sritsv19
  Pandas - Dynamic column aggregation based on another column theroadbacktonature 0 3,012 Apr-17-2020, 04:54 PM
Last Post: theroadbacktonature

Forum Jump:

User Panel Messages

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