MulaiMulai sekarang secara gratis

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().

Latihan ini adalah bagian dari kursus

Introduction to Testing in Python

Lihat Kursus

Latihan interaktif praktis

Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.

Mulai berolahraga