0% found this document useful (0 votes)
7 views4 pages

AppliedDataScienceExperiment3.ipynb - Colab

The document outlines an applied data science experiment focusing on data visualization techniques using Python libraries such as Seaborn and Matplotlib. It includes examples of various plots, including histograms, box plots, scatter plots, bubble charts, and pair plots using datasets like 'tips' and 'gapminder'. The document serves as a tutorial for generating visual representations of data to analyze and interpret information effectively.

Uploaded by

krish.lakhani
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)
7 views4 pages

AppliedDataScienceExperiment3.ipynb - Colab

The document outlines an applied data science experiment focusing on data visualization techniques using Python libraries such as Seaborn and Matplotlib. It includes examples of various plots, including histograms, box plots, scatter plots, bubble charts, and pair plots using datasets like 'tips' and 'gapminder'. The document serves as a tutorial for generating visual representations of data to analyze and interpret information effectively.

Uploaded by

krish.lakhani
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

2/10/25, 10:36 AM AppliedDataScienceExperiment3.

ipynb - Colab

Aim: Explore Data Visualization Techniques

keyboard_arrow_down Load the dataset


import seaborn as sns
import matplotlib.pyplot as plt
tips = sns.load_dataset("tips")

tips.head()

total_bill tip sex smoker day time size

0 16.99 1.01 Female No Sun Dinner 2

1 10.34 1.66 Male No Sun Dinner 3

2 21.01 3.50 Male No Sun Dinner 3

3 23.68 3.31 Male No Sun Dinner 2

4 24.59 3.61 Female No Sun Dinner 4

Next steps: Generate code with tips toggle_off View recommended plots New interactive sheet

keyboard_arrow_down Histogram
sns.histplot(data=tips, x="total_bill",kde=True)

<Axes: xlabel='total_bill', ylabel='Count'>

keyboard_arrow_down Box Plot


import seaborn as sns
import matplotlib.pyplot as plt

# Load the dataset


tips = sns.load_dataset("tips")
sns.boxplot(data=tips, x="day", y="total_bill")
plt.show()

https://colab.research.google.com/drive/1s0P9VW9R0pHJb_mejgUcAmXdlJ7T5HeL#scrollTo=p5DP4Ii1Nw0o&printMode=true 1/4
2/10/25, 10:36 AM AppliedDataScienceExperiment3.ipynb - Colab

keyboard_arrow_down Scatter Plot


sns.scatterplot(data=tips, x="total_bill", y="tip")
plt.show()

keyboard_arrow_down Bubble Chart


import matplotlib.pyplot as plt
import seaborn as sns
from gapminder import gapminder
data=gapminder.loc[gapminder["year"]==2007]
sns.scatterplot(data=data, x="gdpPercap", y="lifeExp",c="blue",size="pop",legend=False,sizes=(20,2000))
plt.show()

https://colab.research.google.com/drive/1s0P9VW9R0pHJb_mejgUcAmXdlJ7T5HeL#scrollTo=p5DP4Ii1Nw0o&printMode=true 2/4
2/10/25, 10:36 AM AppliedDataScienceExperiment3.ipynb - Colab

data.head()

country continent year lifeExp pop gdpPercap

11 Afghanistan Asia 2007 43.828 31889923 974.580338

23 Albania Europe 2007 76.423 3600523 5937.029526

35 Algeria Africa 2007 72.301 33333216 6223.367465

47 Angola Africa 2007 42.731 12420476 4797.231267

59 Argentina Americas 2007 75.320 40301927 12779.379640

Next steps: Generate code with data toggle_off View recommended plots New interactive sheet

keyboard_arrow_down Pair Plot


iris=sns.load_dataset('iris')
iris.head()
sns.pairplot(iris,hue='species',height=3)
plt.show()

https://colab.research.google.com/drive/1s0P9VW9R0pHJb_mejgUcAmXdlJ7T5HeL#scrollTo=p5DP4Ii1Nw0o&printMode=true 3/4
2/10/25, 10:36 AM AppliedDataScienceExperiment3.ipynb - Colab

https://colab.research.google.com/drive/1s0P9VW9R0pHJb_mejgUcAmXdlJ7T5HeL#scrollTo=p5DP4Ii1Nw0o&printMode=true 4/4

You might also like