Monday, August 31, 2020

XII-IP Unit test 1 (August 2020) - K.V. Nepa

UT-1 (IP) 

Class XII

August 2020

  

Click here for Question Paper

 Answers -

 # -*- coding: utf-8 -*-
"""
Created on Mon Aug 31 07:44:55 2020

@author: devendra
"""

import pandas as pd
import numpy as np

#-------------------------------------Ans1
D1={'Rollno':[1,2,3,4,5], 'Name':['Arun','mohit', 'karan','lalit', 'ravi'], 'age':[18, 14,13,16,14], 'Marks':[68, 47,78,87,60]}
D2=pd.DataFrame(D1)
print(D2)

#-------------------------------------Ans2
print(D2["Name"])

#-------------------------------------Ans3
print(D2.Name[1],D2.Marks[1],D2.Rollno[1],D2.age[1])
#       OR
print(D2[D2.Rollno==2])


#-------------------------------------Ans4
print(D2[["Rollno","Name","Marks"]])

#-------------------------------------Ans5
D2["city"] = "Nepanagar"
#print(D2)

#-------------------------------------Ans6
D2.age[2] = 15


#-------------------------------------Ans7
del D2["Marks"]


#-------------------------------------Ans9
'''
i.Training Compound because it has largest number of computers, so according to 80:20 rule, it will be most suitable place.

ii.a) repeater should be connected between-
*Main compound to resource compound
*main compound to training compound
*resource compound to finance compound
*training compound to finance compound
This is because repeater should be connected where the distance between two locations is more than 70m

ii b) Hub/Switch should be placed in every building where there are more than one computers.
So it should be placed in every building.


iii.Optical fibre because it is gives bery high speed but it is very expensive,
if we want cheap alternative then answer will be telephone analog line.
'''

#-------------------------------------Ans10
D1=[200, 500,200,100]
S1=pd.Series(D1, index=['a', 'b', 'c', 'd'])
print(S1)


#-------------------------------------Ans11
print(S1.min())


#-------------------------------------Ans12
print(S1[0::2])

'''
a    200
c    200
'''

#-------------------------------------Ans13
print(S1[::-1])

'''
d    100
c    200
b    500
a    200
'''

#-------------------------------------Ans14
import matplotlib.pyplot as pl
bookno=[30, 32,36,42,41,57,60,62,70]
pl.hist(bookno, orientation='horizontal', histtype='step')
pl.show()


#-------------------------------------Ans15
import matplotlib.pyplot as pl
Year = [1920,1930,1940,1950,1960,1970,1980,1990,2000,2010]
Unemp_india = [9.8,12,8,7.2,6.9,7,6.5,6.2,5.5,6.3]
Unemp_pak = [3,4,5,6,7,8,9,10,11,12]
pl.plot(Year, Unemp_india, 'r', label='india')
pl.legend("lower right")
pl.plot(Year, Unemp_pak, 'g', label='Pakistan')
pl.legend("lower right")
pl.xlabel("Year")
pl.ylabel("Unemployment rate")
pl.xlim(1920, 2000)
pl.title("Unemployment rate Vs Year")
pl.show()