December 2018
Intermediate to advanced
318 pages
8h 28m
English
Since our computations are done per minute, we round off the time to the nearest minute, as shown in the following code:
_time = pdata_frame['Time'] #Time column of the data frameedited_time = []for row in pdata_frame.rows: arr = _time.split(':') time_till_mins = str(arr[0]) + str(arr[1]) edited_time.append(time_till_mins) # the rounded off time source = pdata_frame['Source'] # source address
The output of the preceding code is the time rounded off to the nearest minute, that is, 2018-03-18 21:17:58 which will become 2018-03-18 21:17:00 as shown:
'2018-03-18 21:17:00''2018-03-18 21:18:00''2018-03-18 21:19:00''2018-03-18 21:20:00''2018-03-19 21:17:00'
We count the number of connections established per minute for a particular ...
Read now
Unlock full access