0% found this document useful (0 votes)
2 views2 pages

Scatter Plots and Histograms Analysis

The document contains Python code for generating various scatter plots and histograms using libraries like NumPy, Pandas, and Matplotlib. It includes visualizations of relationships between hours studied and exam scores, random data distributions, and income and unemployment rates. The code demonstrates data visualization techniques for analyzing and presenting statistical information.

Uploaded by

Aimen
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)
2 views2 pages

Scatter Plots and Histograms Analysis

The document contains Python code for generating various scatter plots and histograms using libraries like NumPy, Pandas, and Matplotlib. It includes visualizations of relationships between hours studied and exam scores, random data distributions, and income and unemployment rates. The code demonstrates data visualization techniques for analyzing and presenting statistical information.

Uploaded by

Aimen
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

#!

/usr/bin/env python
# coding: utf-8

# In[2]:

import numpy as np
import pandas as pd
import matplotlib as mpl
import [Link] as plt

# **Scatterplot to show rs between hours studied and exam scores**

# In[20]:

x =[Link]([1,2,3,4,5,6,7,8,10,11,12,13,14,15])
y =[Link]([30,31,32,33,35,36,37,38,39,40,41,42,44,45])

[Link](x,y, color="green")
[Link]("Hours studied")
[Link]("Scores")
[Link]("Scatter plot:Hours studied vs exam scores")
[Link]()

# In[40]:

x = [Link](1000)
y = [Link](1000)
colors = [Link](1000)
sizes = 100*[Link](1000)

[Link](x,y, c=colors, s=sizes, alpha =0.3)


[Link]()
[Link]()

# **Plot for 300 students**

# In[45]:

hours = [Link](0, 20, 300)


scores = scores = 5 * hours + [Link](300) * 10
scores = [Link](scores, 0, 300)
[Link](hours, scores, color="red")
[Link]("Hours studied")
[Link]("Scores")
[Link]()
[Link]("[Link]")

# In[29]:

x =[Link](0,10,15)
y = [Link](x)
[Link](x,y, color= "green")

# In[41]:

x = [Link](100)
y = [Link](100)
colors = [Link](100)

[Link](x, y, c=colors)
[Link]()
[Link]("Scatter Plot with Color Mapping")
[Link]()

# In[44]:

x = [Link](0, 10, 50)


dy = 0.8
y = [Link](x) + dy * [Link](50)
[Link](x,y, yerr =dy, fmt=".k")
[Link]()

# **Histograms**

# In[4]:

x1 = [Link](0, 0.8, 1000)


x2 = [Link](-2, 1, 1000)
x3 = [Link](3, 2, 1000)

[Link](x1, alpha=0.5, bins=40)


[Link](x2, alpha=0.5, bins=40)
[Link](x3, alpha=0.5, bins=40)
[Link]()

# **Showing income distribution for 2019**

# In[13]:

income19= pd.read_csv("income_2019.csv")
print([Link])

# In[15]:

income =income19['s1aq08'].dropna()

[Link](income, bins=30, alpha=0.5, color="pink")


[Link]()

# **Create a histogram of unemployment rates across all regions/provinces for 2020.


# Choose an appropriate number of bins to clearly show the spread.**

# In[22]:
unemp= pd.read_csv("Unemployment_2019.csv")
[Link](unemp, bins= 10, alpha=0.6)

[Link]("Unemployment Rate (%) - 2020")


[Link]("Number of Countries")
[Link]("Distribution of Unemployment Rates")

[Link]()

# In[ ]:

# In[ ]:

You might also like