Page 21 - IPP-12-2024
P. 21
(iv) SELECT COUNT(CUSTOMER_ID)
FROM ORGANIC
WHERE QUALITY = 'A';
32. Pradeep, a student of MCA, has to make a project for his final year. He gathered data and designed a
DataFrame (df) as shown below: (4)
SHARE_ GROWTH_
CAR_RETAIL_SALES FEB_2023 FEB_2022 TOTAL_SALES
PERCENTAGE PERCENTAGE
0 MARUTI 118892 109611 42.04 8.47 228503
1 TATA 38965 38688 13.78 13.78 77653
2 MAHINDRA 29365 18264 10.38 10.38 47629
3 KIA 19554 13523 6.91 43.54 33077
4 JEEP 649 803 0.23 -19.18 1452
5 NISSAN 2246 3172 0.79 -29.19 5418
6 TOYOTA 12068 8019 4.27 50.49 20087
Answer the following questions:
(i) Predict the output of the following Python statement:
(a) print(df.shape)
(b) print(df[2:6])
(ii) Delete the column name "SHARE_PERCENTAGE".
(iii) Write the Python statement to display column "TOTAL_SALES".
OR
(Option for part iii only)
Write the Python statement to export the DataFrame to a CSV file named marks.csv stored at E: drive.
Ans. (i) (a) (7,6)
(b)
SHARE_ GROWTH_
CAR_RETAIL_SALES FEB_2023 FEB_2022 TOTAL_SALES
PERCENTAGE PERCENTAGE
2 MAHINDRA 29365 18264 10.38 10.38 47629
3 KIA 19554 13523 6.91 43.54 33077
4 JEEP 649 803 0.23 -19.18 1452
5 NISSAN 2246 3172 0.79 -29.19 5418
(ii) df.drop('SHARE_PERCENTAGE', axis=1)
(iii) print(df["TOTAL_SALES"]) OR print(df.TOTAL_SALES)
OR
df.to_csv("E:\marks.csv")
SECTION E
33. Write suitable SQL queries for the following: (5)
(i) To display the modulus of 53 and 4 by giving a suitable column name.
(ii) To display the name of the week of your birthdate.
(iii) To calculate the exponent for 8 raised to the power of –3.
(iv) To convert the string "I M POSSIBLE" in lowercase.
(v) To display the square root of 125.
OR
Roshan wants to start an import-export business and has collected data analysis from various perspectives.
8 MODEL TEST PAPER