Consider a data frame df with columns ['A', 'B', 'C', 'D'] and rows ['r1', 'r2', 'r3']. What does the expression df[lambda x : x.index.str.endswith('3')] do?

Questions & AnswersCategory: Programming LanguageConsider a data frame df with columns ['A', 'B', 'C', 'D'] and rows ['r1', 'r2', 'r3']. What does the expression df[lambda x : x.index.str.endswith('3')] do?
Adam asked 2 years ago

Consider a data frame df with columns [‘A’, ‘B’, ‘C’, ‘D’] and rows [‘r1’, ‘r2’, ‘r3’]. What does the expression df[lambda x : x.index.str.endswith(‘3’)] do?
a. Returns the row name r3
b. Results in Error
c. Returns the third column
d. Filters the row labelled r3