'''
(i) Create a DataFrame ‘exams’ containing following data using dictionary:
examname dept centres students
SSC CBSE 1100 90000
SSE NIOS 800 45000
NET CBSE 350 28000
SSCE CBSE 1400 160000
CSE UPSC 600 30000
(ii) Display details of SSCE exam.
(iii) Add a column “totstaff” with values: 11000,8000,3500,14000,6000.
(iv) Display students of NET exam. i.e. 28000.
'''
import pandas as pd
exam1 = { 'examname' : [ 'SSC', 'SSE', 'NET', 'SSCE', 'CSE'],
'dept' : [ 'CBSE', 'NIOS', 'CBSE', 'CBSE', 'UPSC'],
'centers' : [ 1100, 800, 350, 1400, 600],
'students' : [ 90000, 45000, 28000, 160000, 30000] }
ex1 = [Link] (exam1)
print ("Details of Exam")
print (ex1)
print ("Details of Exam SSCE")
print ([Link][3])
print ("Add New column totstaff")
ex1['totstaff']=[11000,8000,3500,14000,6000]
print ("Details student of NET Exam")
print ([Link][2])
'''
1 AIM: Consider the given DataFrame:
Pcd title Price qty
0 P01 Notebook 85 500
1 P02 Pencilbox 76 200
2 P03 WaterBottle 129 50
3 P04 SchoolBag 730 70
Write suitable Python statements for the following:
i. Add a column called ACC_NO with the following data:
[135,153,225,442].
ii. Add a new Record
iii. Remove the column qty.
'''
import pandas as pd
s1=[Link](['P01','P02','P03','P03'])
s2=[Link](["Note Book","Pencil Box","Water bottle","School bag"])
s3=[Link]([85,76,129,730])
s4=[Link]([500,200,50,70])
d={'Pcd':s1,'title':s2, 'Price':s3, 'qty':s4}
lib=[Link](d)
print(lib)
lib["ACC_NO "]=[135,153,225,442]
[Link][4]=["p05","bigbook",20,20,501]
print(lib)
[Link](["qty"],axis=1,inplace=True)
print(lib)
'''
2 Consider the following data :
Year 2011 2012 2013 2014 2015
Rain(mm)120 130 110 190 140
(i) Create the bar chart of given data.
(ii) Show the Labels on X and Y axis.
(iii) Save the chart as image.
'''
import [Link] as plt
year=[2011,2012,2013,2014,2015]
rain=[120,130,110,190,140]
[Link](year,rain)
[Link]("YEAR")
[Link]("RAIN(mm)")
[Link]("[Link]")
[Link]()
'''
AIM: Write a program to create a horizontal bar chart for India's medal tally.
Country Gold Silver Bronze Total
Australia 80 59 59 198
England 45 45 46 136
India 26 20 20 66
Canada 15 40 27 82
'''
import [Link] as plt
Info = ['Gold', 'Silver', 'Bronze', 'Total']
India = [26, 20, 20, 66]
[Link]("Medal type")
[Link]("Medal count")
[Link]("India's Medal Tally in Commonwealth 2018")
X = range (len (Info))
[Link](X, India, color = ['gold', 'silver', 'brown', 'black'])
[Link]()