Consider a situation.
A B C
1 X Park
2 Y
3 Z Team
4 L
5 M Cycle
6 K
7 N
Expected output:
A B C
1 X Park
2 Y Park
3 Z Team
4 L Team
5 M Cycle
6 K Cycle
7 N Cycle
There are millions of rows so can not be done manually. Gaps between empty cells and cells with values can be more than 1000s of rows in column C.
You need Pandas ffill():
df.ffill()
See the pandas documentation for parameters: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.ffill.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With