This may be a dumb question but I am a tad stuck with this. Say I have this dataframe:
amount amount_str buy_order_id id midprice price
0 0.01545000 0.01545000 915692220 53424450 0.1286495 0.12947460
0 1.65956203 1.65956203 915692330 53424458 NaN 0.12947460
0 0.68427900 0.68427900 915692581 53424487 NaN 0.12947460
0 0.22306417 0.22306417 915692632 53424491 NaN 0.12808629
0 0.22306396 0.22306396 915692964 53424530 NaN 0.12808646
0 2.31474046 2.31474046 915693081 53424535 NaN 0.12947460
0 0.16808924 0.16808924 915694097 53424600 NaN 0.12808675
0 5.30166589 5.30166589 915694819 53424629 NaN 0.12808710
price_str sell_order_id timestamp type
0 0.12947460 915690988 1518045004 0
0 0.12947460 915690988 1518045006 0
0 0.12947460 915690988 1518045010 0
0 0.12808629 915692647 1518045010 1
0 0.12808646 915693012 1518045016 1
0 0.12947460 915690988 1518045017 0
0 0.12808675 915694117 1518045031 1
0 0.12808710 915694862 1518045041 1
Here is my issue: each time the program gets a new order from bitstamp, it appends the values to this dataframe, and then adds the current midprice.
I could normally do that with df['midprice'] = value
; however, this sets it for the entire column and not just that entry.
How would I make it so it adds it per line and not to the entire column?
Thanks!