Plotting Practice: Analyzing Restaurant Tips
Plotting Practice: Analyzing Restaurant Tips Data Science Project
Intro to Pandas for Data Analysis

Plotting Practice: Analyzing Restaurant Tips

In this project you'll practice how to create different visualizations like boxplots, line charts, histograms, etc using a Dataset containing Restaurant Tips. You'll do it directly from a pandas Dataframe using the `.plot` method, extremely convenient and powerful. You'll also learn the underlying details of the plotting library used by Pandas: matplotlib.

Project Activities

All our Data Science projects include bite-sized activities to test your knowledge and practice in an environment with constant feedback.

All our activities include solutions with explanations on how they work and why we chose them.

codevalidated

Load the data

Load the tips_data.csv and store its data in a tips_df variable.

codevalidated

Create a pie chart showing the proportion of smoker and non-smoker people giving tips

Create your pie chart and, when ready, save it to a tips_by_smokers_chart variable and validate it with the following button.

Your code should look like:

smokers_count = tips_df['smoker'].......

tips_by_smokers_chart = smokers_count.plot(.......

Important! we'll interactively check that your variables smokers_count and tips_by_smokers_chart contain the correct information

codevalidated

Create a pie chart showing the proportion of tips given by men and women

Create your pie chart and, when ready, save it to a sex_proportion_chart variable and validate it with the following button.

Your code should look like:

tips_by_sex_count = tips_df.......

sex_proportion_chart = tips_by_sex_count.plot(.......

Important! we'll interactively check that your variables tips_by_sex_count and sex_proportion_chart contain the correct information

codevalidated

Create a stacked bar chart showing total bill and tip amounts by sex

Create your stacked bar chart and, when ready, save it to a tips_by_sex_chart variable and validate it with the following button.

Your code should look like:

tip_amount_by_sex = tips_df.......

tips_by_sex_chart = tip_amount_by_sex.plot(.......

Important! we'll interactively check that your variables tip_amount_by_sex and tips_by_sex_chart contain the correct information

codevalidated

Create a pie chart showing the proportion of tips per day of the week

Create your pie chart and, when ready, save it to a daily_tips_chart variable and validate it with the following button.

Your code should look like:

daily_tips = tips_df.......

daily_tips_chart = daily_tips.plot(.......

Important! we'll interactively check that your variables daily_tips and daily_tips_chart contain the correct information

codevalidated

Create a horizontal stacked bar chart showing total bill and tip amounts per day of the week

Create your stacked bar chart and, when ready, save it to a tips_by_day_chart variable and validate it with the following button.

Your code should look like:

daily_mean = tips_df.......

tips_by_day_chart = daily_mean.plot(.......

Important! we'll interactively check that your variables daily_mean and tips_by_day_chart contain the correct information

codevalidated

Create a stacked bar chart showing total bill and tip amounts per moment of the day

Create your stacked bar chart and, when ready, save it to a dinner_lunch_chart variable and validate it with the following button.

Your code should look like:

dinner_lunch_df = tips_df.......

dinner_lunch_chart = dinner_lunch_df.plot(.......

Important! we'll interactively check that your variables dinner_lunch_df and dinner_lunch_chart contain the correct information

Plotting Practice: Analyzing Restaurant TipsPlotting Practice: Analyzing Restaurant Tips
Author

Matias Caputti

This project is part of

Intro to Pandas for Data Analysis

Explore other projects