Disclaimer:
Educational Use Only:
The website links provided are to be used strictly for educational and knowledge-gaining purposes only.
No Misuse:
Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.
Respect for Websites and Businesses:
Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.
Acknowledge Value of Knowledge:
Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.
No Endorsement:
The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.
User Responsibility:
By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.
Overall MCQs for Reference
- Which of the following is a two-dimensional labeled data structure in Python for handling tabular data?
a. Series
b. DataFrame
c. Array
d. Set
Answer: b. DataFramesanfoundry - What is the primary function used to create a DataFrame in Python pandas?
a. create_df()
b. make_df()
c. DataFrame()
d. build_df()
Answer: c. DataFrame()csiplearninghub+1 - Which attribute displays the total number of elements in a DataFrame?
a. shape
b. size
c. count
d. length
Answer: b. sizestudytrigger - Which function returns the first n rows of a DataFrame?
a. top()
b. head()
c. start()
d. first()
Answer: b. head()tutorialaicsip - Which attribute shows the number of rows and columns in a DataFrame?
a. info
b. shape
c. length
d. describe
Answer: b. shapestudytrigger+1 - DataFrame columns can hold data of:
a. Only integers
b. Only floats
c. Different types
d. Only strings
Answer: c. Different typesrfaqs+1 - Which method returns a transposed version of the DataFrame?
a. switch()
b. pivot()
c. T
d. flip()
Answer: c. Tstudytrigger - Which method merges two DataFrames in pandas?
a. merge()
b. join()
c. combine()
d. append()
Answer: a. merge()rfaqs - In R, what function is used to create a data frame?
a. r_frame()
b. data.frame()
c. make_frame()
d. frame_r()
Answer: b. data.frame()sanfoundry - Which function drops specified columns from a DataFrame by labels?
a. remove()
b. drop()
c. erase()
d. delete()
Answer: b. drop()rfaqs - When creating a DataFrame from a list of dictionaries, dictionary keys become:
a. Column labels
b. Row labels
c. Both
d. None
Answer: a. Column labelscsiplearninghub - Which attribute provides the name of index labels in a DataFrame?
a. columns
b. labels
c. index
d. header
Answer: c. indexstudytrigger - Which attribute provides the column labels in a DataFrame?
a. columns
b. index
c. label
d. headers
Answer: a. columnsstudytrigger - What method is used to append rows from one DataFrame to another?
a. append()
b. add()
c. join()
d. put()
Answer: a. append()wayground - Which method gives the last n rows of a DataFrame?
a. bottom()
b. tail()
c. end()
d. last()
Answer: b. tail()tutorialaicsip - Which function provides info about the data types and non-null values of DataFrame columns?
a. info()
b. describe()
c. count()
d. details()
Answer: a. info()techtipnow - What would df[‘Name’] return if Name is a column in df?
a. Entire DataFrame
b. Name column
c. Index
d. Error
Answer: b. Name columncsiplearninghub - What is returned by DataFrame.empty attribute?
a. Number of columns
b. Number of rows
c. Boolean value
d. All data
Answer: c. Boolean valuestudytrigger - Which method is used for sorting a DataFrame by a column’s values?
a. sort()
b. order()
c. sort_values()
d. arrange()
Answer: c. sort_values()studytrigger - What is the default axis for concatenating DataFrames using concat()?
a. axis=0
b. axis=1
c. axis=2
d. axis=None
Answer: a. axis=0techtipnow - Which index selection returns all columns for a specific label in pandas?
a. loc
b. iloc
c. select
d. extract
Answer: a. loccsiplearninghub - What does the shape attribute return for a 5×3 DataFrame?
a. (5,3)
b. 15
c.learnpython4cbse+1
d. ‘5×3’
Answer: a. (5,3)studytrigger - Which parameter in DataFrame creation defines row labels?
a. index
b. labels
c. headers
d. axis
Answer: a. indextechtipnow - Which function displays a concise summary of a DataFrame?
a. info()
b. summary()
c. describe()
d. print()
Answer: a. info()techtipnow - Which method would you use to select a specific row by its integer position?
a. loc
b. select
c. iloc
d. pick
Answer: c. iloccsiplearninghub - Which method converts a DataFrame to a NumPy array?
a. array()
b. to_numpy()
c. convert()
d. numpify()
Answer: b. to_numpy()techtipnow - Which pandas method would you use to rename columns?
a. change_columns()
b. rename()
c. alter()
d. set_columns()
Answer: b. rename()tutorialaicsip - If df1 and df2 have the same columns, how do you stack them vertically?
a. append()
b. concat(axis=0)
c. join()
d. union()
Answer: b. concat(axis=0)techtipnow - Which method removes duplicate rows from a DataFrame?
a. remove_duplicates()
b. drop_duplicates()
c. unique()
d. dedupe()
Answer: b. drop_duplicates()techtipnow - What does df.iloc[1:3] return?
a. First two columns
b. First three rows
c. Rows 1 and 2
d. Rows 2 and 3
Answer: c. Rows 1 and 2csiplearninghub - Which method fills missing values in a DataFrame?
a. fillna()
b. replace()
c. pad()
d. impute()
Answer: a. fillna()techtipnow - df.describe() method provides:
a. Data types
b. Summary statistics
c. Column labels
d. Shape
Answer: b. Summary statisticstechtipnow - What does the .T attribute do for a DataFrame?
a. Sorts DataFrame
b. Transposes DataFrame
c. Drops NaN values
d. Converts index
Answer: b. Transposes DataFramestudytrigger - Which attribute lists the data types for each DataFrame column?
a. types
b. dtype
c. dtypes
d. datatype
Answer: c. dtypesstudytrigger - What is the result of merging two DataFrames with overlapping columns by default?
a. Union
b. Intersection
c. All rows merged
d. Error
Answer: b. Intersectionrfaqs - Which function can convert a DataFrame back to a dictionary?
a. as_dict()
b. to_dict()
c. from_dict()
d. dictify()
Answer: b. to_dict()techtipnow - Which DataFrame function will sort column labels alphabetically?
a. sort_columns()
b. sort_index(axis=1)
c. arrange_columns()
d. alpha_sort()
Answer: b. sort_index(axis=1)techtipnow - What does df.isnull().sum() show?
a. Null rows
b. Null columns
c. Number of missing values per column
d. Unique values
Answer: c. Number of missing values per columntechtipnow - Which method sets DataFrame column as index?
a. set_label()
b. assign_index()
c. set_index()
d. index_col()
Answer: c. set_index()techtipnow - What is the purpose of reset_index() in pandas?
a. Renames columns
b. Removes index
c. Resets row labels to default integers
d. Combines DataFrames
Answer: c. Resets row labels to default integerstechtipnow - Which function displays all unique values in a DataFrame column?
a. unique()
b. all()
c. distinct()
d. values()
Answer: a. unique()techtipnow - What method extracts a subset of a DataFrame based on condition?
a. locate()
b. filter()
c. query()
d. subset()
Answer: c. query()techtipnow - Which pandas method is used to group DataFrame rows by specific column(s)?
a. group_by()
b. aggregate()
c. groupby()
d. segment()
Answer: c. groupby()techtipnow - Which representation best describes DataFrame organization?
a. 1D array
b. 2D table
c. Dictionary
d. Set
Answer: b. 2D tablesanfoundry+1 - What does df.dropna() method do?
a. Adds values
b. Removes missing data
c. Concatenates rows
d. Deletes index
Answer: b. Removes missing datatechtipnow - Which DataFrame method allows selecting specific columns?
a. select_columns()
b. columns[]
c. df[]
d. choose()
Answer: c. df[]csiplearninghub - Which function combines DataFrame columns horizontally?
a. cbind()
b. merge()
c. concat(axis=1)
d. append()
Answer: c. concat(axis=1)techtipnow - What does df.memory_usage() return?
a. Memory consumed
b. Data types
c. Null count
d. Shape
Answer: a. Memory consumedtechtipnow - What does DataFrame.info() display?
a. Column memory usage
b. Data types and non-null count
c. Summary statistics
d. Unique values
Answer: b. Data types and non-null counttechtipnow - Which attribute checks if DataFrame is empty?
a. empty
b. is_null
c. is_empty
d. check_null
Answer: a. emptystudytrigger
- https://www.sanfoundry.com/data-science-questions-answers-pandas-data-structure/
- https://csiplearninghub.com/python-dataframe-mcq-class-12-ip/
- https://www.sanfoundry.com/r-programming-questions-answers-data-types-5/
- https://www.studytrigger.com/article/dataframe-practice-questions-with-solutions-part-4-attributes-and-functions/
- https://www.tutorialaicsip.com/ip-xii-qna/qna-dataframe-functions-cl-12-ip/
- https://rfaqs.com/data-structure/data-frame/data-frame-questions-answers/
- https://wayground.com/admin/quiz/66baf3b76f9bc61ac7c24316/pandas-dataframe-mcqs
- https://techtipnow.in/python-dataframe-mcq/
- https://www.learnpython4cbse.com/mcq-comp-sc-xii-16/python-mcq-pandas-dataframe-1
- https://interviewkickstart.com/blogs/articles/data-science-mcq-answers
- https://techtipnow.in/python-pandas-dataframe-mcq/
- https://www.sanfoundry.com/1000-data-science-questions-answers/
- https://rfaqs.com/r-graphics/python-pandas-data-frame-mcqs-17/
- https://www.scribd.com/document/525393699/Dataframe-I
- https://www.interviewbit.com/data-science-mcq/
- https://rfaqs.com/python-quizzes/python-pandas-quiz-13/
- https://www.scribd.com/document/561895270/Pandas-MCQ-Questions-with-Answers
- https://askfilo.com/user-question-answers-smart-solutions/multiple-choice-questions-mcqs-on-pandas-a-important-data-3336323738313433
- https://testbook.com/objective-questions/mcq-on-data-structures–626fa34741c7369a8e3859c5
- https://www.placementpreparation.io/mcq/data-science/page/2/