Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to delete last N columns of dataframe

N = 3
# Drop last N columns of dataframe
df = df.iloc[: , :-N]
 
PREVIOUS NEXT
Tagged: #delete #N #columns #dataframe
ADD COMMENT
Topic
Name
4+8 =