Setup
Borrowed @MaxU's df

df = pd.DataFrame([
    [1, 2, 3],
    [4, None, 6],
    [None, 7, 8],
    [9, 10, 11]
], dtype=object)

Solution
You can just use pd.DataFrame.dropna as is

df.dropna()

   0   1   2
0  1   2   3
3  9  10  11

Supposing you have None strings like in this df

df = pd.DataFrame([
    [1, 2, 3],
    [4, 'None', 6],
    ['None', 7, 8],
    [9, 10, 11]
], dtype=object)

Then combine dropna with mask

df.mask(df.eq('None')).dropna()

   0   1   2
0  1   2   3
3  9  10  11

You can ensure that the entire dataframe is object when you compare with.

df.mask(df.astype(object).eq('None')).dropna()

   0   1   2
0  1   2   3
3  9  10  11
Answer from piRSquared on Stack Overflow
🌐
IncludeHelp
includehelp.com › python › pandas-dataframe-remove-all-rows-where-none-is-the-value-in-any-column.aspx
Python - Pandas dataframe remove all rows where None is the value in any column
# Importing pandas package import pandas as pd # Importing numpy package import numpy as np # Creating a dictionary d = { 'a' : [1, 2, 3], 'b':[4, 'None', 6], 'c':['None', 7, 8], 'd':[9, 10, 11] } # Creating a DataFrame df = pd.DataFrame(d) # Display original DataFrame print("Original Dataframe:\n",df,"\n") # Removing rows for None res = df.mask(df.eq('None')).dropna() # Display Result print('Result:\n',res)
🌐
Krsw
itips.krsw.biz › home › dev › python
How to remove none from pandas DataFrame - ITipsシステムソリューションズ
June 9, 2025 - So how can we remove data that has none in all columns ? This case, use how="all". If you set how="all", you can get data without rows that has none in all columns. data_list1 = [ [1,2,None], [2,None,4], [None,None,None], [4,5,6] ] col_list1 ...
🌐
Vitoshacademy
vitoshacademy.com › python-remove-spaces-and-none-from-pandas-dataframe
Python – Remove spaces and None from pandas dataframe – Useful code
December 17, 2023 - import pandas as pd # 1. Remove spaces in dataframe columns. salary_data = { "people":['John', 'Peter', 'Sam'], "salary":[' 50 ', ' 40 ', '33 '] } salary = pd.DataFrame(salary_data) def whitespace_remover(df): for i in df.columns: if df[i].dtype == 'object': df[i] = df[i].map(str.strip) return df salary = whitespace_remover(salary) # 2. Remove `None` values from dataframe rows. salary_data = { "people":['John', 'Peter', 'Sam'], "salary":[' 50 ', None, '33 '] } salary = pd.DataFrame(salary_data) salary_none = salary[salary.isna().any(axis=1)] salary_without_none = salary.dropna() # 3. Filter da
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.dropna.html
pandas.DataFrame.dropna — pandas 3.0.6 documentation
DataFrame.dropna(*, axis=0, how=<no_default>, thresh=<no_default>, subset=None, inplace=False, ignore_index=False)[source]# Remove missing values.
🌐
Seaborn
deeplearningnerds.com › pandas-remove-null-values-from-a-dataframe
Pandas - Remove Null Values from a DataFrame
November 5, 2023 - To do this, we use the dropna() method of Pandas. We have to use the how parameter and pass the value "all" as argument: ... Next, we would like to remove all rows from the DataFrame that have null values in the column "framework".
🌐
Sentry
sentry.io › sentry answers › python › remove dataframe rows with missing values in python
Remove DataFrame rows with missing values in Python | Sentry
October 15, 2023 - In Pandas, how do I remove DataFrame rows that contain None or NaN across all columns? How can I do this when these values are present in only some columns? We can achieve both of these results using the DataFrame.dropna method. For example: import pandas from numpy import nan df = pandas.DataFrame( { "Test 1": [90, 10, nan, nan], "Test 2": [41, nan, 32, nan], "Test 3": [89, 35, 72, nan], "Test 4": [52, nan, nan, nan], } ) print(df) # output: # Test 1 Test 2 Test 3 Test 4 # 0 90.0 41.0 89.0 52.0 # 1 10.0 NaN 35.0 NaN # 2 NaN 32.0 72.0 NaN # 3 NaN NaN NaN NaN df_no_empty_rows = df.dropna(how="a
Find elsewhere
🌐
Altcademy
altcademy.com › blog › how-to-drop-nan-values-in-pandas
How to drop nan values in Pandas - Altcademy.com
January 11, 2024 - Pandas provides a powerful method called dropna() to deal with missing values. This method scans through your DataFrame (a kind of data table in Pandas), finds the NaN values, and drops the rows or columns that contain them.
🌐
DNMTechs
dnmtechs.com › remove-rows-with-none-values-in-pandas-dataframe
Remove Rows with ‘None’ Values in Pandas Dataframe – DNMTechs – Sharing and Storing Technology Knowledge
import pandas as pd # Create a ... In Python, Pandas provides a convenient method to remove rows with ‘None’ values from a dataframe using the dropna() function....
🌐
DigitalOcean
digitalocean.com › community › tutorials › pandas-dropna-drop-null-na-values-from-dataframe
How To Use Python pandas dropna() to Drop NA Values from DataFrame | DigitalOcean
Technical tutorials, Q&A, events — This is an inclusive place where developers can find or lend support and discover new ways to contribute to the community.
Top answer
1 of 2
1

