Suppose I have the following table,
+-------+----------+-------+-------+
| Date | Exchange | price | x |
+-------+----------+-------+-------+
| 02/12 | LSE | 1 | s |
| 03/12 | LSE | 2 | d |
| 03/12 | LSE | 2 | f |
| 03/12 | CBOE | 3 | q |
| 04/12 | CBOE | 4 | w |
| 04/12 | CBOE | 5 | t |
+-------+----------+-------+-------+
I am want to get a table that adds the columns price when the two columns date and exchanges are the same, i.e. the table would look like
+-------+----------+-------+
| Date | Exchange | price |
+-------+----------+-------+
| 02/12 | LSE | 1 |
| 03/12 | LSE | 4 |
| 03/12 | CBOE | 3 |
| 04/12 | CBOE | 9 |
+-------+----------+-------+
I tried something but it doesnt work
spread_per_isin_size_2500.groupby(['exchange', 'date']).size().groupby(level=1).max()
I can i acheive this?
Thanks