Consider a data frame df with columns ['A', 'B', 'C', 'D'] and rows ['r1', 'r2', 'r3']. Which of the following expression filters the rows whose column B values are greater than 45?

Questions & AnswersCategory: Programming LanguageConsider a data frame df with columns ['A', 'B', 'C', 'D'] and rows ['r1', 'r2', 'r3']. Which of the following expression filters the rows whose column B values are greater than 45?
Adam asked 2 years ago

Consider a data frame df with columns [‘A’, ‘B’, ‘C’, ‘D’] and rows [‘r1’, ‘r2’, ‘r3’]. Which of the following expression filters the rows whose column B values are greater than 45?
a. df.iloc[df.B > 45]
b. df.B > 45
c. df[df.B > 45]
d. df.loc[B > 45]