Exploratory Community

How to change one number in a dataframe?


Hello, I would like to be able to change (correct) one number in this dataframe:

How can I change the Hours value in row 51 from an 8 to a 6?

Thanks in advance.


If you want to change the values based on the row number, then you can use row_number function.

so it should be something like this.

ifelse(row_number == 51, 6, Hours)

1 Like

Kan, thank you so much for the lead. I played around with this a bit and this is what worked for me!



Oh yes! We need the brackets! Thanks for the correction!

1 Like