You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpandasaspdimportnumpyasnpdefcreate_ns_index(start, fs, nsamples, name='time'):
ns=int(1e9/fs)
dtstart=np.datetime64(start)
dt=dtstart+np.arange(nsamples) *np.timedelta64(ns, 'ns')
freq=ns*pd.datetools.Nano()
returnpd.DatetimeIndex(dt, freq=freq, name=name)
index=create_ns_index('2012-09-20T00:00:00', 24414, 400)
assertindex.freq=='40960N'assertindex.inferred_freq=='40960N'# try to create the same index using the period stringindex=pd.DatetimeIndex(start=index[0], end=index[-1], freq=index.freq)
# throws an AttributeError# now try to create the same index using date_rangeindex=pd.date_range(start=index[0], end=index[-1], freq=index.freq)
# throws the same AttributeError# maybe it works if I use pd.datetools.Nano()index=pd.DatetimeIndex(start=index[0], end=index[-1], freq=index.freq.n*pd.datetools.Nano())
# no such luck# try to use periods...also fails with an ambiguous ValueErrorindex=pd.date_range(start=index[0], end=index[-1], periods=index.size)
The text was updated successfully, but these errors were encountered:
This seems like a bug:
The text was updated successfully, but these errors were encountered: