Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python pandas drop column by index

df.drop(a_dataframe.columns[0], axis=1, inplace=True)
Comment

df.drop index

df.reset_index(drop=True, inplace=True)
Comment

pandas df remove index

df = df.reset_index(drop=True)
Comment

pandas drop columns by index

cols = [1,2,4,5,12]
df.drop(df.columns[cols],axis=1,inplace=True)
Comment

df drop index

df = df.reset_index(drop=True)
Comment

pd df drop columns by index

df.drop([0, 1])
Comment

PREVIOUS NEXT
Code Example
Python :: django today date in template 
Python :: django created at field 
Python :: how to permanently store data in python 
Python :: how to get a random element from an array in python 
Python :: save model pickle 
Python :: pandas_datareader 
Python :: pandas remove time from datetime 
Python :: how to send whatsapp message with python 
Python :: unimport library python 
Python :: install pandas in python mac 
Python :: use python3 as default ubuntu 
Python :: human readable time difference python 
Python :: .fill pygame 
Python :: utf8 python encodage line 
Python :: only keep few key value from dict 
Python :: python str replace specifiek index 
Python :: convert text file into list 
Python :: f-string ponto decimal python 
Python :: list of prime numbers in python 
Python :: python turtle square 
Python :: pandas append dictionary to dataframe 
Python :: pandas plot xlabel 
Python :: how to make turtle invisible python 
Python :: Show the records that have nan values 
Python :: age in days to age in years 
Python :: Installing yfinance using pip 
Python :: draw circles matplotlib 
Python :: ipywidgets pip 
Python :: how to make a discord bot dm someone python 
Python :: remove x label matplotlib 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =