iode.Sample.get_period_list
- Sample.get_period_list(self, astype: type(Any) | str = str) List[Any]
List of all periods of the sample. Periods are exported as string (default) or as float.
- Parameters:
- astype: type or str
Allowed returned type for periods are str and float. Default to str.
- Returns:
- list(str) or list(float)
Examples
>>> from iode import variables, SAMPLE_DATA_DIR >>> variables.load(f"{SAMPLE_DATA_DIR}/fun.var") >>> variables.sample.get_period_list() ['1960Y1', '1961Y1', ..., '2014Y1', '2015Y1'] >>> variables.sample.get_period_list(astype=float) [1960.0, 1961.0, ..., 2014.0, 2015.0]