ExamGecko
Question list
Search
Search

Question 30 - DSA-C02 discussion

Report
Export

Consider a data frame df with 10 rows and index [ 'r1', 'r2', 'r3', 'row4', 'row5', 'row6', 'r7', 'r8', 'r9', 'row10']. What does the expression g = df.groupby(df.index.str.len()) do?

A.
Groups df based on index values
Answers
A.
Groups df based on index values
B.
Groups df based on length of each index value
Answers
B.
Groups df based on length of each index value
C.
Groups df based on index strings
Answers
C.
Groups df based on index strings
D.
Data frames cannot be grouped by index values. Hence it results in Error.
Answers
D.
Data frames cannot be grouped by index values. Hence it results in Error.
Suggested answer: D

Explanation:

Data frames cannot be grouped by index values. Hence it results in Error.

asked 23/09/2024
Anthony Agbale
46 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first