time_window_sampler

Sample JSONL records uniformly within specified time windows.

541|171|Updated May 3, 2018
One-click install
npx skills add https://github.com/cas-bigdatalab/piflow --skill time-window-sampler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: time_window_sampler
Source: https://github.com/cas-bigdatalab/piflow/tree/main/workspace/skills/time_window_sampler
Command: npx skills add https://github.com/cas-bigdatalab/piflow --skill time-window-sampler

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python, json, datetime, and includes scripts (resource) components.

What problem does it solve?

This Skill automates the process of time window sampling on JSONL time series records, making it easier to analyze and work with large volumes of data at specific time intervals.

Core Features & Use Cases

  • Time Window Sampling: Group records by time windows and sample uniformly within each window.
  • Flexible Time Granularity: Supports sampling by day, hour, month, week, etc.
  • Use Case: Ideal for analyzing trends and patterns in data recorded at specific time intervals, such as daily or hourly sales data.

Quick Start

Run the time_window_sampler skill with the command: python scripts/run_time_window_sampler.py --input data.jsonl --output sampled.jsonl --time_field event_time --window_size 1d --sample_per_window 2

Frequently Asked Questions about time_window_sampler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sample time series records from a JSONL file at specific time intervals?

To sample time series records from a JSONL file, you can group records by time windows and sample uniformly within each window using a Python script. This process utilizes the datetime library to parse time fields and extract records at specified intervals.

What is time window sampling and when should I use it for data analysis?

Time window sampling is a data analysis technique that groups records into specific time intervals, such as days or hours, and samples uniformly within each window. It is ideal for analyzing trends and patterns in large volumes of time series data.

Can I sample JSONL data by different time granularities like hour, day, or month?

Yes, you can sample JSONL data by flexible time granularities including hour, day, week, or month. The sampling script processes your specified time field to group records into the desired time windows for uniform extraction.

Do I need Python and specific libraries to process JSONL time series data?

Yes, you need Python installed along with the built-in json and datetime libraries to process JSONL time series data. These dependencies are required to parse JSON lines and calculate time window intervals for sampling.

What's the best way to automate uniform sampling across daily time windows?

The best way to automate uniform sampling across daily time windows is running a Python script that targets your time field and specifies a daily window size. This automatically groups and extracts a set number of records per window.