avatar Bite 183. Analyze sales data with pandas

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!

Login and get coding
go back Advanced level
Bitecoin 4X

142 out of 144 users completed this Bite.
Will you be Pythonista #143 to crack this Bite?
Resolution time: ~69 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.0 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help