Answers for "drop last two columns pd df"

0

how to delete last N columns of dataframe

N = 3
# Drop last N columns of dataframe
df = df.iloc[: , :-N]
Posted by: Guest on December-19-2021
0

how to remove last 2 rows in a dataframe

df1 = df.iloc[:3]
Posted by: Guest on August-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language