Reputation: 2155
Is there a way I can drop all rows in a pandas dataframe, where the sum of all columns is equal to 0?
Upvotes: 1
Views: 50
Reputation: 863301
You can change logic - select all column with sum not equal 0
with boolean indexing
:
df = df[df.sum(axis=1).ne(0)]
Upvotes: 3