microsoft / data-formulator

🪄 Create rich visualizations with AI
https://arxiv.org/abs/2408.16119
MIT License
1.35k stars 73 forks source link

add moving average #51

Open nicho2 opened 2 weeks ago

nicho2 commented 2 weeks ago

is-it possible to add 1 hour mobile average ?

i have these values :

timestamp,co2 2024-10-28T08:00:00,407.0 2024-10-28T08:01:00,407.0 2024-10-28T08:02:00,407.0 2024-10-28T08:03:00,407.0 2024-10-28T08:04:00,407.0 2024-10-28T08:05:00,407.0 2024-10-28T08:06:00,407.0 2024-10-28T08:07:00,407.17 2024-10-28T08:08:00,408.0 2024-10-28T08:09:00,408.33 2024-10-28T08:10:00,409.0 2024-10-28T08:11:00,409.17 2024-10-28T08:12:00,410.0 2024-10-28T08:13:00,410.0 2024-10-28T08:14:00,410.5 2024-10-28T08:15:00,411.0 2024-10-28T08:16:00,411.0 2024-10-28T08:17:00,411.67 2024-10-28T08:18:00,412.0 2024-10-28T08:19:00,412.0 2024-10-28T08:20:00,412.0 2024-10-28T08:21:00,412.67 2024-10-28T08:22:00,413.0 2024-10-28T08:23:00,413.0 2024-10-28T08:24:00,412.0 2024-10-28T08:25:00,412.0 2024-10-28T08:26:00,412.0 2024-10-28T08:27:00,411.33 2024-10-28T08:28:00,411.0 2024-10-28T08:29:00,411.0 2024-10-28T08:30:00,410.0 2024-10-28T08:31:00,410.0 2024-10-28T08:32:00,409.5 2024-10-28T08:33:00,409.0 2024-10-28T08:34:00,409.0 2024-10-28T08:35:00,409.0 2024-10-28T08:36:00,408.0 2024-10-28T08:37:00,408.0 2024-10-28T08:38:00,408.0 2024-10-28T08:39:00,408.0 2024-10-28T08:40:00,408.0 2024-10-28T08:41:00,407.0 2024-10-28T08:42:00,412.5 2024-10-28T08:43:00,407.17 2024-10-28T08:44:00,408.0 2024-10-28T08:45:00,408.0 2024-10-28T08:46:00,407.33 2024-10-28T08:47:00,407.0 2024-10-28T08:48:00,407.0 2024-10-28T08:49:00,430.67 2024-10-28T08:50:00,407.0 2024-10-28T08:51:00,407.0 2024-10-28T08:52:00,407.0 2024-10-28T08:53:00,407.0 2024-10-28T08:54:00,407.0 2024-10-28T08:55:00,407.0 2024-10-28T08:56:00,407.0 2024-10-28T08:57:00,407.0 2024-10-28T08:58:00,407.0 2024-10-28T08:59:00,407.0 2024-10-28T09:00:00,407.0 2024-10-28T09:01:00,407.0 2024-10-28T09:02:00,407.5 2024-10-28T09:03:00,408.67 2024-10-28T09:04:00,410.17 2024-10-28T09:05:00,412.83 2024-10-28T09:06:00,416.67 2024-10-28T09:07:00,420.33 2024-10-28T09:08:00,424.33 2024-10-28T09:09:00,427.5 2024-10-28T09:10:00,430.5 2024-10-28T09:11:00,433.17 2024-10-28T09:12:00,435.67 2024-10-28T09:13:00,437.83 2024-10-28T09:14:00,439.67 2024-10-28T09:15:00,441.33 2024-10-28T09:16:00,442.33 2024-10-28T09:17:00,443.0 2024-10-28T09:18:00,443.5 2024-10-28T09:19:00,444.0 2024-10-28T09:20:00,444.0 2024-10-28T09:21:00,444.0 2024-10-28T09:22:00,444.0 2024-10-28T09:23:00,445.0 2024-10-28T09:24:00,445.0 2024-10-28T09:25:00,445.0 2024-10-28T09:26:00,445.0 2024-10-28T09:27:00,444.5 2024-10-28T09:28:00,444.0 2024-10-28T09:29:00,444.0 2024-10-28T09:30:00,443.0 2024-10-28T09:31:00,443.0 2024-10-28T09:32:00,442.5 2024-10-28T09:33:00,442.0 2024-10-28T09:34:00,441.67 2024-10-28T09:35:00,441.0 2024-10-28T09:36:00,441.0 2024-10-28T09:37:00,440.17 2024-10-28T09:38:00,440.0 2024-10-28T09:39:00,440.0 2024-10-28T09:40:00,439.5 2024-10-28T09:41:00,439.0 2024-10-28T09:42:00,439.0 2024-10-28T09:43:00,439.0 2024-10-28T09:44:00,439.0 2024-10-28T09:45:00,439.0 2024-10-28T09:46:00,439.0 2024-10-28T09:47:00,439.0 2024-10-28T09:48:00,439.0 2024-10-28T09:49:00,441.0 2024-10-28T09:50:00,438.0 2024-10-28T09:51:00,437.67 2024-10-28T09:52:00,437.0 2024-10-28T09:53:00,437.0 2024-10-28T09:54:00,436.0 2024-10-28T09:55:00,436.0 2024-10-28T09:56:00,435.17 2024-10-28T09:57:00,435.0 2024-10-28T09:58:00,434.5 2024-10-28T09:59:00,434.0 2024-10-28T10:00:00,433.5 2024-10-28T10:01:00,433.0 2024-10-28T10:02:00,432.17 2024-10-28T10:03:00,432.0 2024-10-28T10:04:00,432.0 2024-10-28T10:05:00,432.83 2024-10-28T10:06:00,435.5 2024-10-28T10:07:00,439.67 2024-10-28T10:08:00,444.5 2024-10-28T10:09:00,450.5 2024-10-28T10:10:00,457.5 2024-10-28T10:11:00,463.67 2024-10-28T10:12:00,470.67 2024-10-28T10:13:00,478.0 2024-10-28T10:14:00,485.33 2024-10-28T10:15:00,492.33 2024-10-28T10:16:00,500.0 2024-10-28T10:17:00,507.67 2024-10-28T10:18:00,514.33 2024-10-28T10:19:00,515.0 2024-10-28T10:20:00,515.0 2024-10-28T10:21:00,515.0 2024-10-28T10:22:00,515.0 2024-10-28T10:23:00,515.0 2024-10-28T10:24:00,515.0 2024-10-28T10:25:00,515.0 2024-10-28T10:26:00,515.0 2024-10-28T10:27:00,515.0 2024-10-28T10:28:00,515.0 2024-10-28T10:29:00,515.0 2024-10-28T10:30:00,515.0 2024-10-28T10:31:00,515.0 2024-10-28T10:32:00,515.0 2024-10-28T10:33:00,515.17 2024-10-28T10:34:00,521.0 2024-10-28T10:35:00,524.83 2024-10-28T10:36:00,524.83 2024-10-28T10:37:00,523.83 2024-10-28T10:38:00,522.5 2024-10-28T10:39:00,520.5 2024-10-28T10:40:00,518.0 2024-10-28T10:41:00,515.33 2024-10-28T10:42:00,511.83 2024-10-28T10:43:00,508.17 2024-10-28T10:44:00,504.0 2024-10-28T10:45:00,499.33 2024-10-28T10:46:00,494.5 2024-10-28T10:47:00,485.5 2024-10-28T10:48:00,485.5 2024-10-28T10:49:00,480.83 2024-10-28T10:50:00,476.0 2024-10-28T10:51:00,471.33 2024-10-28T10:52:00,466.83 2024-10-28T10:53:00,462.33 2024-10-28T10:54:00,458.0 2024-10-28T10:55:00,454.33 2024-10-28T10:56:00,450.33 2024-10-28T10:57:00,446.67 2024-10-28T10:58:00,443.5 2024-10-28T10:59:00,440.5 2024-10-28T11:00:00,437.67 2024-10-28T11:01:00,435.17 2024-10-28T11:02:00,433.17 2024-10-28T11:03:00,431.33 2024-10-28T11:04:00,429.67 2024-10-28T11:05:00,429.0 2024-10-28T11:06:00,428.0 2024-10-28T11:07:00,428.0 2024-10-28T11:08:00,429.33 2024-10-28T11:09:00,433.67 2024-10-28T11:10:00,439.5 2024-10-28T11:11:00,445.5 2024-10-28T11:12:00,451.83 2024-10-28T11:13:00,459.5 2024-10-28T11:14:00,467.5 2024-10-28T11:15:00,476.17 2024-10-28T11:16:00,484.67 2024-10-28T11:17:00,493.0 2024-10-28T11:18:00,501.0 2024-10-28T11:19:00,508.67 2024-10-28T11:20:00,515.83 2024-10-28T11:21:00,523.0 2024-10-28T11:22:00,531.33 2024-10-28T11:23:00,535.0 2024-10-28T11:24:00,535.0 2024-10-28T11:25:00,535.0 2024-10-28T11:26:00,535.0 2024-10-28T11:27:00,535.0 2024-10-28T11:28:00,535.0 2024-10-28T11:29:00,535.0 2024-10-28T11:30:00,535.0 2024-10-28T11:31:00,535.0 2024-10-28T11:32:00,535.0 2024-10-28T11:33:00,535.0 2024-10-28T11:34:00,524.17 2024-10-28T11:35:00,535.0 2024-10-28T11:36:00,535.0 2024-10-28T11:37:00,535.0 2024-10-28T11:38:00,535.0 2024-10-28T11:39:00,535.0 2024-10-28T11:40:00,536.0 2024-10-28T11:41:00,544.33 2024-10-28T11:42:00,553.17 2024-10-28T11:43:00,560.0 2024-10-28T11:44:00,565.67 2024-10-28T11:45:00,570.33 2024-10-28T11:46:00,499.17 2024-10-28T11:47:00,577.83 2024-10-28T11:48:00,581.5 2024-10-28T11:49:00,584.83 2024-10-28T11:50:00,588.33 2024-10-28T11:51:00,592.0 2024-10-28T11:52:00,596.5 2024-10-28T11:53:00,601.83 2024-10-28T11:54:00,607.5 2024-10-28T11:55:00,613.83 2024-10-28T11:56:00,619.5 2024-10-28T11:57:00,623.0

i have this screen Image

i request a mobile average on 1 hour

i obtain this

Image

nothing is displayed because timestamp is change in timestamp value from 1970 Image

but when change the timestamp to datetime, i obtain Image

My question is : how to obtain the 2 lines (co2 and its mobile average

Thanks

Chenglong-MS commented 2 weeks ago

Good example! I'm thinking we can create an example page with community examples to share with others.

This is what I got:

Image

Image