Search⌘ K
AI Features

Solution 1: pandas Essentials

Explore fundamental pandas techniques for data analysis such as displaying data samples, calculating statistical values, filtering by conditions, and extracting key information. This lesson helps you confidently manage and analyze datasets to uncover insights using Python.

Task 1: Display the head

To see what the data looks like, display the first five rows of your dataset.

Solution

Python 3.5
import pandas as pd
def display_first_5_rows():
cust = pd.read_csv('Cust_Purch_FakeData.csv')
#Your Code Here
return cust.head()
print(display_first_5_rows())

Explanation

As we learned in our previous lessons, df.head() returns the first five rows of a dataset. We used this method to produce and print our first five rows.

Task 2: Min, max, and mean of ages

Return ...