here is my first question: I have a pandas DataFrame that looks like the following:
The DataFrame shown in the picture is simplified (its original shape is [1195674 x 11])
but it doesn't matter.
I am trying to set the left hand side (columns A, B, C, D)
as index and the right hand side (columns E, F, G)
as corresponding values (look at the colors).
Do you have any hint?
P.S. another way could be to replicate the left hand side (rows)
in order to have something like the following (the red rows should be cancelled out):
Can you propose any other way to accomplish this task?
Many thanks in advance!
Franco
Let's try ffill
, which will fill forward values for NaN:
df[['A','B','C','D']] = df[['A','B','C','D']].ffill()