We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12
question paper contains 12 printed pages.
] (This Your Roll No.....
Paper : 1673 G St. No. of Question Unique Paper Code : 2343012002
Name of the Paper : Data Analysis and Visualization
Name of the Course : B.Sc. (Hons.) Computer
Science Semester : III
Duration:3 Hours Maximum Marks : 90
Instructions for Candidates
1. Write your Roll No. on the top of this question paper. immediately on receipt 2. Section A is compulsory. 3. Attempt any four questions from Section B. 4. Parts of a question must be answered together.
Section A
Assume that the following libraries have
already been imported: import numpy as np Import pandas as pd P.T.O. Python writethe and daW S for codc with and rainfall each gra, pointthe havig(5) dataframe, company, show names distinct of Sectsection2, iandon 7,8, 2] Write captured organization d to libraries, ) also the RollNo 9). atitle red and named 7, days Age of followingnumber age 32 libraries, Mark 18 30 45 50 appropriate Using 5. Add viz. 3, appropriatean respectively. Sangeeta average name. tables of Name Sarika details Sangeeta Sarika of the employees. : 2 2, [1, line 20. following Babita total following class (5, = employees the same having size the cach = daysaPython the rainfall plot do Display Computethe in month, of of the to the eachstudents to axiscircleuse Consider of 1 2 3 4 statements With Consider Given y (Make details output:(1) (ii) a and of 1673 (a) of (b) (c) 1. the 2 1 same the (5) P.T.0. Kabeer Vihaan section section al.shape) Roni Ishani Name following: for on the sections. 0) section2 section1 produced of of with snippet: = students students 9]] axis RollNo the students both array:', named be code 5 3 2 do 8, a2)) a2, Name. in 3)) all of will [7, to dataframe of details of RolINo following (al, statements (2, 5),(al, table section 1. details same details that of np.append 3 ( np.zeros with and output the 4, (np.addShape a Display the Display of [[3, print print (al) (al) Devansh Chitra AbhavVihaan Python Create along with Name (' Name sectionl (ii) theexecution = = print print = Write (i) (ii) 1673 RollNo Find (d) al a2 al np.NaN)) been have on employees toemployee produced 10], already aarray, empSalary, Python incentive. : snippet 2)) n salary. np.NaN, = 8, limit df: Write eachthe (np.NaN, of be code dataframe, array, [np.NaN,ffil1', libraries to of will employees.number given 10% following 6], Section B 4 2)) salary > 5000. new that following NumPy following: (e) Consider is 4, np.NaN], = = following np pd total a incentives output incentive the (method ([2, (thresh as as 10 Create pandas numpy Find of DataFrame the the data.fillna of the the execution 12, (data.dropna that Consider salary (ii) import import do (i) Find (np.NaN, imported Assume to pd. print (data) 1673 () = data ( print print (a) 2. 'South', 'South'. onthe where store and(5) Python (4) P.T.O. 'Chandigarh'), shape dataframe, itemRate 'key2'] to subjects, 3), produced snippet: Write dfl=df.swaplevel("keyl', 'key2") markSheet, type, (4, ])) (level=0) 'Green' 3 100. (12).reshape ['keyl', in data 22090 Rate code students be and 'Delhi', , array, the North', 'Red',will folloWing index dimension of markSheet. ItemApples Oranges 60 following (i) df.index.names = display (np.Dat:afrrange ame 2 2=dfl.sort NumPy by between 5 11'= .Nn2]),deortxIT'h=o..Dunselhi that 'Delhi', 'Green', rNorth', output the (0) print(df) print(dfl) print(df2) obtained to the 1, print(df) a 1 2, statements Consider of df Constructare (1, the xecution (i) marksmarks Find (c) (b) iolowing: Studen, minimum Name Hours_studied Marks_obtained (Make maximum Stunumber column df 40 64 7 18 60 died Covariane to do the with the dataframe, following. to of item gol hours Write Python statements :details who and 6 value of 2.5 4.0 6.08.0 10.01.05.0 the of type Consider the following : students libraries.) answer correlation the student item. the each average Double Display of by the students. codeappropriate names the of Compute the consisting Mohan 2Rajeev Sohan 3Jeevan Gopal Python GitaMeenu marks. () ii) Find Find Writeof (i) (ii) (ii)) 1673 (a) 1 4 5 6 use 3. USJapan quarter country 1Brazil Japan UK US BrazilBrazil :following sales US country. mininum Snippet: produced 1 2 2 the each sales. 2 2 do of the namesales. numerical maximum average attributes only. and for to the be maximumsales (iv) Display statistical 8 statements of will sales300 1000 4005008001000 50070050 boxplot followip total that Display the the person Python Brazil. Display a output the A B C D E A Find Draw B C D of theexecution Write (1) (ii) (11i) (v) Find 1 2 3 5 6 7 8 1673 5. d (7) Fithe dataframe studied nfollowing the(6) company, in (9) P.T.O. obtained. 81]) salespersons of each Hours heatmap 6, (::2]) dataframe, Marks [4, b2[1]) the of columns of 3], by b2 example done and of exXecution b1(:1], distributions b1[1), : following studied obtained 2, print ('iii.\n', 2/b2) sales of np.array([[1, print ('ii.\n', b2) give the (6) bl) of 7 Hours iv.\n', ('v.\n', , (ii) multimodal details Marks and on arange i.\n', diagramsi)unimodal data(i) bimodal the (Wo quartersS: between the Student. output snippet: code Consider Pl(iovt ) np, (' (' following showing the print print Using = = print bl b2 b) (b) (a) (Make file Set P.T.0. an id, (10) in Employee Age23 34 39 43 3453 exceldf1.dfl. saved following the '\n') print (c2.reshape( (3,4))) dataframe, 2) Salary given of ) 6) 2000 2040 2002 2030 2045 2006 24, (0, np,arange is columns index below the (2,= : the sep 0 Age): do libraries.) the cl.reshape( Computer Science Computer Science Computer Science to from a = given 4 intoas (withand statements c2, 3:) 2) Department English English English id datadata.xlsx' Employee * data'data.xlsx' Salary appropriate 9 (cl, (c2) print (c1 [:3, Python Read the c1 == print arr2print that Department, c2 file Write of () Assume Employee id excel USe 101102103104105106 A) labeg Discreltx cou o namei sCaller a8 y-axis the each seuon onthe (2) "Two'l, (3) plot. the visualize Give in twoCreate a file In employees a produced snippet: Age. the add this bins. and to to 10 and subplot,and Salaryto equalfigure figure be code (['One' figure Salary title of plotted will 8]) 'b'], 24]))duplicates first as a 3 drawa number 'Employees.png'. following-4, a give into that + 23, Createthe between x-axIS 0, pd.DataFrame({ cubnlot. these bins. the outputthe 2 * 21, Also, Salary the [5, 'b'] datal.drop In the Save of pd.Series( print (sl.rank()) 22, (ü) of the execution ('a', print (datal) keep='last') [21, print (datal) (data2) print (iü) Find print (sl) (ii) datalOne': TWo': = = 1673 (a) sl data2 6. () 12 41, as andnumber the (5) using(25-35], consisting P.T.0. (5) categories of 45, 'MiddleAged' of age 61, : ages, categories to (18-25], the employee.csv' of 31, code Display 41]}) array the category. 32],'B': [27, 30])) consisting 37, write intervals NameYoungAdult', equal-sized 10 + 23, the respectively. [21, (23, libraries, of df1('B'].min()) > 21, (60-100]. each file df1('A'[1] ages, binsclosed pf employees: e(l'A':(('A': .DataFrame 21, CSV 11 in four DataFrame array,25, 22, four appropriate side Youth', (35-60], values 'Senior' Create array ages. following Create right an (20, L (df1)print (df2) pd.df2 t '(df2) )print pri[1]n'Adf2( (d£2 print Consider people Using (i) of (i) the pd. 1673 - h 32). Given 1. Exp saer liaern c e 82000 91000 averag the following. for along salary 10 11 12 females salary lowest and 6 the file than less total CSV do 12 Scientist Data to libraries.):empData. the of Scientist Scientist Data given number Data Analyst Data Analyst Data Analyst statement(s) salary display employees. Role plot. the salary. highest their average ManagerManager Female dataframe total with Manager Female appropriate from bar Data and the using records all Python data Calculate the of Gender Display Compare le Fema Female Readainto role. genderDelete salary MaleMale Male Male Male Writeof 1673 use (a) (b) (C) (d) (e)