Analyze sales data with pandas
Level: Advanced (score: 4)
For this Bite we got some fake Excel sales data which we are going to analyze with pandas
.
First complete load_excel_into_dataframe
to do just that. As stated in the docstring the data is in the SalesOrders sheet. This function forms the basis for the next 3 functions you need to complete.
Next complete get_year_region_breakdown
to get a grouping of sales by Year (a new column you probably want to add) and Region. Return the newly obtained DataFrame which should look like this:
Year Region 2018 Central 3833.51 East 5193.71 West 231.12 2019 Central 7305.56 East 808.38 West 2255.60 Name: Total, dtype: float64
Lastly code up get_best_sales_rep
and get_most_sold_item
to learn which sales rep performed best and what item had most (unit) sales. See the docstrings for the required return tuples. They are pretty similar so solving the fist one should make it pretty easy to solve the second one.
We hope this is a realistic and fun data analysis exercise. Keep calm and code more Python + pandas
!