If you only want the mean of the weight column, select the column (which is a Series) and call .mean():

In [479]: df
Out[479]: 
         ID  birthyear    weight
0    619040       1962  0.123123
1    600161       1963  0.981742
2  25602033       1963  1.312312
3    624870       1987  0.942120

In [480]: df.loc[:, 'weight'].mean()
Out[480]: 0.83982437500000007
Answer from DSM on Stack Overflow
🌐
Medium
medium.com › @amit25173 › understanding-pandas-average-a-practical-guide-f2697cc6a75f
Understanding pandas average: A Practical Guide | by Amit Yadav | Medium
April 12, 2025 - The pandas library, widely used in Python for data manipulation, provides powerful tools to calculate averages quickly and efficiently.
Discussions

In a pandas dataframe, how to find the average value within specific categories as denoted in another column. See example in the description.
GroupBy in Pandas More on reddit.com
🌐 r/learnpython
3
1
May 27, 2023
[pandas] df.mean() gives different results to calculating mean in Excel?
Ah ****. I've just realised exactly what's causing this. batting_df.mean() was including the Totals row. The reason it was pretty much double, was because everything was being added up twice, then divided by n+1 instead of n*2. What an idiot. More on reddit.com
🌐 r/learnpython
3
6
August 18, 2021
Grouping by week in Pandas
I'm not entirely sure what your df is like (can you share the result of df.head()?), but if you have a row column with type datetime (or can get one with pd.to_datetime()), then try df.groupby(df['date'].dt.week).count() where 'date' is the name of your dates column. You can also get other summary statistics by replacing .count() with e.g. .mean(). More on reddit.com
🌐 r/datascience
8
4
June 14, 2016
How to combine rolling and resampling in pandas?
If you use pandas datetimeindex (pd.to_datetime) on your date column and then resample, there will be a different number datapoints depending on the value you use for the new sampling interval. You can choose these values based on mean(), min(), max(), sum() etc. By resampling you are creating a new data set with data-points at the specified intervals. More on reddit.com
🌐 r/learnpython
4
2
May 8, 2022
🌐
Saturn Cloud
saturncloud.io › blog › how-to-compute-row-average-in-pandas
How to Compute Row Average in Pandas | Saturn Cloud Blog
May 1, 2026 - The simplest way to compute row averages in pandas is to use the mean() method. This method calculates the mean (i.e., average) of a DataFrame or Series along a specified axis, which can be either rows or columns.
🌐
IONOS
ionos.com › digital guide › websites › web development › python pandas: dataframe mean
How to calculate averages with pandas mean() - IONOS
June 26, 2025 - To calculate the average of each column, you can use the pandas mean() function. By default, the axis parameter is set to 0, which cor­re­sponds to columns. column_means = df.mean() print(column_means)python · The code above cal­cu­lates ...
🌐
Pandas
pandas.pydata.org › docs › 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
🌐
Vultr Docs
docs.vultr.com › python › third party › pandas › dataframe › mean()
Python Pandas DataFrame mean() - Calculate Column Mean
December 24, 2024 - The mean() function in the Python Pandas library is designed to compute the mean, or average, of data within a DataFrame.
🌐
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 - If you wanted to calculate the mean by including missing values, you could first assign values using the Pandas .fillna() method.
Find elsewhere
🌐
Saturn Cloud
saturncloud.io › blog › how-to-get-the-average-of-a-groupby-with-pandas
How to Get the Average of a Groupby with Pandas | Saturn Cloud Blog
May 1, 2026 - We learned that groupby is a powerful ... We also learned that to get the average of a groupby in pandas, you can use the mean() method on the GroupBy object....
🌐
IncludeHelp
includehelp.com › python › how-to-calculate-average-mean-of-pandas-column.aspx
How to calculate average/mean of Pandas column?
September 21, 2023 - Suppose we have a series of numbers from 1 to 10, then the average of this series will be: ∑x = 1+2+3+4+5+6+7+8+9+10 ∑x = 55 n = 10 x̄ = 55/10 x̄ = 5.5 · In pandas, we use pandas.DataFrame['col'].mean() directly to calculate the average value of a column.
🌐
Python Examples
pythonexamples.org › pandas-dataframe-mean
Pandas DataFrame.mean: Compute the Mean of DataFrame Values
The DataFrame.mean method in pandas calculates the mean (average) of numerical values in a DataFrame along a specified axis.
🌐
W3Schools
w3schools.com › python › pandas › ref_df_mean.asp
Pandas DataFrame mean() Method
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
🌐
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 - Understanding this distinction is the foundation of efficient data manipulation within Python using the Pandas library. The calculation of average row values can be achieved using two principal methods, depending entirely on whether the analysis requires all numerical columns to be included or just a select subset.
🌐
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
🌐
TechBeamers
techbeamers.com › pandas-get-column-average-mean
Python: Pandas Get Average Of Column Or Mean - TechBeamers
November 30, 2025 - Welcome to another Python tutorial on Pandas! In this guide, we’ll explore how to get the average of a column using the powerful Pandas library. Pandas is a versatile data manipulation and analysis…
🌐
GeeksforGeeks
geeksforgeeks.org › pandas › pandas-groupby-average
Pandas Groupby Average - GeeksforGeeks
July 23, 2025 - The most basic way to calculate the average for grouped data with a single column and then applying the mean() function to the grouped data. Python · import pandas as pd data = { 'Name': ['Alice', 'Bob', 'Charlie', 'Diana', 'Eve'], 'Gender': ...
🌐
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 - Absolutely! You can use the groupby() function in Pandas to group your data based on categories and then calculate averages for each group.
🌐
IncludeHelp
includehelp.com › python › compute-row-average-in-pandas.aspx
Compute row average in pandas
July 28, 2022 - With the help of pandas, we can calculate the mean of any column in a DataFrame, the column values should be integer or float values and not string. To compute the row average in pandas, we are going to use df.mean().
🌐
Erikrood
erikrood.com › Python_References › pandas_column_average_median_final.html
Get the mean and median from a Pandas column in Python
Looking to land a data science role? Practice interviewing with a few questions per week · Get the mean and median from a Pandas column in Python · import modules · import pandas as pd import numpy as np · create dummy dataframe · raw_data = {'name': ['Willard Morris', 'Al Jennings', 'Omar ...