Consider a data frame df with 10 rows and index [ 'r1', 'r2', 'r3', 'row4', 'row5', 'row6', 'r7', 'r8', 'r9', 'row10']. How many rows are obtained after executing the below expressions g = df.groupby(df.index.str.len()) g.filter(lambda x: len(x) > 1)

Questions & AnswersCategory: Programming LanguageConsider a data frame df with 10 rows and index [ 'r1', 'r2', 'r3', 'row4', 'row5', 'row6', 'r7', 'r8', 'r9', 'row10']. How many rows are obtained after executing the below expressions g = df.groupby(df.index.str.len()) g.filter(lambda x: len(x) > 1)
Adam asked 2 years ago

Consider a data frame df with 10 rows and index [ ‘r1’, ‘r2’, ‘r3’, ‘row4’, ‘row5’, ‘row6’, ‘r7’, ‘r8’, ‘r9’, ‘row10’]. How many rows are obtained after executing the below expressions

g = df.groupby(df.index.str.len())
g.filter(lambda x: len(x) > 1)

a. 9
b. 1
c. 5
d. 10