Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
guipsamora
GitHub Repository: guipsamora/pandas_exercises
Path: blob/master/07_Visualization/Tips/Solutions.ipynb
548 views
Kernel: Python 3

Tips

Introduction:

This exercise was created based on the tutorial and documentation from Seaborn The dataset being used is tips from Seaborn.

Step 1. Import the necessary libraries:

import pandas as pd # visualization libraries import matplotlib.pyplot as plt import seaborn as sns # print the graphs in the notebook % matplotlib inline # set seaborn style to white sns.set_style("white")

Step 2. Import the dataset from this address.

Step 3. Assign it to a variable called tips

Step 4. Delete the Unnamed 0 column

Step 5. Plot the total_bill column histogram

Image in a Jupyter notebook

Step 6. Create a scatter plot presenting the relationship between total_bill and tip

<seaborn.axisgrid.JointGrid at 0x1197d84d0>
Image in a Jupyter notebook

Step 7. Create one image with the relationship of total_bill, tip and size.

Hint: It is just one function.

<seaborn.axisgrid.PairGrid at 0x11844c090>
Image in a Jupyter notebook

Step 8. Present the relationship between days and total_bill value

Image in a Jupyter notebook

Step 9. Create a scatter plot with the day as the y-axis and tip as the x-axis, differ the dots by sex

Image in a Jupyter notebook

Step 10. Create a box plot presenting the total_bill per day differetiation the time (Dinner or Lunch)

Image in a Jupyter notebook

Step 11. Create two histograms of the tip value based for Dinner and Lunch. They must be side by side.

Image in a Jupyter notebook

Step 12. Create two scatterplots graphs, one for Male and another for Female, presenting the total_bill value and tip relationship, differing by smoker or no smoker

They must be side by side.

Image in a Jupyter notebook

BONUS: Create your own question and answer it using a graph.