Practical No.1
Practical No.1
Q.1
In [1]:
Q.2
localhost:8888/notebooks/Untitled15.ipynb# 1/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [2]:
Q. 3
localhost:8888/notebooks/Untitled15.ipynb# 2/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [3]:
Q.4
localhost:8888/notebooks/Untitled15.ipynb# 3/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [6]:
Q.5
localhost:8888/notebooks/Untitled15.ipynb# 4/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [12]:
No artists with labels found to put in legend. Note that artists whose la
bel start with an underscore are ignored when legend() is called with no a
rgument.
Q.6
localhost:8888/notebooks/Untitled15.ipynb# 5/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [13]:
Q.7
localhost:8888/notebooks/Untitled15.ipynb# 6/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [15]:
Q.8
localhost:8888/notebooks/Untitled15.ipynb# 7/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [9]:
import numpy as np
import matplotlib.pyplot as plt
x=['Pune','Mumbai','Nagpur','Nasik','Satara']
y=[5,24,45,32,15]
plt.bar(x,y)
plt.xlabel('cities')
plt.ylabel('Number of covid patients')
plt.title('Bar graph')
plt.legend()
plt.show()
No artists with labels found to put in legend. Note that artists whose la
bel start with an underscore are ignored when legend() is called with no a
rgument.
Q.9
localhost:8888/notebooks/Untitled15.ipynb# 8/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [15]:
import numpy as np
import matplotlib.pyplot as plt
x=[1,2,3,4,5]
y=[5,24,45,32,15]
tick_label=['Pune','Mumbai','Nagpur','Nasik','Satara']
fig=plt.figure(figsize=(10,7))
plt.pie(y,labels=tick_label)
plt.show()
Q.10
localhost:8888/notebooks/Untitled15.ipynb# 9/10
4/8/23, 4:45 PM Untitled15 - Jupyter Notebook
In [22]:
import numpy as np
import matplotlib.pyplot as plt
ages=[2,5,79,89,79,30,45,52,50,29,30,30,50,90,45,48,65,99]
bins=5
plt.hist(ages,bins,range=(0,100))
plt.xlabel('ages')
plt.ylabel('Number of people')
plt.title('Histogram')
plt.legend()
plt.show()
No artists with labels found to put in legend. Note that artists whose la
bel start with an underscore are ignored when legend() is called with no a
rgument.
localhost:8888/notebooks/Untitled15.ipynb# 10/10