Replacing nan values with other values from the same column on condition
I’m cleaning an amazon dataframe with reviewers.I have duplicates in the reviewerID column because some users left several reviews. However, in the reviewerName column, I have both NaN values and names for the same reviewer. How can I drop NaN values in the reviewerName column for duplicated reviewers and leave only names?
Reviewers dataframe
I tried to use np.where to replace NaN values with names (I wanted to drop duplicates after the replacement), but I got an error message: unsupported operand type(s) for &: ‘str’ and ‘bool’