filter = df['column']!= 0
df = df[filter]
# select columns by name
df.filter(items=['col1', 'col2'])
alldata_balance = alldata[(alldata[IBRD] !=0) | (alldata[IMF] !=0)]
#To select rows whose column value is in list
years = [1952, 2007]
gapminder.year.isin(years)
Code Example |
---|
Python :: loading bar |
Python :: title() in python |
Python :: matplotlib window size |
Python :: python tuple example |
Python :: keys function in python |
Python :: python add list |
Python :: python reverse range |
Python :: pandas get size of each group |
Python :: django middleware |
Python :: python string: .strip() |
Python :: |safe django |
Python :: summing all Odd Numbers from 1 to N |
Python :: truncatechars django |
Python :: map vs apply pandas |
Python :: Python list loop tutorial |
Python :: python turtle tutorial |
Python :: create an empty list in python |
Python :: test pypi |
Python :: opencv resize image |
Python :: django model |
Python :: fastest way to iterate dictionary python |
Python :: standard error of mean |
Python :: pybase64 tutorial |
Python :: args in python |
Python :: get min of list python |
Python :: bayesian model probability |
Python :: crud python |
Python :: unittest |
Python :: manual merge sort |
Python :: python3 |