I have a dataframe that looks like this.
+----+-------+
| ID | Value |
+----+-------+
| 1 | 23 |
| 1 | NA |
| 1 | NA |
| 1 | NA |
| 2 | 24 |
| 2 | NA |
| 2 | NA |
+----+-------+
For each ID value in a group, I either have one value or NA. I wanted to apply this non NA value to the NA values in that specific group as below.
Desired Output :
+----+-------+
| ID | Value |
+----+-------+
| 1 | 23 |
| 1 | 23 |
| 1 | 23 |
| 1 | 23 |
| 2 | 24 |
| 2 | 24 |
| 2 | 24 |
+----+-------+
How can we achieve this in pandas?