Professional Documents
Culture Documents
Practical Final Class 10 AI Term 1 Answer Key
Practical Final Class 10 AI Term 1 Answer Key
PIP
It allows you to install and manage additional packages that are not part of the Python
standard library.
Arrays are collection of values of same data types that can be arranged in 1 or more
dimensions.
Arrays can be accessed by package Numpy only.
Matplot is the data visualization package.
Numpy: Numerical Array data handlimg package
Opencv Image processing package
b. Check whether the user is eligible to vote or not. (Input the age from user)
*
**
***
****
*****
e. Calculate the cube of all numbers from 1 to a given number
i) x = ['Ram','Shyam','Jeena','Sheena','Tam','Tom']
y = [99,86,87,88,111,86]
3. Create and compare the scatter plots for the given data in the same figure.
4. Visualize the marks of 6 students in Science using Bar chart and change:
iii) Ttile to BAR CHART and its font seize as 30 and color as red
5. Visualize the data of five subjects of a student using pie chart and:
import numpy as np
print(arr)
print(type(arr))
# addition of arrays
import numpy as np
a1 = np.array([1, 2, 3, 4, 5])
a2=np.array([3,4,5,6,7])
print(a1+a2)
c) #using scatterplot
i) import matplotlib.pyplot as plt
x = ['Ram','Shyam','Jeena','Sheena','Tam','Tom']
y = [99,86,87,88,111,86]
plt.title('scatter plot')
plt.xlabel('Names')
plt.ylabel('Marks')
plt.scatter(x, y)
plt.show()
x = ['Ram','Shyam','Jeena','Sheena','Tam','Tom']
y = [99,86,87,88,111,86]
plt.title('scatter plot')
plt.xlabel('Names')
plt.ylabel('Marks')
plt.scatter(x, y, color='green')
plt.show()
x = ['Ram','Shyam','Jeena','Sheena','Tam','Tom']
y = [99,86,87,88,111,86]
plt.title('BAR CHART',fontsize=30,color='red')
plt.xlabel('Names')
plt.ylabel('Marks')
plt.bar(x, y,color="yellow", width=.1)
plt.show()
#pie chart
import matplotlib.pyplot as plt
m1=[31,25,49,78,96]
sub=['maths','eng','sst','science','hindi']
mycolors=['red','green','blue','pink','yellow']
plt.pie(m1,labels=sub,colors=mycolors)
plt.title('Shyam')
plt.show()