Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to delete last N columns of dataframe

N = 3
# Drop last N columns of dataframe
df = df.iloc[: , :-N]
Comment

PREVIOUS NEXT
Code Example
Python :: read_csv only certain columns 
Python :: create guid python 
Python :: python download image from url 
Python :: python find the key with max value 
Python :: open pkl file python 
Python :: how to check in which directory python in running 
Python :: pyqt drag and drop files 
Python :: get mouse postition python 
Python :: convert negative to zero in list in python 
Python :: check numpy version 
Python :: Can only use .dt accessor with datetimelike values 
Python :: python make txt file 
Python :: what to do in python when you get pygame.Surface object is not callable 
Python :: how to open a software using python 
Python :: how to import csv in pandas 
Python :: get last column pandas 
Python :: how to remove text in brackets of python 
Python :: add text to plot python 
Python :: python get how many days in current month 
Python :: tkinter give button 2 commands 
Python :: how to save a png seaborn pandas 
Python :: HOw to use passlock password manager python 
Python :: python check if a variable is an pandaDataframe 
Python :: count missing values by column in pandas 
Python :: how to get frequency of each elements in a python list 
Python :: connect postgresql with python sqlalchemy 
Python :: eigenvectors python 
Python :: tkinter how to disable window resizing 
Python :: pandas_datareader 
Python :: how to clear console in python 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =