Python CIA 2243024 - Jupyter Notebook
Python CIA 2243024 - Jupyter Notebook
Python CIA 2243024 - Jupyter Notebook
[2]:
Out[2]:
[<matplotlib.lines.Line2D at 0x1f16c964400>]
In [5]:
Out[5]:
[<matplotlib.lines.Line2D at 0x1f16ca7a880>]
In [6]:
x=[-5,1,5]
y=[7/2,3,0]
plt.plot(x,y)
plt.xlabel("x axis")
plt.ylabel("y axis")
plt.show()
plt.plot(x,y,color="pink", marker=".", linestyle="-.", lw=(4))
Out[8]:
[<matplotlib.lines.Line2D at 0x1f16cc3ae80>]
In [18]:
#Q.3)
import matplotlib.pyplot as plt
import numpy as np
#Vertex: (1, 2)
#Focus: (1 + sqrt(15)/4, 2)
#Directrix: y = 0
#Latus rectum: 4
#For the parabola open leftward:
#Vertex: (-1, 2)
#Focus: (-1 - sqrt(15)/4, 2)
#Directrix: y = 0
#Latus rectum: 4
In [10]:
#Q.4)
import math
print(math.sin(math.radians(30)))
print(math.sin(math.radians(0)))
print(math.sin(math.radians(60)))
print(math.sin(math.radians(45)))
print(math.sin(math.radians(90)))
print(math.sin(math.degrees(30)))
print(math.sin(math.degrees(0)))
print(math.sin(math.degrees(60)))
print(math.sin(math.degrees(45)))
print(math.sin(math.degrees(90)))
0.49999999999999994
0.0
0.8660254037844386
0.7071067811865476
1.0
-0.4097717985741408
0.0
0.7475778912844228
0.8060754911159176
-0.9540914674728181
In [11]:
print(math.cos(math.radians(30)))
print(math.cos(math.radians(0)))
print(math.cos(math.radians(60)))
print(math.cos(math.radians(45)))
print(math.cos(math.radians(90)))
print(math.cos(math.degrees(30)))
print(math.cos(math.degrees(0)))
print(math.cos(math.degrees(60)))
print(math.cos(math.degrees(45)))
print(math.cos(math.degrees(90)))
0.8660254037844387
1.0
0.5000000000000001
0.7071067811865476
6.123233995736766e-17
-0.9121880689272984
1.0
0.6641741461866275
-0.5918127259718502
-0.2995153947555356
In [12]:
#6. The revenue and profit for fortune companies are as follows. Draw the scatter plots in
#same window and give inference about it.
x=9823.5,5661.4,3250.4,2959.1,2510.8,2071.6,2056.1,1705.3,1703.6, 1687.7,1667.4, 1660.3, 16
y=806,584.8,195.4,212.6,19.1,18.5,1.6,182.8,183.8,344.4,132.8,117.2,84.6,226.1,55.8,121.1,3
plt.scatter(x,y)
plt.show()
In [22]:
#Q.7)
x=['Maths', 'English', 'History', 'Geography']
labels=['a','b','c','d','e']
y=[100,98,87,96]
plt.bar(x,y)
Out[22]:
In [24]:
#Q.8)
import matplotlib.pyplot as plt
import numpy as np
# show plot
plt.show()
In [26]:
#Q.9)
import matplotlib.pyplot as plt
import numpy as np
# show plot
plt.tight_layout()
plt.show()
In [27]:
#Q.10)
import matplotlib.pyplot as plt
import numpy as np
# show plots
plt.tight_layout()
plt.show()
In [ ]:
#Q.6)