用法:
dask.datasets.timeseries(start='2000-01-01', end='2000-01-31', freq='1s', partition_freq='1d', dtypes={'id': <class 'int'>, 'name': <class 'str'>, 'x': <class 'float'>, 'y': <class 'float'>}, seed=None, **kwargs)
使用随机数据创建时间序列 DataFrame
- start:日期时间(或 datetime-like 字符串)
时间序列的开始
- end:日期时间(或 datetime-like 字符串)
时间序列结束
- dtypes:dict
列名到类型的映射。有效类型包括 {float, int, str, ‘category’}
- freq:string
时间序列频率的字符串,如 ‘2s’ 或“1H”或“12W”
- partition_freq:string
像“1M”或“2Y”这样的字符串,用于将数据帧划分为分区
- seed:int(可选)
randomstate种子
- kwargs:
将关键字传递给单个列创建函数。关键字的前缀应该是列名,然后是下划线。
参数:
例子:
>>> import dask >>> df = dask.datasets.timeseries() >>> df.head() timestamp id name x y 2000-01-01 00:00:00 967 Jerry -0.031348 -0.040633 2000-01-01 00:00:01 1066 Michael -0.262136 0.307107 2000-01-01 00:00:02 988 Wendy -0.526331 0.128641 2000-01-01 00:00:03 1016 Yvonne 0.620456 0.767270 2000-01-01 00:00:04 998 Ursula 0.684902 -0.463278 >>> df = dask.datasets.timeseries( ... '2000', '2010', ... freq='2H', partition_freq='1D', seed=1, # data frequency ... dtypes={'value': float, 'name': str, 'id': int}, # data types ... id_lam=1000 # control number of items in id column ... )
相关用法
- Python dask.dataframe.Series.apply用法及代码示例
- Python dask.dataframe.to_records用法及代码示例
- Python dask.dataframe.DataFrame.applymap用法及代码示例
- Python dask.dataframe.Series.clip用法及代码示例
- Python dask.dataframe.Series.prod用法及代码示例
- Python dask.dataframe.Series.fillna用法及代码示例
- Python dask.dataframe.DataFrame.sub用法及代码示例
- Python dask.dataframe.compute用法及代码示例
- Python dask.dataframe.DataFrame.mod用法及代码示例
- Python dask.dataframe.Series.to_frame用法及代码示例
- Python dask.dataframe.read_table用法及代码示例
- Python dask.dataframe.read_hdf用法及代码示例
- Python dask.dataframe.Series.sum用法及代码示例
- Python dask.dataframe.Series.dropna用法及代码示例
- Python dask.dataframe.DataFrame.cummin用法及代码示例
- Python dask.dataframe.Series.gt用法及代码示例
- Python dask.dataframe.Series.ge用法及代码示例
- Python dask.dataframe.Series.repartition用法及代码示例
- Python dask.dataframe.Series.mod用法及代码示例
- Python dask.dataframe.Series.count用法及代码示例
注:本文由纯净天空筛选整理自dask.org大神的英文原创作品 dask.datasets.timeseries。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。