Как создать np.sin()
с интервалом даты и времени?
np.arange(0, 100, 0.1)
: Не возвращать ошибку при создании массива
start = pd.Timestamp('2015-07-01')
end = pd.Timestamp('2015-08-01')
t = np.linspace(start.value, end.value, 100)
time = pd.to_datetime(t)
#time = np.arange(0, 100, 0.1)
sin = np.sin(time) + np.random.normal(scale=0.5, size=len(time))
Ошибка:
sin = np.sin(time) + np.random.normal(scale=0.5, size=len(time))
TypeError: ufunc 'sin' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Время печати:
np_resource = np.dtype ([("ресурс", np.ubyte, 1)]) DatetimeIndex ([
'2015-07-01 00:00:00', ' 2015-07-01 07: 30: 54.545454592 ',' 2015-07-01 15: 01: 49.090909184 ',' 2015-07-01 22: 32: 43.636363520 ',' 2015-07-02 06: 03: 38.181818112 ' , ....