FAQ: Aggregates in Pandas - Calculating Column Statistics

This community-built FAQ covers the “Calculating Column Statistics” exercise from the lesson “Aggregates in Pandas”.

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

Data Science

Data Analysis with Pandas

FAQs on the exercise Calculating Column Statistics

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!

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

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

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!

Hi,
how to download these csv files so that i can practics on the loacal system
thanks

can anyone guide me where to download these exercise file. mean csv files

there should be a folder/directory icon in the lesson:;

image

there you can open the csv file, from there you could copy paste the content. So far i know there isn’t a download functionality available.

1 Like

thanks for your quick response

Hey there. I’m wanting to take some notes on this. The cheatsheet for Data Analysis in Pandas doesn’t have the “common commands” and it’s not possible to copy them out because they are in this little scrolling box.

Is there reasoning behind why this lesson doesn’t have as much info in the cheatsheet or why it’s less accessible? Will it come up later again?

1 Like

The examples in this lesson show the results of printing a column of a DataFrame as being a list of values, e.g.

print(customers.age)
>> [23, 25, 31, 35, 35, 46, 62]

But when I print a column of a DataFrame I get an indexed series, e.g.

>>> df
    Name  Age
0  Bobby   25
1  Nigel   45
2  Monty   65
>>> print(df.Age)
0    25
1    45
2    65
Name: Age, dtype: int64

Any idea what causes this difference?

Hi, if you want it as a dataframe you should use

df[[“Age”]]

Check the difference between that an this one: df[“Age”]