You can simply:

df['avg'] = df.mean(axis=1)

       Monday  Tuesday  Wednesday        avg
Mike       42      NaN         12  27.000000
Jenna     NaN      NaN         15  15.000000
Jon        21        4          1   8.666667

because .mean() ignores missing values by default: see docs.

To select a subset, you can:

df['avg'] = df[['Monday', 'Tuesday']].mean(axis=1)

       Monday  Tuesday  Wednesday   avg
Mike       42      NaN         12  42.0
Jenna     NaN      NaN         15   NaN
Jon        21        4          1  12.5
Answer from Stefan on Stack Overflow
🌐
Medium
medium.com › @amit25173 › pandas-average-of-column-bba24304bc02
Pandas Average of Column. The biggest lie in data science? That… | by Amit Yadav | Medium
April 12, 2025 - You can easily compute averages for multiple columns by selecting multiple columns in your DataFrame and applying the mean() function.
Discussions

python - pandas: return average of multiple columns - Stack Overflow
How do you output average of multiple columns? Gender Age Salary Yr_exp cup_coffee_daily Male 28 45000.0 6.0 2.0 Female 40 70000.0 15.0 ... More on stackoverflow.com
🌐 stackoverflow.com
How to do a simple rolling average across multiple columns in pandas?

What have you tried so far?

More on reddit.com
🌐 r/learnpython
4
3
March 23, 2020
python - Pandas dataframe: Group by two columns and then average over another column - Stack Overflow
Assuming that I have a dataframe with the following values: df: col1 col2 value 1 2 3 1 2 1 2 3 1 I want to first groupby my dataframe based on the first ... More on stackoverflow.com
🌐 stackoverflow.com
pandas - How to find median/average values between data frames with slightly different columns? - Data Science Stack Exchange
I am trying to combat run-to-run variance of the data I collect by combining the data from different runs and finding the mean/average. The problem is that in each run there is a chance that some o... More on datascience.stackexchange.com
🌐 datascience.stackexchange.com
December 13, 2021
🌐
Statology
statology.org › home › how to calculate the average of selected columns in pandas
How to Calculate the Average of Selected Columns in Pandas
November 29, 2021 - The average value of “points” and “rebounds” in the second row is calculated as: (19+8) / 2 = 13.5. ... How to Calculate a Trimmed Mean in Python How to Calculate Geometric Mean in Python How to Replace Values in Pandas Column Based ...
🌐
datagy
datagy.io › home › pandas tutorials › data analysis in pandas › pandas mean: calculate pandas average for one or multiple columns
Pandas Mean: Calculate the Pandas Average • datagy
December 15, 2022 - In this post, you’ll learn how to calculate the Pandas mean (average) for one column, multiple columns, or an entire dataframe. You’ll also learn how to skip na values or include them in your calculation. ... If you want a sample dataframe to follow along with, load the sample dataframe below. The data represents people’s salaries over a period of ...
🌐
Easy Tweaks
easytweaks.com › pandas-mean-column-dataframe
Calculate mean of one or more columns in Pandas ...
July 19, 2021 - Master meetings, chats, channels and online collaboration · Go beyond the basics in Word, Excel, PowerPoint and Outlook
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › how to get column average or mean in pandas dataframe
How to Get Column Average or Mean in Pandas DataFrame - Spark By {Examples}
December 12, 2024 - To get column average or mean from pandas DataFrame use either mean() or describe() method. The mean() method is used to return the mean of the values
Find elsewhere
🌐
Statology
statology.org › home › how to calculate the mean of columns in pandas
How to Calculate the Mean of Columns in Pandas
October 5, 2021 - The mean() function will also exclude NA’s by default. For example, if we find the mean of the “rebounds” column, the first value of “NaN” will simply be excluded from the calculation:
🌐
Arab Psychology
scales.arabpsychology.com › home › how to easily calculate the average of specific columns in pandas
How To Easily Calculate The Average Of Specific Columns In Pandas
December 2, 2025 - This is accomplished by passing a list of column names—hence the requirement for double square brackets—before applying the mean() function with `axis=1`. In our example, we choose to average ‘points’ and ‘rebounds’, deliberately excluding ‘assists’ from the calculation.
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.DataFrame.mean.html
pandas.DataFrame.mean — pandas 3.0.6 documentation
Return the mean of the values over the requested axis. ... Axis for the function to be applied on. For Series this parameter is unused and defaults to 0. For DataFrames, specifying axis=None will apply the aggregation across both axes. Added in version 2.0.0. ... Exclude NA/null values when computing the result. ... Include only float, int, boolean columns...
🌐
Saturn Cloud
saturncloud.io › blog › calculating-averages-of-multiple-columns-ignoring-nan-a-guide-for-data-scientists
Calculating Averages of Multiple Columns Ignoring NaN A Guide for Data Scientists | Saturn Cloud Blog
May 1, 2026 - Fortunately, pandas provides a simple solution to this problem: the mean() function has an optional parameter called skipna that we can set to True to ignore NaN values when calculating the average.
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 1.4.3 › getting_started › intro_tutorials › 06_calculate_statistics.html
How to calculate summary statistics? — pandas 1.4.3 documentation
The statistic applied to multiple columns of a DataFrame (the selection of two columns return a DataFrame, see the subset data tutorial) is calculated for each numeric column.
🌐
Pandas
pandas.pydata.org › docs › dev › getting_started › intro_tutorials › 06_calculate_statistics.html
How to calculate summary statistics — pandas 3.1.0.dev0 documentation
The statistic applied to multiple columns of a DataFrame (the selection of two columns returns a DataFrame, see the subset data tutorial) is calculated for each numeric column.
🌐
W3Schools
w3schools.com › python › pandas › ref_df_mean.asp
Pandas DataFrame mean() Method
Return the average (mean) value ... pd.DataFrame(data) print(df.mean()) Try it Yourself » · The mean() method returns a Series with the mean value of each column....
🌐
Reddit
reddit.com › r/learnpython › how to do a simple rolling average across multiple columns in pandas?
r/learnpython on Reddit: How to do a simple rolling average across multiple columns in pandas?
March 23, 2020 -

I'm having trouble creating a table that has a rolling average with a 3 month window for it. This is kind of what I have right now:

Date         A      B
2020-3-1     10     2  
2020-2-1     2      3
2020-1-1     4      1
2019-12-1    6      8
2019-11-1    2      4

The date column all have days set on the first of the month because the datas been grouped by so I only get essentially year-month.

Then end result I would like to have looks like this:

Date         A      B
2020-3-1     5.3    2  
2020-2-1     4      3
2020-1-1     4      4.3
2019-12-1    NAN    NAN
2019-11-1    NAN    NAN
🌐
IncludeHelp
includehelp.com › python › how-to-calculate-average-mean-of-pandas-column.aspx
How to calculate average/mean of Pandas column?
September 21, 2023 - In pandas, we use pandas.DataFrame['col'].mean() directly to calculate the average value of a column.
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 1.2 › getting_started › intro_tutorials › 06_calculate_statistics.html
How to calculate summary statistics? — pandas 1.2.5 documentation
The statistic applied to multiple columns of a DataFrame (the selection of two columns return a DataFrame, see the subset data tutorial) is calculated for each numeric column.