Datasets:
|
Download README.md from THULab/crypto_data: direct link, hf CLI and curl.
- Browser
- Download file 3.98 kB
-
https://huggingface.co/datasets/THULab/crypto_data/resolve/main/README.md
- Command line
-
hf download hf://datasets/THULab/crypto_data/README.md
-
curl -L -o README.md https://huggingface.co/datasets/THULab/crypto_data/resolve/main/README.md
3.98 kB
| license: apache-2.0 | |
| language: | |
| - en | |
| multilinguality: | |
| - monolingual | |
| task_categories: | |
| - time-series-forecasting | |
| tags: | |
| - tsfile | |
| - timeseries | |
| - modality:timeseries | |
| - format:tsfile | |
| - finance | |
| - crypto | |
| - trading | |
| - blockchain | |
| modality: timeseries | |
| pretty_name: CryptoData Dataset (TsFile format) | |
| configs: | |
| - config_name: default | |
| data_files: | |
| - split: train | |
| path: "crypto_data.tsfile" | |
| # CryptoData Dataset (TsFile format) | |
| CryptoData is a collection of cryptocurrency market data intended for price | |
| prediction, market trend analysis, and historical analysis. The source card | |
| describes default, close, indicators, and sequences configurations. At the | |
| pinned source revision, the available data files are the daily candle CSVs; | |
| the converted artifact therefore documents and contains the available candle | |
| data only. | |
| Modalities: Time-series | |
| ## Source and scale | |
| - Original dataset: [sebdg/crypto_data](https://huggingface.co/datasets/sebdg/crypto_data) | |
| - Source revision: 9767bde1e557d1aef9bb70808ce5642493c11574 | |
| - Source layout: 298 files under candles/*.csv; 294 contain observations. | |
| - Converted scale: 216,226 rows from 294 markets, with a dominant daily cadence. | |
| - There is no predefined train/validation/test split. | |
| - Four files are header-only: ASTR-EUR.csv, BLZ-EUR.csv, ONDO-EUR.csv, and | |
| SSV-EUR.csv. They contribute zero rows and are not represented as empty | |
| devices. | |
| ## TsFile schema | |
| | Column | Role | TsFile type | Source meaning | | |
| |---|---|---|---| | |
| | Time | TIME | INT64 (ms) | Source time, epoch milliseconds | | |
| | market | TAG | STRING | Market identifier, for example BTC-EUR | | |
| | open | FIELD | DOUBLE | Opening price | | |
| | high | FIELD | DOUBLE | High price | | |
| | low | FIELD | DOUBLE | Low price | | |
| | close | FIELD | DOUBLE | Closing price | | |
| | volume | FIELD | DOUBLE | Traded volume | | |
| ## Conversion notes | |
| - Every non-empty candle file is combined into one logical table and sorted by | |
| market, then ascending Time. | |
| - Source integer epoch-millisecond time is renamed to Time without changing its | |
| value. The source market column is the device TAG. | |
| - OHLCV values are retained as numeric fields; no rows or semantic measurements | |
| are dropped. Header-only files are excluded solely because they contain no | |
| observations. | |
| - Indicators and sequence arrays described in the source card are not claimed | |
| because their generated files are absent at this pinned revision. | |
| ## Files and usage | |
| - crypto_data.tsfile | |
| ~~~python | |
| from pathlib import Path | |
| from tsfile import TsFileReader | |
| path = Path("crypto_data.tsfile") | |
| with TsFileReader(str(path)) as reader: | |
| schemas = reader.get_all_table_schemas() | |
| table_name = next(iter(schemas)) | |
| with reader.query_table(table_name, ["close", "volume"], batch_size=1024) as result: | |
| batch = result.read_arrow_batch() | |
| if batch is not None: | |
| print(batch.to_pandas().head()) | |
| ~~~ | |
| ## License and attribution | |
| The source dataset is released under the Apache-2.0 license. See the | |
| [original dataset card](https://huggingface.co/datasets/sebdg/crypto_data) for | |
| the source description and usage context. | |
| ## 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("crypto_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()) | |
| ``` | |