Datasets:
Formats:
parquet
Sub-tasks:
univariate-time-series-forecasting
Languages:
English
Size:
10M - 100M
License:
Download examples/01_pandas.py from OpenChainBench/benchmarks: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/datasets/OpenChainBench/benchmarks/resolve/main/examples/01_pandas.py
- Command line
-
hf download hf://datasets/OpenChainBench/benchmarks/examples/01_pandas.py
-
curl -L -o 01_pandas.py https://huggingface.co/datasets/OpenChainBench/benchmarks/resolve/main/examples/01_pandas.py
617 Bytes
| """ | |
| Load the OCB headlines feed with pandas via the Hugging Face datasets | |
| library. Good when you want a familiar DataFrame and the dataset is | |
| small enough to fit in memory (it is). | |
| """ | |
| from datasets import load_dataset | |
| ds = load_dataset( | |
| "OpenChainBench/benchmarks", | |
| "headlines", | |
| split="train", | |
| ) | |
| df = ds.to_pandas() | |
| # Latest snapshot only | |
| latest = df["snapshot_date"].max() | |
| today = df[df["snapshot_date"] == latest] | |
| # Top 10 benchmarks by sample size today | |
| print( | |
| today.sort_values("sample_size", ascending=False)[ | |
| ["slug", "leader_name", "value", "unit", "sample_size"] | |
| ].head(10) | |
| ) | |