I have a feeling this is very simple but I am having a major issue with this.
Say I have the following dataframe in pandas.
price ordersize
0 0.139664 6.051679
1 0.139665 2.358634
2 0.139665 2.618828
3 0.139665 27.240000
4 0.139665 0.040661
5 0.140060 3.000000
6 0.140100 1.463016
7 0.140128 0.020000
8 0.140418 85.000000
9 0.140427 7.000000
This is an orderbook for BCHBTC
As you can see starting at index 1 to index 5 we see a number of orders at the same price.
I need to take this input and get it to bin the data so it outputs another dataframe like this.
price ordersize
0 0.139664 6.051679
1 0.139665 32.258123
2 0.140060 3.000000
3 0.140100 1.463016
4 0.140128 0.020000
5 0.140418 85.000000
6 0.140427 7.000000
I have tried using groupby and other things but It is not giving me the correct output, or gives it in a very weird formating that is hard to work with.
If I could get some help with this that would be much appreciated.