Get startedGet started for free

Aggregate with sum

You will deal with an aggregation feature, agg_with_sum(). As you know, pd.DataFrame.groupby() returns a new dataset by aggregating the initial one with some function, in this case - .sum(). But the important thing is that you want to verify it works properly.

Let's assume you know nothing about the data, but you know for sure that agg_with_sum() returns pd.Series. It is also reasonable to assume that the pd.Series will not be empty, and it will also contain some numeric values since it was processed with .sum().

This exercise is part of the course

Introduction to Testing in Python

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise