Search⌘ K
AI Features

Challenge Solution Review

Explore how to load data using read_csv and manipulate DataFrames by extracting unique values, and calculating sum, mean, and count for a specific column. This lesson helps you solidify practical skills in handling data with pandas through a challenge solution review.

We'll cover the following...
Python 3.5
import pandas as pd
df = pd.read_csv("raw_data.csv",
sep=",",
header=0)
item_uniq = len(df["Item ID"].unique())
total_price = df["Price"].sum()
mean_price = df["Price"].mean()
purchase_cnt = df["Price"].count()
print(item_uniq, total_price, mean_price, purchase_cnt)

First, you need to load the file read_csv at line 3.

If you ...