DataLoader
- class crypto_env.dataloader.DataLoader(start_idx, end_idx)[source]
Bases:
abc.ABCThe DataLoader module is for user to map arbitrary data source to form that the environment can recognize.
- abstract __init__(start_idx, end_idx)[source]
- Parameters
start_idx (int) – Start index
end_idx (int) – End index
- __iter__()[source]
This object is iterable. See https://www.w3schools.com/python/python_iterators.asp for more details.
- abstract __next__()[source]
See https://www.w3schools.com/python/python_iterators.asp for more details
- abstract get_feature(feature_name)[source]
Get input variables (features)
- Parameters
feature_name (str) – name of the feature
- Raises
NotImplementedError –
- get_transaction_fee(idx=None)[source]
Return the transaction fee list
- Parameters
idx (int, optional) – Number of transaction fee to return. Defaults to None.
- Returns
list
- property idx
- class crypto_env.dataloader.ETHLoader(base_dir, start_idx, end_idx, features: list, dropna=False, download=True, url='https://raw.githubusercontent.com/coinmetrics/data/master/csv/eth.csv')[source]
Bases:
crypto_env.dataloader.dataloader.DataLoaderOur example implementation of
DataLoaderclass. We use the Ethereum history data from the coinmetrics repo. See https://raw.githubusercontent.com/coinmetrics/data for more details.- __init__(base_dir, start_idx, end_idx, features: list, dropna=False, download=True, url='https://raw.githubusercontent.com/coinmetrics/data/master/csv/eth.csv')[source]
- Parameters
base_dir (str) – Directory to save the download data
start_idx (int) – Where to start in the data source
end_idx (int) – Where to end in the data source
features (list) – Input variables for the environment
dropna (bool, optional) – Whether to drop lines including empty values. Defaults to False.
download (bool, optional) – Whether to re-download the data. Defaults to True.
url (str, optional) – Link to the data source. Defaults to “https://raw.githubusercontent.com/coinmetrics/data/master/csv/eth.csv”.