I am trying to filter the rows of a data frame according to the below conditions and want to replace the values by a new value of a column. The error I am getting is: TypeEr