The axis parameter is orthogonal to the direction which you wish to sum.

Unfortunately, the pandas documentation for sum doesn't currently make this clear, but the documentation for count does:

Parameters

  • axis : {0 or ‘index’, 1 or ‘columns’}, default 0

    If 0 or ‘index’ counts are generated for each column. If 1 or ‘columns’ counts are generated for each row.

Answer from human3 on Stack Overflow
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.isnull.html
pandas.DataFrame.isnull — pandas 3.0.2 documentation
>>> df.isna() age born name toy 0 False True False True 1 False False False False 2 True False False False · Show which entries in a Series are NA.
🌐
Atlassian
atlassian.com › data › notebook › how-to-check-if-any-value-is-nan-in-a-pandas-dataframe
How to check if any value is NaN in a pandas DataFrame
In order to get the total summation of all missing values in the DataFrame, we chain two .sum() methods together: 1In [8]: df.isnull().sum().sum() 2Out[8]: 35
🌐
Note.nkmk.me
note.nkmk.me › home › python › pandas
pandas: Detect and count NaN (missing values) with isnull(), isna() | note.nkmk.me
August 2, 2023 - If axis=1, it is applied to rows. ... sum() calculates as True=1 and False=0, you can count the number of NaN in each row and column by calling sum() on the result of isnull()....
🌐
W3Schools
w3schools.com › python › pandas › ref_df_isnull.asp
Pandas DataFrame isnull() Method
The isnull() method returns a DataFrame object where all the values are replaced with a Boolean value True for NULL values, and otherwise False.
🌐
Plus2Net
plus2net.com › python › pandas-dataframe-isnull.php
Python Pandas DataFrame isnull to check all missing or NaN or NA values
print(my_data['id'].isnull().sum()) # output 3 print(my_data['name'].isnull().sum()) # output 2 print(my_data['class1'].isnull().sum()) # output 1 print(my_data['mark'].isnull().sum()) # output 2 print(my_data['sex'].isnull().sum()) # output ...
Find elsewhere
🌐
Miami University
miamioh.edu › cads › students › coding-tutorials › python › data-cleaning › index.html
Page Title | Dept | Division - Miami University
The function dataframe.isnull().values.any() returns True when there is at least one missing value occurring in the data. The function dataframe.isnull().sum().sum() returns the number of missing values in the dataset.
🌐
Medium
medium.com › @amit25173 › understanding-pandas-isnull-46ec259367f9
Understanding pandas.isnull(). I understand that learning data science… | by Amit Yadav | Medium
March 6, 2025 - You’ve found the missing values — but how many are there? Here’s the trick: combine isnull() with sum(). # Counting missing values in each column missing_counts = pd.isnull(df).sum() print(missing_counts)
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-count-the-number-of-nan-values-in-pandas
How to count number of NaN values in Pandas? - GeeksforGeeks
July 15, 2025 - To get the total count of NaN values across the entire DataFrame, use isnull().sum().sum(). This performs a summation of NaNs per column, then sums these totals to get an overall count.
🌐
Pinterest
pinterest.com › pin › 710583647432056294
Get number of Null values in a #pandas dataframe
August 9, 2018 - Get number of Null values in a #pandas dataframe: df.isnull().sum() (column wise) df.isnull().sum(axis=1) (row wise) #python
🌐
Kaggle
kaggle.com › questions-and-answers › 318805
about isnull().sum()
Checking your browser before accessing www.kaggle.com · Click here if you are not automatically redirected after 5 seconds
🌐
Medium
medium.com › @whyamit101 › understanding-pandas-isnull-429cc36c1317
Understanding pandas.isnull(). If you think you need to spend $2,000… | by why amit | Medium
February 26, 2025 - You’ve found the missing values — but how many are there? Here’s the trick: combine isnull() with sum(). # Counting missing values in each column missing_counts = pd.isnull(df).sum() print(missing_counts)
🌐
Kaggle
kaggle.com › c › house-prices-advanced-regression-techniques › discussion › 172178
Checking your browser - reCAPTCHA
August 4, 2020 - Checking your browser before accessing www.kaggle.com · Click here if you are not automatically redirected after 5 seconds
🌐
Medium
medium.com › @bouimouass.o › identify-missing-values-in-each-column-with-pandas-d4bdefb150dd
Identify missing values in each column with pandas. | by Omar | Medium
February 29, 2024 - Here’s how you can use isnull().sum() in your code: ... # Create a sample DataFrame data = {'col1': [1, None, 3, 4], 'col2': [None, 5, None, 6], 'col3': [7, 8, None, 9]} df = pd.DataFrame(data)# Print the DataFrame print(df)# Count the number of missing values in each column using isnull().sum() print(df.isnull().sum())
🌐
Medium
medium.com › @denizgunay › missing-values-6742e535196b
Missing Values. Missing data is a problem for every… | by Deniz Gunay | Medium
August 15, 2023 - Instead of #filling NaN values according to sex, we can diretly fill all NaN values #as general mean. However, what we have done here is more realistic. print(df.isnull().sum()) ''' PassengerId 0 Survived 0 Pclass 0 Name 0 Sex 0 Age 0 SibSp 0 Parch 0 Ticket 0 Fare 0 Cabin 687 Embarked 2 dtype: int64 '''