What would be a way to have put rows with same time_req together and not grouped according to ErrorCode. Currently I am gettting all 0 ErrorCode report and then all Errocode 1 report like below
>>> data.groupby([data['ErrorCode'], pd.Grouper(freq='15T')])['latency'].describe().unstack().reset_index() ErrorCode Time_req count mean std \ 0 0 2017-03-08 04:30:00 1 603034.000000 NaN 1 0 2017-03-08 04:45:00 2 174720.000000 38101.741797 2 0 2017-03-08 05:00:00 2 674942.500000 786118.185810 3 0 2017-03-08 07:45:00 10 266653.200000 165867.496817 4 0 2017-03-08 08:00:00 23 208949.304348 124902.942685 5 0 2017-03-08 08:15:00 31 247282.064516 181780.519320 6 0 2017-03-08 08:30:00 35 249332.857143 340084.918015 7 0 2017-03-08 08:45:00 7 250066.000000 195051.871617 8 1 2017-03-08 04:45:00 4 227747.500000 148185.181566 9 1 2017-03-08 05:00:00 2 126633.000000 1337.846030 10 1 2017-03-08 07:45:00 10 421781.900000 464249.118555 11 1 2017-03-08 08:00:00 22 188122.272727 82110.336132 12 1 2017-03-08 08:15:00 32 294896.968750 229498.560222 13 1 2017-03-08 08:30:00 35 501679.628571 1353873.878385 14 1 2017-03-08 08:45:00 6 531606.000000 582290.903396 But I need alternate something like below
ErrorCode Time_req count 0 2017-03-08 04:30:00 1 1 NaN NaN NaN 0 2017-03-08 04:45:00 2 1 2017-03-08 04:45:00 4 AND SO ON