Trying to figure out how to do this in pandas but currently can't figure it out.
I would like to copy a value from Col A where a cell in Col B is blank and add it to the below rows, only until it reaches the next blank cell in Col B where it will then start again.
My Python isn't the strongest so any pointers would be appreciated as i currently haven't got a clue where to start with this one! I have included the below as an example as to how it currently is and as to how I'd like it. I'm currently just manipulating and cleaning the data in Pandas.
| A | B |
|---|---|
| Supply Voltage | BLANK |
| Rated Value | 10 |
| Limit | 20 |
| Size | BLANK |
| Height | 10 |
| Width | 20 |
| A | B |
|---|---|
| Supply Voltage | BLANK |
| Supply Voltage - Rated Value | 10 |
| Supply Voltage - Limit | 20 |
| Size | BLANK |
| Size - Height | 10 |
| Size - Width | 20 |
Alessandro answers the original question perfectly however in my case the data is something like this in my format. Where there are boolean Yes/No and unique values mixed in. Would a groupby and fill still work in this case?
| A | B |
|---|---|
| Supply Voltage | BLANK |
| Rated Value | 10 |
| Limit | 20 |
| Work | Yes |
| Size | BLANK |
| Height | 11 |
| Depth | 14 |
| Width | 55 |
| Description | BLANK |
| Time | 1432 |
| Date | 10/12/2022 |
| Quote | Hello World |