I would very thankful if there is somebody who could help me.
I′m working with a dataframe. I have variables called 'coordinates_x' and 'end_coordinates_x' and 'result'
From beginning if the cell 'result' has the value INCOMPLETE the cell end_coordinates_x is blank. If not, it has a value.
In this case, I would like to take the value of the 'coordinates_x' of the next line if the value of the cell 'result' is INCOMPLETE.
I′m trying:
df['result'] = INCOMPLETE, df['end_coordinates_x'] = df['coordinates_x'].shift(-1)
but i get the error: ValueError: too many values to unpack (expected 2)
Is the line wrong? Do I miss something? I know my knowledge is not that much.
Thanks in advance
question from:
https://stackoverflow.com/questions/65870684/pandas-dataframe-if-condition 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…