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
Exercise instructions
- Import the
pandas
module using an alias ofpd
. - Create
sales_df
by using a pandas function to convertsales
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(____.____())