FAQ: Data Summaries - Central Tendency for Quantitative Data

This community-built FAQ covers the “Central Tendency for Quantitative Data” exercise from the lesson “Data Summaries”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Exploratory Data Analysis in Python

FAQs on the exercise Central Tendency for Quantitative Data

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in Language Help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to Language Help and Tips and Resources. If you are wanting feedback or inspiration for a project, check out Projects.

Looking for motivation to keep learning? Join our wider discussions in Community

Learn more about how to use this guide.

Found a bug? Report it online, or post in Bug Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Why the mode output looks different from the other methods?

0    20000000.0
dtype: float64

because of how this function is written, the mode is returned as a pandas series. In order to convert it to a single value, we can extract the first value in the series

movies.production_budget.mode()[0]

Is there another way to get the trimmed mean in this exercise without using another library? Or is there a reason why scipy is best option?

Yep:

df['col_name'].mean().round(2)

#or, in this exercise, 

variable_name = df.column.mean().round(2)
print(variable_name)

@lisalisaj I am not sure if I follow here. I tried doing this using your method but round just rounds it down to the 2 decimal places. Trimmed mean takes out the top and bottom X% in the data frame for the column and then calculate the mean?