Datasets:

File size: 2,462 Bytes
bf3667f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
license: apache-2.0
task_categories:
- time-series-forecasting
tags:
- tsfile
- timeseries
- time-series
- format:tsfile
pretty_name: Commodity_Import
configs:
- config_name: default
  data_files:
  - split: train
    path: commodity_import.tsfile
---

# Commodity_Import (TsFile)

Apache TsFile version of the `Commodity_Import` sub-dataset of [`Real-TSF/TIME-ProcessedCSV`](https://huggingface.co/datasets/Real-TSF/TIME-ProcessedCSV).

## Overview

`Commodity_Import` is one of the processed time-series collections bundled in TIME-ProcessedCSV, a multi-domain repository of cleaned CSV series (energy, transport, weather, finance, health and more), each with a `timestamp` column and one or more measurement columns per file.

- **Source files:** 8 CSV file(s) under `https://huggingface.co/datasets/Real-TSF/TIME-ProcessedCSV/tree/main/Commodity_Import`
- **Converted rows:** 5,578 (long format: one row per measurement)
- **Data files:** `['commodity_import.tsfile']`

## Schema (TsFile structure)

- **Time** (INT64, milliseconds) — the source `timestamp` column.
- **freq** (TAG) — source sampling-frequency directory (e.g. `H`, `15T`, `D`).
- **series** (TAG) — source file stem (e.g. `item0`, `NRSROT`).
- **channel** (TAG) — source measurement column name.
- **measurement** (FIELD, FLOAT) — the measurement value.

## Usage

Install the Apache TsFile Python SDK (`pip install tsfile`) and read a converted file:

```python
from pathlib import Path
from tsfile import TsFileReader

path = Path("commodity_import.tsfile")
with TsFileReader(str(path)) as reader:
    schemas = reader.get_all_table_schemas()
    print("tables:", list(schemas))
    table_name = next(iter(schemas))
    table = schemas[table_name]
    columns = [column.get_column_name() for column in table.get_columns()]
    print("columns:", columns)
    field_names = [
        column.get_column_name()
        for column in table.get_columns()
        if column.get_column_name() not in {"Time", "time"}
    ]
    if field_names:
        with reader.query_table(table_name, field_names[:3], batch_size=1024) as result:
            batch = result.read_arrow_batch()
            if batch is not None:
                print(batch.to_pandas().head())
```

## Source & license

- Original dataset: https://huggingface.co/datasets/Real-TSF/TIME-ProcessedCSV/tree/main/Commodity_Import
- Bundle: https://huggingface.co/datasets/Real-TSF/TIME-ProcessedCSV
- License: apache-2.0