0% found this document useful (0 votes)
8 views3 pages

Visualizing Tips Data with Seaborn

Uploaded by

itsmedd1812
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Visualizing Tips Data with Seaborn

Uploaded by

itsmedd1812
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

9/19/24, 12:26 PM Untitled24 - Jupyter Notebook

In [8]: import seaborn as sns


import [Link] as plt

In [9]: import pandas as pd

In [11]: #load the exaple dataset


tips = sns.load_dataset("tips")

In [12]: #problem 1:create a scatter plot to show the relation total bill and tips

In [21]: [Link](figsize=(10,5))
[Link](data=tips,x='total_bill', y='tip', hue='day', style='sex',
palette='deep')
[Link]('scatter plot of total bill vs tip')
[Link]('total bill ($)')
[Link]('tip($)')
[Link](title='day and sex')
[Link]()

localhost:8888/notebooks/[Link]?kernel_name=python3 1/3
9/19/24, 12:26 PM Untitled24 - Jupyter Notebook

In [27]: # problem 2:create a bar plot to show the distraction of tips by time (lunch
[Link](figsize=(10,5))
[Link](data=tips, x='time', y='tip')
[Link]('box plot of tips by time')
[Link]('time of days')
[Link]('tip($)')
[Link]()

In [29]: #plm3
[Link](figsize=(10,5))
[Link](data=tips, x='time', y='tip')
[Link]('box plot of tips by time')
[Link]('time of days')
[Link]('tip ($)')
[Link]()

In [ ]: ​

localhost:8888/notebooks/[Link]?kernel_name=python3 2/3
9/19/24, 12:26 PM Untitled24 - Jupyter Notebook

localhost:8888/notebooks/[Link]?kernel_name=python3 3/3

You might also like