can anyone please offer suggestions on ways to programmatically generate time series data artificially. if possible, mimic the distribution of an existing dataset (say hourly humidity readings) and add some noise if required. Any suggestions will be greatly appreciated!
-
$\begingroup$ Please check this link datascience.stackexchange.com/q/52628/73441. $\endgroup$– vipin bansalJun 28, 2019 at 16:48
-
$\begingroup$ Please check my answer to this related question: datascience.stackexchange.com/a/76159/76955 $\endgroup$– thinwybkJun 17, 2020 at 12:43
3 Answers
This article is great to generate time series data in python. Hope this helps.
https://towardsdatascience.com/basic-time-series-manipulation-with-pandas-4432afee64ea
-
$\begingroup$ thanks but the link describes handling time series data not generating time series data.. $\endgroup$– ChidiJun 28, 2019 at 14:02
-
import pandas as pd
from datetime import datetime
import numpy as np
date_rng = pd.date_range(start='1/1/2018', end='1/08/2018', freq='H')
This is generating a time stamp, hourly data
type(date_rng)
pandas.core.indexes.datetimes.DatetimeIndex
Create a dataframe and add random values for the corresponding date
df = pd.DataFrame(date_rng, columns=['date'])
df['data'] = np.random.randint(0,100,size=(len(date_rng)))
You have your self-generated time-series data. Hope this one helps.
-
2
TimeGAN is a library in python which can help you achieve this task
There is a nice article to do it in details https://towardsdatascience.com/modeling-and-generating-time-series-data-using-timegan-29c00804f54d