Page 93 - Informatics_Practices_Fliipbook_Class12
P. 93
7. The data of any CSV file can be shown in which of the following software? [2022]
a. MS Word b. Notepad c. Spreadsheet d. All of the above
Ans. d. All of the above
8. Which method is used to Delete row(s) from DataFrame? [2022]
a. .drop() method b. .del() method c. .remove() method d. .delete() method
Ans. a. .drop( ) method
9. Which of the following would give the same output as DF/DF1 where DF and DF1 are DataFrames? [2022]
a. DF.div(DF1) b. DF1.div(DF) c. Divide(DF,DF1) d. Div(DF,DF1)
Ans. a. DF.div(DF1)
10. Which of the following statement is wrong in context of DataFrame? [2022]
a. Two dimensional size is Mutable. b. Can Perform Arithmetic operations on rows and columns.
c. Homogeneous tabular data structure. d. Create DataFrame from numpy ndarray.
Ans. c. Homogeneous tabular data structure.
11. Which attribute is not used with DataFrame? [2022]
a. size b. type c. empty d. columns
Ans. b. type
12. When we create a DataFrame from a list of dictionaries, the columns labels are formed by the: [2022]
a. Union of the keys of the dictionaries b. Intersection of the keys of the dictionaries
c. Union of the values of the dictionaries d. Intersection of the values of the dictionaries
Ans. a. Union of the keys of the dictionaries
13. Identify the correct option to select first four rows and second to fourth columns from a DataFrame 'Data': [2022]
a. display(Data .iloc[1 : 4, 2 : 4]) b. display(Data.iloc[1 : 5, 2 : 5])
c. print(Data.iloc[0 : 4, 1 : 4]) d. print(Data.iloc[1 : 4, 2:4])
Ans. c. print(Data.iloc[0 : 4, 1 : 4])
14. Consider a following DataFrame: [2022]
import pandas as pd
s = pd.Series(data = [31,54,34,89,12,23])
df=pd.DataFrame(s)
Which statement will be used to get the output as 2?
a. print(df.index) b. print(df.shape( )) c. print(df.ndim) d. print(df.values)
Ans. c. print(df.ndim)
15. Sandhya wants to display the last four rows of the dataframe df and she has written the following command:
df.tail ()
But the first 5 rows are being displayed. To rectify this problem, which of the following statements should be written?
[2022]
a. df.head( ) b. df.last(4) c. df.tail(4) d. df.rows(4)
Ans. c. df.tail(4)
16. Nowadays for developing Machine learning projects programmers rely on CSV files rather than databases. Why? [2022]
a. csv can be used with proprietary softwares only.
b. csv files can be downloaded from open source websites free of cost.
c. csv files need not be imported while creating the projects.
d. csv is a simple and well formatted mode for data storage.
Ans. d. csv is a simple and well formatted mode for data storage.
Data Handling using Pandas DataFrame 79

