Get startedGet started for free

Loading a DataFrame

We're still working hard to solve the kidnapping of Bayes, the Golden Retriever. Previously, we used a license plate spotted at the crime scene to narrow the list of suspects to:

  • Fred Frequentist
  • Ronald Aylmer Fisher
  • Gertrude Cox
  • Kirstine Smith

We've obtained credit card records for all four suspects. Perhaps some of them made suspicious purchases before the kidnapping?

The records are in a CSV called "credit_records.csv".

This exercise is part of the course

Introduction to Data Science in Python

View Course

Exercise instructions

  • Import the pandas module under the alias pd.
  • Load the CSV "credit_records.csv" into a DataFrame called credit_records.
  • Display the first five rows of credit_records using the .head() method.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Import pandas under the alias pd
____

# Load the CSV "credit_records.csv"
credit_records = ____

# Display the first five rows of credit_records using the .head() method
print(____)
Edit and Run Code