1

I have a dataframe which looks like

Name  Value
Car1  Station
Car1  NA
Car1  NA 
Car1  Station
Car2  Hatchback
Car2  NA

Now, I want to fill the NA values in the Value column with the non NA value of the same Name variable. So, the resulting dataframe should look like

Name  Value
Car1  Station
Car1  Station
Car1  Station 
Car1  Station
Car2  Hatchback
Car2  Hatchback

Does anyone know how to do it without looping through the entire dataframe?

Activation
  • 93
  • 6

0 Answers0