Simplest of all solutions:
filtered_df = df[df['name'].notnull()]
Thus, it filters out only rows that doesn’t have NaN values in ‘name’ column.
For multiple columns:
filtered_df = df[df[['name', 'country', 'region']].notnull().all(1)]
More Related Contents:
- Annotate bars with values on Pandas bar plots
- How to make separator in pandas read_csv more flexible wrt whitespace, for irregular separators?
- Why isn’t my Pandas ‘apply’ function referencing multiple columns working? [closed]
- Convert the string 2.90K to 2900 or 5.2M to 5200000 in pandas dataframe
- Conditionally fill column values based on another columns value in pandas
- pandas concat generates nan values
- Normalize columns of a dataframe
- Pandas Groupby and Sum Only One Column
- Quickest way to make a get_dummies type dataframe from a column with a multiple of strings
- Pandas Dataframe: Replacing NaN with row average
- How to read a .xlsx file using the pandas Library in iPython?
- “unstack” a pandas column containing lists into multiple rows [duplicate]
- Pandas Replace NaN with blank/empty string
- How to check whether a pandas DataFrame is empty?
- Convert pandas data frame to series
- vectorize conditional assignment in pandas dataframe
- Pandas DataFrame merge summing column
- Mapping ranges of values in pandas dataframe [duplicate]
- Binning a column with pandas
- Convert month int to month name in Pandas
- How to get/set a pandas index column title or name?
- Python pandas integer YYYYMMDD to datetime
- Pandas: drop columns with all NaN’s
- Calculate summary statistics of columns in dataframe
- How to use str.contains() with multiple expressions in pandas dataframes
- Check if certain value is contained in a dataframe column in pandas [duplicate]
- UnicodeDecodeError when reading CSV file in Pandas
- How to return a csv file/Pandas DataFrame in JSON format using FastAPI?
- How to get number of groups in a groupby object in pandas?
- how to understand closed and label arguments in pandas resample method?