I tried to implement the solution provided here and I am getting "invalid syntax" I am trying to get the max value + firs/last value.
and my code looks like this:
groups = df[df['isTrade'] == 1].groupby('dateTime_s')
print(groups.agg({
'Volume': np.sum,
'tradePrice':[np.max,lambda x: x.iloc[0]],
}).head(160))
Thanks for your help!