THUgewu commited on
Commit
c03434d
·
verified ·
1 Parent(s): 766bef0

Add TsFile (converted from Real-TSF/TIME-ProcessedCSV)

Browse files
Files changed (2) hide show
  1. README.md +70 -0
  2. commodity_production.tsfile +0 -0
README.md ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - time-series-forecasting
5
+ tags:
6
+ - tsfile
7
+ - timeseries
8
+ - time-series
9
+ - format:tsfile
10
+ pretty_name: Commodity_Production
11
+ configs:
12
+ - config_name: default
13
+ data_files:
14
+ - split: train
15
+ path: commodity_production.tsfile
16
+ ---
17
+
18
+ # Commodity_Production (TsFile)
19
+
20
+ Apache TsFile version of the `Commodity_Production` sub-dataset of [`Real-TSF/TIME-ProcessedCSV`](https://huggingface.co/datasets/Real-TSF/TIME-ProcessedCSV).
21
+
22
+ ## Overview
23
+
24
+ `Commodity_Production` 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.
25
+
26
+ - **Source files:** 32 CSV file(s) under `https://huggingface.co/datasets/Real-TSF/TIME-ProcessedCSV/tree/main/Commodity_Production`
27
+ - **Converted rows:** 10,403 (long format: one row per measurement)
28
+ - **Data files:** `['commodity_production.tsfile']`
29
+
30
+ ## Schema (TsFile structure)
31
+
32
+ - **Time** (INT64, milliseconds) — the source `timestamp` column.
33
+ - **freq** (TAG) — source sampling-frequency directory (e.g. `H`, `15T`, `D`).
34
+ - **series** (TAG) — source file stem (e.g. `item0`, `NRSROT`).
35
+ - **channel** (TAG) — source measurement column name.
36
+ - **measurement** (FIELD, FLOAT) — the measurement value.
37
+
38
+ ## Usage
39
+
40
+ Install the Apache TsFile Python SDK (`pip install tsfile`) and read a converted file:
41
+
42
+ ```python
43
+ from pathlib import Path
44
+ from tsfile import TsFileReader
45
+
46
+ path = Path("commodity_production.tsfile")
47
+ with TsFileReader(str(path)) as reader:
48
+ schemas = reader.get_all_table_schemas()
49
+ print("tables:", list(schemas))
50
+ table_name = next(iter(schemas))
51
+ table = schemas[table_name]
52
+ columns = [column.get_column_name() for column in table.get_columns()]
53
+ print("columns:", columns)
54
+ field_names = [
55
+ column.get_column_name()
56
+ for column in table.get_columns()
57
+ if column.get_column_name() not in {"Time", "time"}
58
+ ]
59
+ if field_names:
60
+ with reader.query_table(table_name, field_names[:3], batch_size=1024) as result:
61
+ batch = result.read_arrow_batch()
62
+ if batch is not None:
63
+ print(batch.to_pandas().head())
64
+ ```
65
+
66
+ ## Source & license
67
+
68
+ - Original dataset: https://huggingface.co/datasets/Real-TSF/TIME-ProcessedCSV/tree/main/Commodity_Production
69
+ - Bundle: https://huggingface.co/datasets/Real-TSF/TIME-ProcessedCSV
70
+ - License: apache-2.0
commodity_production.tsfile ADDED
Binary file (48.5 kB). View file