My dataframe looks like this:
timestamp price amount amount_f status eth_amount
0 2018-11-30 13:48:00 0.00348016 10 0 cancelled 0.000000
1 2018-11-30 13:48:00 0.00350065 10 0 cancelled 0.000000
2 2018-11-30 13:50:00 0.00348021 10 0 cancelled 0.000000
3 2018-11-30 13:50:00 0.00350064 10 0 cancelled 0.000000
4 2018-11-30 13:51:00 0.00348054 10 0 cancelled 0.000000
5 2018-11-30 13:51:00 0.00349873 10 0 cancelled 0.000000
6 2018-11-30 13:52:00 0.00348094 10 10 filled 0.034809
7 2018-11-30 13:52:00 0.00349692 10 0 cancelled 0.000000
What I would need in fact is to modify the colmun status based on the values of the column amount
and amount_f
. It would be an if statement as follow:
df.amount == df.amount_f then df.status = filled
elif df.amount_f == 0 then df.status = cancelled
else df.status = partially_filled
How could I go about this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…