Aan de slagGa gratis aan de slag

Practicing aggregations

It's time to begin exploring the in-app purchase data in more detail. Here, you will practice aggregating the dataset in various ways using the .agg() method and then examine the results to get an understanding of the overall data, as well as a feel for how to aggregate data using pandas.

Loaded for you is a DataFrame named purchase_data which is the dataset of in-app purchase data merged with the user demographics data from earlier.

Before getting started, it's good practice to explore this purchase_data DataFrame in the IPython Shell. In particular, notice the price column: you'll examine it further in this exercise.

Deze oefening maakt deel uit van de cursus

Customer Analytics and A/B Testing in Python

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Calculate the mean purchase price 
purchase_price_mean = purchase_data.price.agg('____')

# Examine the output 
print(purchase_price_mean)
Code bewerken en uitvoeren