Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
21 views
GE Python Visualization 2023
Python practice
Uploaded by
Tejaswani Garg
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save GE-Python-Visualization-2023 For Later
Download
Save
Save GE-Python-Visualization-2023 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
21 views
GE Python Visualization 2023
Python practice
Uploaded by
Tejaswani Garg
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save GE-Python-Visualization-2023 For Later
Carousel Previous
Carousel Next
Save
Save GE-Python-Visualization-2023 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 16
Search
Fullscreen
[This question paper contains 16 printed pages.] Sr. No. of Question Paper : Unique Paper Code Name of the Paper Name of the Course Semester Duration : 3 Hours Your Roll No... 2012 F 2344001201 Data Analysis and Visualization Using Python Computer Science: Generic Elective (G.E.) Il Maximum Marks : 90 Instructions for Candidates 1 Write your Roll No. on the top immediately on receipt of this question paper. 2. This question paper has two sections A and B. 3. Question 1 in Section A is compulsory. 4. Attempt any 4 questions from Section B. 5. Parts of a question must be attempted together. 6. Section A carries 30 marks and each question in Section B carries 15 marks. 7. Use of Calculator is not allowed. PTO2012 2 Section A Assume numpy has been imported as np and pandas has been imported as pd. (a) Explain unimodal, bimodal and multimodal distribution with the help of examples. (5) (b) Consider the DataFrames First and Second given below : 6) Cc One Two One Two 0 'A' 2 “Be 5 ™D? 6 Ter First Second Consider the following python code segment : right = pd.merge(first, second, how="right’, on='One') left = pd.merge(first, second, how='inner’, on="Two') Show the content of the new DataFrames right and left.2012 3 (c) Write python commands to create a figure object using matplotlib. The Figure object has one subplot that contains 3 line graphs. Define legend and chart title of the graph. Define a different style and for each line in the subplot. Import (5) colour appropriate libraries. (d) List and describe the steps involved in process of Data Analysis. (5) (e) Give the output of the following code snippets: (4) (i) y=np. arange(12).reshape(4,3) print(y) yl(y > 5)] = -1 print(y) (ii) x = np.array ([[2, 4], [5,1]) z=np.ones_like(x) print(z) w=np.eye(2) * x print(w) P.T.O.2012 4 (f) Consider the series S1 and $2 given below : ( 6) SI $2 A I A 5 Bee B 6 Cc 3 D 7 _ _ Give the output of the following python pandas commands : (i) S1[: 3] * 10 (ii) S1 + S2 Gi) 2522 (cS. Section B 2. (a) Consider the DataFrame Frame given below: (7) Age Weight 15 45.6 23 34.9 32 45.6 20 60.7 $4.7 110 21 34.6 1442012 5 Write python commands to perform the following operations Q) Compute the correlation of Age with both Weight and Height. (a) Sort Frame in descending order of Age. (ii) To find the index for the row with minimum Age. (iv) Calculate cumulative sum for Weight for all Students. (v) To set height of ‘Rita’ and ‘Romi’ to NA. (vi) Replace the value 32 with 18 and 33 with 19 in Age column. (vii) Define map function to convert values of Name column to upper case.6 2012 (b) Refer to the DataFrame Frame given in question 2 (a), Write a python program to Perform th - . ie following operations in the given dataset with columns Name, Age, Weight, Height, (8) (i) Create a figure and include 2 subplots in it. (ii) In the first subplot create a Scatter plot between two variables Age and Height. (iii) In the second subplot draw a horizontal bar plot between Name and Weight. (iv) Set the title for the figure as ‘Data Analysis’. (v) Give appropriate labels for x and y axis. (vi) Save the figure to file with name ‘analysis.png’.2012 7 3. (a) Consider the following numpy array matrix : (10) [[5,10,20], [20,13,43], (34,27,67], [12,46,77]] Give the output of the following numpy commands : (i) matrix.T (ii) matrix[:1,1:] (iii), matrix[[1,3,0],[2,1,0]] (iv) matrix[[-2,-4]] (v) matrix[[True, False, False, True]] (vi) matrix(3] [:2] (vii) matrix[::—1] P.T.O.2012 8 (vi) mater ndim ax) np swaparxescmatrix, b, 0) (x) matrix? 10 Consider the to lowing DataPrame df. ve commands to perform the following operations: |) List the name of unique items sold. ch value 1" (4) Count the number of tim items is stored. - duplicate2012 9 (iv) Give the average price of all Low Fat items. (v) Check if ‘Juice’ ims one of the items sold. 4. (a) Consider the DataFrame data given below. (4) One Two | Three | Four | Five 1 14 34 NaN NaN 34 21 NaN 12 NaN NaN 23 NaN 2 NaN 34 21 32 33 NaN Write python commands to perform the following operations : (i) Drop columns with any null values. (ii) Replace the null values with the mean of each column. (iii) Drop the null values where there are at least 2 null values in a row.10 2012 Ye value : diy Replace all null VAIUES BY the 1381 Knog valid observation What arc outers? How can you detect Outliers using boxplots? (5) Consider the given numpy array mat: (6) np.array([[[-1,2], (3,4]], [[-5,6], [7,8]])) Write numpy commands to perform the following ations ()) Create an array of zeros with the same shape as mat. ul) Print the shape of the mat. (ui) Print the datatype of the elements in mat . 4 an (iv) Print the elements which are grealet th, 6 in mat. at as float (v) Convert all the elements in mat type.11 2012 (vi) Multiply each element in mat with 25. (a) Give the python commands to create with 5 keys — ‘A’, © a dictionary 7D’, ‘BE and value as (10) follows. | Key Value A | Listof numbers from 1 to 10 skipping 2 ata time. | List of Strings from A to E- c | List of 5 numbers obtained using random normal distribution function. List of 5 random integers from 20 to 30. mo Square root of 5 random numbers from 50 to 70. Give python commands to perform the following operations : (i) Create DataFrame data using the above dictionary. (ii) Convert Column A to index. (iii) Rename the rest of the columns as Area, Temperature, Latitude and Longitude. P.T.O.12 2012 (iv) Delete the column Longitude from dat a (vy) Save data as a csv with separator as to (b) Write a python code to create a figure and : subplot using matplotlib functions. Plot a Tectangle of size 3.5 x 8.5 at point (2.0, 7.0), a circle of radius 2.5 at point (7.0, 2.0) as patches in the subplot, functions for plotting. Set the colour of rectangle as ‘Green’ and color of circle as ‘Blue’, Set the x-scale and y-scale to 1-10. Import appropriate libraries. (5) (2) Consider the following dataset student. (10) Year | Name | Roll No | Marks Age i] Rani 23 70 18 2) Rita 24 75 20 3 Raj 25 80 22 1 [Rahul Gi 65 25 2 | Rohit 27 30 | 28 J , ds Give the output of the following python comman (i) student [['Roll No ',' Name'] [2:4]2012 13 (ii) student [student ['Age'] *20] (iii) student [student ['Age'] *20] ['Name'] (iv) avg marks np.mean (student.Marks) student[student['Marks'|>avg_marks] (v) first = student [student ['Year'] ==1][{'Marks'] np.mean(first) (b) Consider the following list 11. (5) 11 = [10, 10, 20, 40, 50, 60, 70, 80, 90, 90] Discretise the 11 into 4 bins using cut() and qcut(). Give the names [‘first’, ‘second’, ‘third’, ‘fourth’] to the bins. What type of object is returned by the pandas after binning? What output is generated by attributes codes and categories of binning object? DTNn2012 - 7. (a) Consider the DataFrame df given below : (8) | EmployeeID | Department | Salary | M001 English 1000 T00° English — i. 003 English hh Pood English 1005. 1003 _| Maths | 1004 [0.04 eee es Mat io vaeeeem 1005 1001 Maths 1006 a Maths 1002 Write the python code to perform the following operations : 4) Create a hierarchical index on Department and Employee ID. (1) Give the summary level statistics for each column. (i) Give the output for the following : 1. df.stack() 2. df.unstack()2012 15 (b) Give the output of the following code segment . nt: (4) arr ~ np.array([89, 54, 76, 32, 47, 21, 92, 39, 82]) arrl = arr[5:9] arr2 = arr[5:9].copy() arrl = 36 arr2 = 7 print(arr) print(arrl) print(arr2) (c) Consider the series a given below and give the output of the following commands : (GB) a = pd.Series([4, I, 7,1, 8,9, 0,8, 2,3, 9) (i) a.rank() P.T.O.2012 16 (ii) a.rank(method “first’) (iii) a.rank(ascending False)
You might also like
Ge Sem II Dav Upc 2344001201 Sl. No. Qp. 2012 July 2023
PDF
No ratings yet
Ge Sem II Dav Upc 2344001201 Sl. No. Qp. 2012 July 2023
16 pages
2023 Data Analysis and Visualization Using Python
PDF
100% (1)
2023 Data Analysis and Visualization Using Python
9 pages
PYQ Data Analysis and Visualisation Using Python GE May 2024
PDF
No ratings yet
PYQ Data Analysis and Visualisation Using Python GE May 2024
6 pages
QP DAV 3rd Sem Dec 2023
PDF
No ratings yet
QP DAV 3rd Sem Dec 2023
12 pages
Cs Sem III Dav Upc 2343012002 Sl. No. Qp. 1673 Dec '23
PDF
No ratings yet
Cs Sem III Dav Upc 2343012002 Sl. No. Qp. 1673 Dec '23
12 pages
Wa0012.
PDF
No ratings yet
Wa0012.
30 pages
Pyq Solution
PDF
No ratings yet
Pyq Solution
12 pages
DAV Previous Year
PDF
No ratings yet
DAV Previous Year
7 pages
b2
PDF
No ratings yet
b2
6 pages
dav 2024 pyq
PDF
No ratings yet
dav 2024 pyq
7 pages
AI Final PDF
PDF
No ratings yet
AI Final PDF
38 pages
DIVP PYQ 2023
PDF
No ratings yet
DIVP PYQ 2023
7 pages
B. Sc. H Computer S FkQNyBB
PDF
No ratings yet
B. Sc. H Computer S FkQNyBB
6 pages
Ip 2019
PDF
No ratings yet
Ip 2019
12 pages
Khadeeja_DS_PRACTICAL 4
PDF
No ratings yet
Khadeeja_DS_PRACTICAL 4
24 pages
QP - Ip PB19-01QP
PDF
No ratings yet
QP - Ip PB19-01QP
7 pages
sowmi DS
PDF
No ratings yet
sowmi DS
27 pages
Pragya File
PDF
No ratings yet
Pragya File
31 pages
Study Material IP XII
PDF
No ratings yet
Study Material IP XII
116 pages
Shalvin
PDF
No ratings yet
Shalvin
9 pages
FDS Slot 1
PDF
No ratings yet
FDS Slot 1
19 pages
Python Project File
PDF
No ratings yet
Python Project File
31 pages
Ds File
PDF
100% (1)
Ds File
40 pages
CS3361 Set1
PDF
No ratings yet
CS3361 Set1
5 pages
2020-21 XIIInfo - Pract.S.E.155
PDF
No ratings yet
2020-21 XIIInfo - Pract.S.E.155
11 pages
CS3361 Set2
PDF
No ratings yet
CS3361 Set2
6 pages
TUTORIAL 2 QB & QP
PDF
No ratings yet
TUTORIAL 2 QB & QP
4 pages
DAV Guidelines
PDF
No ratings yet
DAV Guidelines
4 pages
dv_lab_manual_modified
PDF
No ratings yet
dv_lab_manual_modified
31 pages
Practical File Questions With Answers
PDF
No ratings yet
Practical File Questions With Answers
7 pages
Data Science Practical Problems
PDF
No ratings yet
Data Science Practical Problems
40 pages
Ai Tools and Applications-Lab
PDF
No ratings yet
Ai Tools and Applications-Lab
33 pages
Assignment 2021-22
PDF
No ratings yet
Assignment 2021-22
16 pages
21hcs4108 Davpracticals
PDF
No ratings yet
21hcs4108 Davpracticals
29 pages
Numpy QP
PDF
No ratings yet
Numpy QP
4 pages
DS Practical
PDF
No ratings yet
DS Practical
30 pages
Minimum Level Pandas Skill Based Questions
PDF
No ratings yet
Minimum Level Pandas Skill Based Questions
8 pages
Assignment-1 (Python Pandas-Series Object and Data Frame: 1. Answer The Following
PDF
100% (1)
Assignment-1 (Python Pandas-Series Object and Data Frame: 1. Answer The Following
8 pages
DATAFRAME
PDF
No ratings yet
DATAFRAME
11 pages
Informatics Practices Practical List22-2323
PDF
100% (1)
Informatics Practices Practical List22-2323
7 pages
DF Ques1
PDF
No ratings yet
DF Ques1
2 pages
IP.12.QualiTest.2024
PDF
No ratings yet
IP.12.QualiTest.2024
7 pages
Ip Project Work 2
PDF
No ratings yet
Ip Project Work 2
52 pages
Holy Innocents Public School Term-1
PDF
No ratings yet
Holy Innocents Public School Term-1
6 pages
Holidays Homework - 20231204 - 195647 - 0000
PDF
No ratings yet
Holidays Homework - 20231204 - 195647 - 0000
15 pages
Dav Pyq 2023
PDF
No ratings yet
Dav Pyq 2023
15 pages
Questions Practical File
PDF
No ratings yet
Questions Practical File
13 pages
CS3361 Set1
PDF
No ratings yet
CS3361 Set1
5 pages
Info Practical
PDF
No ratings yet
Info Practical
56 pages
Xii Ip Practical File 24-25
PDF
No ratings yet
Xii Ip Practical File 24-25
111 pages
Practical File Question 28.09.2022
PDF
No ratings yet
Practical File Question 28.09.2022
15 pages
DAV Practical
PDF
No ratings yet
DAV Practical
12 pages
Ilovepdf Merged (2) Merged
PDF
No ratings yet
Ilovepdf Merged (2) Merged
65 pages
manishadav
PDF
No ratings yet
manishadav
27 pages
Pandas NumPy Practice Questions
PDF
No ratings yet
Pandas NumPy Practice Questions
2 pages
CS3361 Lab Exp
PDF
No ratings yet
CS3361 Lab Exp
9 pages
Content
PDF
No ratings yet
Content
12 pages
IP MODEL 1 QST Set 2
PDF
No ratings yet
IP MODEL 1 QST Set 2
4 pages
12 IP Practical Exampl
PDF
No ratings yet
12 IP Practical Exampl
6 pages
Vedic Math (1)
PDF
No ratings yet
Vedic Math (1)
8 pages
Brochure - PDF 20241023 125422 0000
PDF
No ratings yet
Brochure - PDF 20241023 125422 0000
20 pages
Tejaswani SEC8
PDF
No ratings yet
Tejaswani SEC8
12 pages
25th October Test Sec
PDF
No ratings yet
25th October Test Sec
4 pages
Gratitude Is Great
PDF
No ratings yet
Gratitude Is Great
2 pages