Use:

#DataFrame from sample data
df_out = pd.DataFrame(df_out)

#filter columns names by list and test if NaN or None at least in one row
m = df_out[['aaa','bbb']].isna().any(axis=1)

#OR test both columns separately
m = df_out['aaa'].isna() | df_out['bbb'].isna()


#filter matched and not matched rows
df1 = df_out[m].reset_index(drop=True)
df2 = df_out[~m].reset_index(drop=True)
print (df1)
         name   aaa   bbb
0        Mick  None  None
1  Ivan-Peter     1  None

print (df2)
   name aaa bbb
0  Ivan   A   C
1  Juli   1   P

Another idea with DataFrame.dropna and filter indices not exist in df2:

df2 = df_out.dropna()
df1 = df_out.loc[df_out.index.difference(df2.index)].reset_index(drop=True)
df2 = df2.reset_index(drop=True)
2 of 2
1

First of all one needs to convert df_out to a dataframe with pandas.DataFrame as follows

df_out = pd.DataFrame(df_out)

[Out]:

         name   aaa   bbb
0        Mick  None  None
1        Ivan     A     C
2  Ivan-Peter     1  None
3        Juli     1     P

Then one can use, for both cases, pandas.Series.notnull.

With values, where we have None in columns aaa and/or bbb, named filter_nulls in my code

df1 = df_out[~df_out['aaa'].notnull() | ~df_out['bbb'].notnull()]

[Out]:

         name   aaa   bbb
0        Mick  None  None
2  Ivan-Peter     1  None

Where we do not have None at all. df_out in my code.

df2 = df_out[df_out['aaa'].notnull() & df_out['bbb'].notnull()]

[Out]:

   name aaa bbb
1  Ivan   A   C
3  Juli   1   P

Notes:

  • If needed one can use pandas.DataFrame.reset_index to get the following

    df_new = df_out[~df_out['aaa'].notnull() | ~df_out['bbb'].notnull()].reset_index(drop=True)
    
    [Out]:
    
             name   aaa   bbb
    0        Mick  None  None
    1  Ivan-Peter     1  None
    
🌐
Reddit
reddit.com › r/learnpython › pandas - how to remove rows from dataframe when only one column is none
r/learnpython on Reddit: pandas - how to remove rows from dataframe when only one column is None
May 15, 2021 -

I'm trying to remove rows from a dataframe where a specific column (license) is None. The code I'm trying is below

df_autos = pd.read_sql_query('SELECT * FROM "autos"', con=engine)
print('df_autos ',df_autos,len(df_autos))
df_autos = df_autos[df_autos['license'].apply(lambda x: x is not None)]
print('df_autos after removal ',df_autos,len(df_autos))

but when I look in the terminal at the second print statement the length is the same. The df_autos remains unchanged, what I want to see is the length get reduced for each row where None is the value for the license column. Any ideas...

🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas drop columns with nan or none values
Pandas Drop Columns with NaN or None Values - Spark By {Examples}
September 24, 2024 - To drop columns in a Pandas DataFrame that contain NaN or None values, you can use the dropna() method along with the axis=1 argument to specify that
🌐
Saturn Cloud
saturncloud.io › blog › how-to-delete-rows-with-null-values-in-a-specific-column-in-pandas-dataframe
How to Delete Rows with Null Values in a Specific Column in Pandas DataFrame | Saturn Cloud Blog
May 1, 2026 - The dropna() method removes all rows that contain null values in the specified column. ... inplace is a Boolean value that determines whether to modify the original DataFrame or return a new one.
🌐
Real Python
realpython.com › how-to-drop-null-values-in-pandas
How to Drop Null Values in pandas With .dropna() – Real Python
September 24, 2025 - Learn how to use .dropna() to drop null values from pandas DataFrames so you can clean missing data and keep your Python analysis accurate.
🌐
Vultr Docs
docs.vultr.com › python › third party › pandas › dataframe › dropna()
Python Pandas DataFrame dropna() - Remove Missing ...
December 31, 2024 - Use dropna() to remove any rows with missing values. ... import pandas as pd data = {'Name': ['Alice', 'Bob', None, 'David'], 'Age': [24, None, 29, 31], 'Profession': ['Engineer', 'Doctor', 'Artist', None]} df = pd.DataFrame(data) cleaned_df ...