Answers for "remove one column of dataframe by number"

1

delete unnamed coloumns in pandas

# Best method so far.
df = df.loc[:, ~df.columns.str.contains('^Unnamed')]
Posted by: Guest on May-24-2021
0

delete df rows where column value = 0: mult col's

df.loc[(df[['a', 'b']] != 0).all(axis=1)]
Posted by: Guest on August-02-2021

Code answers related to "remove one column of dataframe by number"

Python Answers by Framework

Browse Popular Code Answers by Language