Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas read_csv drop last column

# Drop last column of a dataframe
df = df.iloc[: , :-1]
# Drop last 2 column of a dataframe
df = df.iloc[: , :-2]
Comment

PREVIOUS NEXT
Code Example
Python :: python execute string 
Python :: dataframe slice by list of values 
Python :: python reference script directory 
Python :: renomear colunas pandas 
Python :: pytest ignore warnings 
Python :: django created at field 
Python :: install python3.7 ubuntu 20.04 
Python :: python random randint except a number 
Python :: how to install flask module in vscode 
Python :: how to send whatsapp message with python 
Python :: prettytable python 
Python :: how to calculate running time in python 
Python :: python pi value 
Python :: how to check opencv version using python 
Python :: how to create a random number between 1 and 10 in python 
Python :: python seaborn lmplot add title 
Python :: python print colored text 
Python :: qtimer python 
Python :: python get arguments 
Python :: pygame fullscreen 
Python :: python list of dates between 
Python :: edit json file python 
Python :: read json file python utf8 
Python :: python conda how to see channels command 
Python :: display max rows pandas 
Python :: python cmd colors 
Python :: dictionaries to http data python 
Python :: python number to array of digits 
Python :: get list of all files in folder and subfolders python 
Python :: how to print char of element in list of pytohn 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =