I cannot find solutions to that anywhere. What I am trying to achieve is: dataframe grouped by 'Machine' column, next would be average column 'datetime' and last one as a count of 'Barcode'.
Not working attempt:
result = df.groupby('Machine')['datetime'].aggregate('mean')['Barcode'].aggregate('count')
[1]: https://i.stack.imgur.com/h8HiV.png <-- dateFrame before operation