{"id":37413,"date":"2022-02-18T11:31:05","date_gmt":"2022-02-18T06:01:05","guid":{"rendered":"https:\/\/mcq-questions.com\/?p=37413"},"modified":"2022-02-19T10:34:43","modified_gmt":"2022-02-19T05:04:43","slug":"mcq-questions-for-class-12-informatics-practices-python-pandas-part-2","status":"publish","type":"post","link":"https:\/\/mcq-questions.com\/mcq-questions-for-class-12-informatics-practices-python-pandas-part-2\/","title":{"rendered":"MCQ Questions for Class 12 Informatics Practices – Python Pandas Part 2"},"content":{"rendered":"
Question 1.<\/p>\n
(a) import pandas
\n(b) import pandas as pd
\n(c) import pandas as pds
\n(d) All of these
\nAnswer:
\n(d) All of these<\/p>\n
Question 2.<\/p>\n
(a) SyntaxError
\n(b) IndexError
\n(c) ValueError
\n(d) None of these
\nAnswer:
\n(c) ValueError<\/p>\n
Question 3.<\/p>\n
(a) Index
\n(b) Data
\n(c) Values
\n(d) None of these
\nAnswer:
\n(a) Index<\/p>\n
Question 4.<\/p>\n
(a) \u2018c\u2019
\n(b) 2
\n(c) c
\n(d) All of these
\nAnswer:
\n(d) All of these<\/p>\n
Question 5.<\/p>\n
(a) print(S1(0])
\n(b) print(S1(\u2018lndia\u2019])
\n(c) Both of the above
\n(d) print(Sl.lndia)
\nAnswer:
\n(a) print(S1(0])<\/p>\n
Question 6.<\/p>\n
(a) Numeric, Labelled
\n(b) Positional, Naming
\n(c) Positional, Labelled
\n(d) None of these
\nAnswer:
\n(c) Positional, Labelled<\/p>\n
Question 7.<\/p>\n
(a) India NewDelhi UK London dtype: object
\n(b) India NewDelhi UK Washington dtype: object
\n(c) Error
\n(d) None of these
\nAnswer:
\n(c) Error<\/p>\n
Question 8.<\/p>\n
(a) print(S1(:: 1]
\n(b) print(S1(:: -1]
\n(c) print(S1(-1:: 1]
\n(d) print(S1.reverse())
\nAnswer:
\n(b) print(S1(:: -1]<\/p>\n
<\/p>\n
Question 9.<\/p>\n
(a) 1
\n(b) 2
\n(c) 3
\n(d) 4
\nAnswer:
\n(c) 3<\/p>\n
Question 10.<\/p>\n
(a) 1
\n(b) 2
\n(c) 3
\n(d) 4
\nAnswer:
\n(b) 2<\/p>\n
Question 11.<\/p>\n
(a) name
\n(b) index.name
\n(c) size
\n(d) Series.name
\nAnswer:
\n(a) name<\/p>\n
Question 12.<\/p>\n
(a) Tuple
\n(b) Dictionary
\n(c) List
\n(d) String
\nAnswer:
\n(c) List<\/p>\n
Question 13.<\/p>\n
(a) Size
\n(b) Values
\n(c) lindex
\n(d) None of these
\nAnswer:
\n(a) Size<\/p>\n
Question 14.<\/p>\n
(a) Index
\n(b) Size
\n(c) Empty
\n(d) Values
\nAnswer:
\n(c) Empty<\/p>\n
Question 15.<\/p>\n
(a) Size
\n(b) Index
\n(c) Name
\n(d) Values
\nAnswer:
\n(d) Values<\/p>\n
Question 16.<\/p>\n
(a) True
\n(b) False
\n(c) Error
\n(d) None of these
\nAnswer:
\n(a) True<\/p>\n
<\/p>\n
Question 17.<\/p>\n
Answer:
\n(a) 2
\n(b) 4
\n(c) 6
\n(d) Error
\nAnswer:
\n(b) 4<\/p>\n
Question 18.<\/p>\n
(a) S1.head( )
\n(b) S1.head( 5 )
\n(c) Both of the above
\n(d) None of these
\nAnswer:
\n(c) Both of the above<\/p>\n
Question 19.<\/p>\n
(a) 6
\n(b) 4
\n(c) 2
\n(d) 0
\nAnswer:
\n(c) 2<\/p>\n
Question 20.<\/p>\n
(a) count
\n(b) size
\n(c) index
\n(d) values
\nAnswer:
\n(a) count<\/p>\n
Question 21.<\/p>\n
(a) 8
\n(b) 4
\n(c) 0
\n(d) 6
\nAnswer:
\n(c) 0<\/p>\n
<\/p>\n
Question 22.<\/p>\n
(a) addition
\n(b) subtraction
\n(c) multiplication
\n(d) All of these
\nAnswer:
\n(d) All of these<\/p>\n
Question 23.<\/p>\n
(a) sum( )
\n(b) addition( )
\n(c) add( )
\n(d) None of these
\nAnswer:
\n(c) add( )<\/p>\n
Question 24.<\/p>\n
(a) >>>A-B
\n(b) >>>(a)sub(B)
\n(c) Both of the above
\n(d) None of these
\nAnswer:
\n(c) Both of the above<\/p>\n
Question 25.<\/p>\n
(a) fill-value
\n(b) fill-value
\n(c) fill_value
\n(d) fill_value( )
\nAnswer:
\n(c) fill_value<\/p>\n
<\/p>\n
Question 26.<\/p>\n
(a) add( )
\n(b) mul( )
\n(c) div( )
\n(d) All of these
\nAnswer:
\n(d) All of these<\/p>\n
Question 27.<\/p>\n
(a) >>> (a)add(B, fill_value = 100)
\n(b) >>>(a)add(B, fill_value : 100)
\n(c) >>> (a)add(B, fill-value = 100)
\n(d) >>> (a)add(B, fill-value : 100)
\nAnswer:
\n(a) >>> A,add(B, fill_value = 100)<\/p>\n
Question 28.<\/p>\n
(a) indexes
\n(b) values
\n(c) Both of the above
\n(d) None of these
\nAnswer:
\n(a) indexes<\/p>\n
Question 29.<\/p>\n
(a) >>>S1
\n(b) >> SI > 40
\n(c) >>>S1(S1 > 40]
\n(d) None of these
\nAnswer:
\n(c) >>> S1(S1 > 40]<\/p>\n
Question 30.<\/p>\n
(a) S1.tail()
\n(b) S1.tail(10)
\n(c) S1.head(10)
\n(d) S1(10)
\nAnswer:
\n(b) S1.tail(10)<\/p>\n
Question 31.<\/p>\n
(a) >>>S1 + 2
\n(b) >>>S1**2
\n(c) >>> S1*2
\n(d) All of these
\nAnswer:
\n(d) All of these<\/p>\n
Question 32.<\/p>\n
(a) Scalar operation
\n(b) Vector operation
\n(c) Both of the above
\n(d) None of these
\nAnswer:
\n(b) Vector operation<\/p>\n
Question 33.<\/p>\n
(a) S1[0,1, 2] = 100
\n(b) S1[0 : 3] = 100
\n(c) S1[: 3] = 100
\n(d) All of these
\nAnswer:
\n(d) All of these<\/p>\n
Question 34.<\/p>\n
(a) True
\n(b) False
\n(c) On
\n(d) Off
\nAnswer:
\n(a) True<\/p>\n
<\/p>\n
Question 35.<\/p>\n
(a) ‘c’
\n(b) 2
\n(c) Both of the above
\n(d) None of these
\nAnswer:
\n(c) Both of these<\/p>\n
Question 36.<\/p>\n
(a) list
\n(b) tuple
\n(c) series
\n(d) None of these
\nAnswer:
\n(c) series<\/p>\n
Question 37.<\/p>\n
(a) True
\n(b) False
\n(c) On
\n(d) Off
\nAnswer:
\n(b) False<\/p>\n
Question 38.<\/p>\n
(a) import pandas
\n(b) import pandas as p
\n(c) from pandas import
\n(d) All of these
\nAnswer:
\n(d) All of these<\/p>\n
<\/p>\n
Question 39.<\/p>\n
(a) 1 dimensional array
\n(b) 2 dimensional array
\n(c) 3 dimensional array
\n(d) None of these
\nAnswer:
\n(b) 2 dimensional array<\/p>\n
Question 40.<\/p>\n
(a) To create a GUI programming
\n(b) To create a database
\n(c) To create a High level array
\n(d) All of the above
\nAnswer:
\n(c) To create a High level array<\/p>\n
Question 41.<\/p>\n
(a) Numpy
\n(b) Pandas
\n(c) Open CV
\n(d) Django
\nAnswer:
\n(b) Pandas<\/p>\n
Question 42.<\/p>\n
Minimum number of argument we require to pass in pandas series?<\/p>\n
(a) 0
\n(b) 1
\n(c) 2
\n(d) 3
\nAnswer:
\n(b) 1<\/p>\n
Question 43.<\/p>\n
(a) 1 dimensional array
\n(b) 2 dimensional array
\n(c) 3 dimensional array
\n(d) None of these
\nAnswer:(a) 1 dimensional array<\/p>\n
Question 44.<\/p>\n
(a) install pandas
\n(b) pandas install python
\n(c) python install pandas
\n(d) None of these
\nAnswer:
\n(d) None of these<\/p>\n
Question 45.<\/p>\n
(a) series
\n(b) dataframe
\n(c) Both of the above
\n(d) None of these
\nAnswer:
\n(c) Both of the above<\/p>\n
Question 46.<\/p>\n
(a) Integer
\n(b) String
\n(c) Pandas series
\n(d) All of these
\nAnswer:
\n(c) Pandas series<\/p>\n
<\/p>\n
Question 47.<\/p>\n
(a) df.rename(columns={‘City’:\u2019Location\u2019})
\n(b) df.rename(columns={‘City’=’Location’})
\n(c) df.rename(\u2018City’=’Location\u2019)
\n(d) df.rename(df.columns(\u2018City\u2019,\u2019Location’))
\nAnswer:
\n(a) df.rename(columns={,City’:’Location\u2019})<\/p>\n
Question 48.<\/p>\n
(a) Only 1 is correct
\n(b) 1, 2 and 3 are correct
\n(c) 1 and 3 are correct
\n(d) All of them are correct
\nAnswer:
\n(b) 1, 2 and 3 are correct<\/p>\n
Question 49.<\/p>\n
(a) rename rows
\n(b) rename columns
\n(c) rename rows and columns both
\n(d) None of the above
\nAnswer:
\n(a) rename rows<\/p>\n
Question 50.<\/p>\n
(a) df.head( )=2
\n(b) df.head(n=2)
\n(c) df.head(range(2))
\n(d) All of these
\nAnswer:
\n(b) df.head(n=2)<\/p>\n
Question 51.<\/p>\n
(a) Tail( )
\n(b) Head( )
\n(c) Top( )
\n(d) Header( )
\nAnswer:
\n(b) Head( )<\/p>\n
Question 52.<\/p>\n
(a) Tail( )
\n(b) Head( )
\n(c) Top( )
\n(d) Header( )
\nAnswer:
\n(a) Tail( )<\/p>\n
Question 53.<\/p>\n
(a) Ignore_head
\n(b) Ignore_index
\n(c) Ignore_tail
\n(d) Ignore_header
\nAnswer:
\n(b) ignore_index<\/p>\n
Question 54.<\/p>\n
(a) index
\n(b) value
\n(c) size
\n(d) empty
\nAnswer:
\n(a) index<\/p>\n
Question 55.<\/p>\n
(a) four
\n(b) six
\n(c) five
\n(d) seven
\nAnswer:
\n(c) five<\/p>\n
Question 56.<\/p>\n
(a) Ruby
\n(b) Javascript
\n(c) Java
\n(d) Python
\nAnswer:
\n(d) Python
\nPandas is an opensource Python Library providing high- performance data manipulation and analysis tool using its powerful data structures.<\/p>\n
<\/p>\n
Question 57.<\/p>\n
(a) Keyframe
\n(b) Dataframe
\n(c) Statistics
\n(d) Econometrics
\nAnswer:
\n(b) Dataframe
\nPandas is built on the Numpy package and its key data structure is called the Dataframe.<\/p>\n
Question 58.<\/p>\n
(a) uniQuestion ue
\n(b) hashable
\n(c) Both a and b
\n(d) None of these
\nAnswer:
\n(c) Both a and b
\nIndex values must be uniQuestion ue and hashable, same length as dat(a) Default np.arrange(n) if no index is passe(d)<\/p>\n
Question 59.<\/p>\n
(a) Potentially columns are of different types
\n(b) Can perform Arithmetic operations on rows and columns
\n(c) Labeled axes (rows and columns)
\n(d) All of the above<\/p>\n
Question 60.<\/p>\n
(a) ID
\n(b) 2D
\n(c) 3D
\n(d) Infinite
\nAnswer:
\n(c) 3D
\nA panel is a 3D container of dat(a) The term Panel data is derived from econometrics and is partially responsible for the name pandas : pan(el)-da(ta)-s.<\/p>\n
Question 61.<\/p>\n
(a) If data is an ndarray, index must be the same length as dat(a)
\n(b) Series is a one-dimensional labeled array capable of holdihg any data type.
\n(c) Both a and b
\n(d) None of the above
\nAnswer:
\n(c) Both a and b<\/p>\n
Question 62.<\/p>\n
(a) Dataframe.fromjtems
\n(b) Dataframe.from_records
\n(c) Dataframe.from_dict
\n(d) All of the above
\nAnswer:
\n(a) Dataframe.fromjtems
\nDataframe.from_dict operates like the DataFrame constructor except for the orient parameter which is ‘columns’ by default.<\/p>\n
Question 63.<\/p>\n
(a) panda SDMX
\n(b) freedapi
\n(c) OutPy
\n(d) Inpy
\nAnswer:
\n(b) freedapi
\nfreedapi module requires a FRED API key that you can obtain for free on the FRED website.<\/p>\n
Question 64.<\/p>\n
(a) 0
\n(b) 1
\n(c) 2
\n(d) 3
\nAnswer:
\n(b) 1
\nReturns the number of dimensions of the object. By definition, a Series is a ID data structure, so it returns 1.<\/p>\n
Question 65.<\/p>\n
(a) In
\n(b) ix
\n(c) ipy
\n(d) iy
\nAnswer:
\n(b) ix
\nix and reindex are 100% eQuestion uivalent.<\/p>\n
<\/p>\n
Question 66.<\/p>\n
(a) a python diet
\n(b) an ndarray
\n(c) a scalar value
\n(d) All of the mentioned
\nAnswer:
\n(d) all of the mentioned
\nThe passed index is a list of axis labels.<\/p>\n
Question 67.<\/p>\n
(a) If data is a list, if index is passed the values in data corresponding to the labels in the index will be pulled out
\n(b) NaN is the standard missing data marker used in pandas
\n(c) Series acts very similarly to a array
\n(d) None of the mentioned
\nAnswer:
\n(b) NaN is the standard missing data marker used in pandas If data is a diet, if index is passed the values in data corresponding to the labels in the index will be pulled out.<\/p>\n
Question 68.<\/p>\n
(a) intersection
\n(b) union
\n(c) total
\n(d) All of the mentioned
\nAnswer:
\n(b) union
\nIf a label is not found in one Series or the other, the result will be marked as missing NaN.<\/p>\n
Question 69.<\/p>\n
(a) Structured ndarray
\n(b) Series
\n(c) Dataframe
\n(d) All of the mentioned
\nAnswer:
\n(d) All of the mentioned
\nDataframe is a 2-dimensional labeled data structure with columns of potentially different types advertisement.<\/p>\n
Question 70.<\/p>\n
(a) A Dataframe is like a fixed-size diet in that you can get and set values by index label
\n(b) Series can be be passed into most NumPy methods expecting an ndarray
\n(c) A key difference between Series and ndarray is that operations between Series automatically align the data based on label
\n(d) None of the mentioned
\nAnswer:
\n(a) A Dataframe is like a fixed-size diet in that you can get and set values by index label
\nA Series is like a fixed-size diet in that you can get and set values by index label.<\/p>\n
<\/p>\n
Question 71.<\/p>\n
(a) DataFrame.fromtems
\n(b) DataFrame.from records
\n(c) DataFrame.from dict
\n(d) All of the mentioned
\nAnswer:
\n(a) DataFrame.fromtems
\nDataFrame.fromdict operates like the DataFrame constructor except for the orient parameter which is \u2018columns\u2019 by default.<\/p>\n
Question 72.<\/p>\n
(a) True
\n(b) False
\n(c) Error
\n(d) None of these
\nAnswer:
\n(a) True
\nThe axis labels are collectively referred to as the index.<\/p>\n
Question 73.<\/p>\n
(a) DataFrame.fromJtems
\n(b) DataFrame.from_records
\n(c) DataFrame.from_dict
\n(d) All of the mentioned
\nAnswer:
\n(a) DataFrame.fromJtems
\nDataFrame.from records takes a list of tuples or an ndarray with structured dtype.<\/p>\n
Question 74.<\/p>\n
(a) Getting columns
\n(b) Setting columns
\n(c) Deleting columns
\n(d) All of the mentioned
\nAnswer:
\n(d) All of the mentioned
\nYou can treat a Dataframe semantically like a diet of like- indexed Series objects.<\/p>\n
Question 75.<\/p>\n
(a) True
\n(b) False
\n(c) Error
\n(d) None of these
\nAnswer:
\n(a) True
\nIf no index is passed, one will be created having values [0 len(data) -1],<\/p>\n
Python Pandas Class 12 MCQ Questions Part 2 Question 1. Which of the following statement is correct for importing pandas in python? (a) import pandas (b) import pandas as pd (c) import pandas as pds (d) All of these Answer: (d) All of these Question 2. What type of error is returned by following statement? …<\/p>\n