superstore_data / README.md
wangdx25's picture
Add TsFile (converted from An-j96/SuperstoreData)
f7706c3 verified
|
Raw
History Blame Contribute Delete
2.67 kB
---
pretty_name: "Superstore Sales POS (TsFile)"
modality: timeseries
authors: "An-j96"
task_categories:
- time-series-forecasting
size_categories:
- 1K<n<10K
tags:
- tsfile
- timeseries
- modality:timeseries
- format:tsfile
- finance
configs:
- config_name: default
data_files:
- split: train
path: "superstore_data.tsfile"
---
# Superstore Sales POS (TsFile)
This dataset is an Apache TsFile conversion of
[`An-j96/SuperstoreData`](https://huggingface.co/datasets/An-j96/SuperstoreData).
Modalities: Time-series.
## Overview
- Superstore point-of-sale transactions for sales/demographics forecasting.
- Each order records segment, category, region, ship mode, and sale metrics (`Sales`, `Quantity`, `Discount`, `Profit`).
- Order dimensions are device TAGs; sales metrics are FIELDs.
- Converted observations: 9,994 rows across 1 TsFile file(s)
- Source format: csv
## TsFile schema
- **Time** — source `Order Date` (`%m/%d/%Y`), converted to INT64 milliseconds.
| Column | Role | Type | Meaning |
|---|---|---|---|
| `Time` | TIME | INT64 (ms) | sample timestamp |
| `Row_ID` | TAG | STRING | order id |
| `Segment` | TAG | STRING | customer segment |
| `Category` | TAG | STRING | product category |
| `Region` | TAG | STRING | region |
| `Ship_Mode` | TAG | STRING | shipping mode |
| `Sales` | FIELD | FLOAT | sales amount |
| `Quantity` | FIELD | FLOAT | quantity |
| `Discount` | FIELD | FLOAT | discount |
| `Profit` | FIELD | FLOAT | profit |
## Conversion notes
- `Row_ID`, `Segment`, `Category`, `Region`, `Ship_Mode` kept as TAGs; `Sales`/`Quantity`/`Discount`/`Profit` as FLOAT/INT64 FIELDs.
## Source & license
- Original dataset: https://huggingface.co/datasets/An-j96/SuperstoreData
- Author / publisher: An-j96
- License: gpl-2.0
## 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("superstore_data.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())
```