Get startedGet started for free

Working with pandas

pandas is an example of a popular Python package.

In this exercise, the sales dictionary has been created and made available to you, and your task is to convert it into a pandas DataFrame and preview the first five rows.

This exercise is part of the course

Intermediate Python for Developers

View Course

Exercise instructions

  • Import the pandas module using an alias of pd.
  • Create sales_df by using a pandas function to convert sales into a DataFrame.
  • Preview the first five rows of sales_df.

Hands-on interactive exercise

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

# Import pandas as pd
____ ____ ____ ____

# Convert sales to a pandas DataFrame
____ = ____.____()

# Preview the first five rows
print(____.____())
Edit and Run Code