Truncate your time series data!

Truncate your time series data!

One day, you have a data. It looks like this.

Time Group
07:21:54 A
08:06:15 B
08:21:50 A
07:07:55 A
07:21:19 B
07:49:42 B

So you want to turn it from this to this.

So you decided to add a column called count, and add 1 for each row.

Time Group Count
07:21:54 A 1
08:06:15 B 1
08:21:50 A 1
07:07:55 A 1
07:21:19 B 1
07:49:42 B 1

Then you plot it out.

Geez... Okay that's obvious. Just plot every 1 out isn't help. That's why aggregation comes to the rescue!

So we try to create time bucket for 5 minute, then we group the time nearest to the bucket value.

Then we try to count objects inside each of the bucket

Our data becomes like this.

Time Group Count
07:20:00 A 2
08:05:00 B 1
08:20:00 A 1
07:05:00 A 1
07:45:00 B 1

Then we can plot it out nicely!

Show Comments