MarketAxess interview question

Given a pandas dataframe, do some basic cleaning and aggregation.