Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

remove ,drop,effacer, dataframe,python

# Import pandas package
import pandas as pd

# create a dictionary with five fields each
data = {
'A':['A1', 'A2', 'A3', 'A4', 'A5'],
'B':['B1', 'B2', 'B3', 'B4', 'B5'],
'C':['C1', 'C2', 'C3', 'C4', 'C5'],
'D':['D1', 'D2', 'D3', 'D4', 'D5'],
'E':['E1', 'E2', 'E3', 'E4', 'E5'] }

# Convert the dictionary into DataFrame
df = pd.DataFrame(data)
#drop the 'A' column from your dataframe df 
df.drop(['A'],axis=1,inplace=True)
df

#-->df contains 'B','C','D' and 'E'
#in this example you will change your dataframe , if you don't want to ,
#just remove the in place parameter and assign your result to an other variable 

df1=df.drop(['B'],axis=1)
#-->df1 contains 'C','D','E'
df1
Comment

PREVIOUS NEXT
Code Example
Python :: calculate percentile pandas dataframe 
Python :: solve ax=b python 
Python :: pandas to dictionary 
Python :: abc python 
Python :: pygame mirror image 
Python :: python format subprocess output 
Python :: github python projects for beginners 
Python :: python extract zip file without directory structure 
Python :: 3d array numpy 
Python :: python get list of file and time created 
Python :: number system conversion python 
Python :: python open all files of type csv 
Python :: panda search strings in column 
Python :: how do you write a function in python 
Python :: python keep value recursive function 
Python :: Python datetime to string using strftime() 
Python :: query with condition django 
Python :: relative path django 
Python :: create requirement .txt 
Python :: pandas select first within groupby 
Python :: Python capitalize first letter of string without changing the rest 
Python :: python list fill nan 
Python :: python plot groupby 
Python :: download python 2.7 for windows 10 
Python :: if else one line python 
Python :: droping Duplicates 
Python :: label change in tkinter 
Python :: replace outliers with nan python 
Python :: dataframe color cells 
Python :: calculate mean median mode in python 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =