MCQ Unit 4
MCQ Unit 4
Que.5)Which of the following statement shows first five rows of Data Frame ?
A. df.head()
B. df.head(5)
C. Both A and B
D. Both are Incorrect
Ans.C
Que.8)To read data in binary format which of the following access mode used when open a file ?
303-Database Handling Using Python SYBCA SEM 3
A. rb
B. r+
C. wb
D. ab
Ans.A
Que.9)To view the content of the CSV file in the form of dictionary the _____ method is used
A. reader
B. Dictreader
C. writer
D. Dictwriter
Ans.B
Que.11)Which of the following module is import for handling Excel files in Python?
A. openpyxl
B. matplotlib
C. pyplot
D. sqlite3
Ans.A
Que.12)Which of the following function is used in python to skip a row in a CSV file ?
A. next()
B. skip()
C. jump()
D. goto()
Ans.A
Que.23)Which method returns the list of the lines and reaches the file end point?
A. readline()
B. readlines()
C. read()
D. None of the above
303-Database Handling Using Python SYBCA SEM 3
Ans.B
Que.31)Which function of pandas is used to read data from CSV file in python ?
A. read_csv()
B. read.csv()
C. readcsv()
303-Database Handling Using Python SYBCA SEM 3
D. csv.read()
Ans.A
Que.32)To retrieve the data, which function is used to run the select query?
A. fetch()
B. execute()
C. rawquery()
D. executequery()
Ans.B
Que.38)Series in Pandas is
A. One dimensional array
B. Two dimensional array
C. Multi dimensional array
D. None of the above
Ans.A
Que.39)Which measure of central tendency takes into account the magnitude of scores?
A. Median
B. Range
303-Database Handling Using Python SYBCA SEM 3
C. Mode
D. Mean
Ans.D
Que.42)Which of the following takes a dict of dicts or a dict of array-like sequences and returns a DataFrame?
A. DataFrame.from_items
B. DataFrame.from_records
C. DataFrame.from_dict
D. All of the mentioned
Ans.D
Que.48)The Dictreader class reads records from the CSV file in terms of _________
A. Dictionary
B. List
C. Dataframe
D. Object
Ans.A
Que.49)What DictReader do ?
A. Read CSV file and create Tabular Data Object
B. Read CSV file and create Tuple Listad CSV file and create Dictionary Object
C. None of the above
D. Read CSV file and create Dictionary Object
Ans.D
Que.50)____________ function takes File Pointer and returns CSV Reader Object.
A. reader()
B. writerows()
C. writer()
D. csv_reader()
Ans.A
Que.51)Which mode is used to open a file in reading mode but also allows to write
A. r
B. rw
C. w+
D. r+
Ans.D
Que.52)The _________ parameter of csv.reader() function is used to set a specific delimiter like a single quote or
double quote or space or any other character.
A. Dialect
B. Dialect_format
C. Format_dialect
D. None of the above
Ans.A
Que.56)Which of the following is tasks cannot be done or difficult with CSV module?
A. Saving data permanently
B. Uniqueness of data
C. Data in tabular form
D. All of these
Ans.B
Que.57)__________function is used for calculating some statistical data like percentile, mean and std of the
numerical values of the Series or DataFrame.
A. Statistical ()
B. Stat_describe()
C. Describe()
D. Dialect()
Ans.C
Que.58)Which function is measured as the spread of data distribution in the given data set.
A. Varience
B. Standard Deviation
C. Median
D. Mode
Ans.B
Que.60)Which of the following function is used to write a DataFrame object to. CSV file using pandas module?
A. writer()
B. writerow()
C. writeheader()
D. to_csv()
Ans.D
Que.62)Which of the following specifies the character used to surround fields that contain the delimiter
character?
A. quotechar
B. delimiter
303-Database Handling Using Python SYBCA SEM 3
C. lineterminator
D. escapechar
Ans.A
Que.63)Which of the following will be used as by default lineterminator for writing data to a file with csv
module?
A. \r\n
B. \r
C. \n
D. \n\r
Ans.A
Que.68)We can add a new row to a DataFrame using the _____________ method.
A. rloc[ ]
B. iloc[ ]
C. loc[ ]
D. None of the above
Ans.C
Que.69)What type of error is returned by following statement? Consider follwing code :import pandas as
pnd pnd.Series([1,2,3,4], index = [‘a’,’b’,’c’])
A. SyntaxError
B. IndexError
C. ValueError
D. None of the above
Ans.C
303-Database Handling Using Python SYBCA SEM 3
Que.70) Which of the following statement shows first five values of Series ‘S1’?
A. S1.head( )
B. S1.head( 5 )
C. Both of the above
D. None of the above
Ans.C
Que.73)In regards to separated value files such as .csv , what is the delimiter?
A. Any character such as the comma (,) or tab (\t) that is used to separate the row data
B. Anywhere the comma (,) character is used in the file
C. Delimiters are not used in separated value file
D. Any character such as the comma (,) or tab (\t) that is used to separate the column data.
Ans.D
Que.84)To extract row/column from a datafram, _____ function may be used? function may be used.
A. row( )
B. column( )
C. loc( )
D. All of these
Ans.C
Que.88)This Class is more convenient to address the field names and extract the records from the data file.
A. DictReader()
B. Reader()
C. Read()
D. None of the above
Ans.A