drop columns and rows in one line in pandas
I want to drop a range of rows and columns of a dataframe, I did it as follow:
df.drop(df.columns[3:], axis=1, inplace=True)
df.drop(df.index[3:], axis=0, inplace=True)
Can I do the two processes in one method instead of two? Or is there any more sufficient way to accomplish this?
Category Data Science