When I set the arguments as follows:
results = detect_ts(data,
max_anoms=0.1,
direction='both', only_last=None, longterm=True, e_value=True)
I get the following error:
Issue occurs only when I am using e_value. I had removed the argument and the function works fine.
ValueError Traceback (most recent call last)
in
12 results = detect_ts(data,
13 max_anoms=0.1,
---> 14 direction='both', only_last=None, longterm=True, e_value=True)
15
C:\Program Files\Anaconda\lib\site-packages\pyculiarity\detect_ts.py in detect_ts(df, max_anoms, direction, alpha, only_last, threshold, e_value, longterm, piecewise_median_period_weeks, plot, y_log, xlabel, ylabel, title, verbose)
325 'anoms': all_anoms.value
326 }
--> 327 anoms = DataFrame(d, index=d['timestamp'].index)
328
329 return {
C:\Program Files\Anaconda\lib\site-packages\pandas\core\frame.py in init(self, data, index, columns, dtype, copy)
390 dtype=dtype, copy=copy)
391 elif isinstance(data, dict):
--> 392 mgr = init_dict(data, index, columns, dtype=dtype)
393 elif isinstance(data, ma.MaskedArray):
394 import numpy.ma.mrecords as mrecords
C:\Program Files\Anaconda\lib\site-packages\pandas\core\internals\construction.py in init_dict(data, index, columns, dtype)
210 arrays = [data[k] for k in keys]
211
--> 212 return arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype)
213
214
C:\Program Files\Anaconda\lib\site-packages\pandas\core\internals\construction.py in arrays_to_mgr(arrays, arr_names, index, columns, dtype)
54
55 # don't force copy because getting jammed in an ndarray anyway
---> 56 arrays = _homogenize(arrays, index, dtype)
57
58 # from BlockManager perspective
C:\Program Files\Anaconda\lib\site-packages\pandas\core\internals\construction.py in _homogenize(data, index, dtype)
263 # Forces alignment. No need to copy data since we
264 # are putting it into an ndarray later
--> 265 val = val.reindex(index, copy=False)
266 else:
267 if isinstance(val, dict):
C:\Program Files\Anaconda\lib\site-packages\pandas\core\series.py in reindex(self, index, **kwargs)
3736 @appender(generic.NDFrame.reindex.doc)
3737 def reindex(self, index=None, **kwargs):
-> 3738 return super(Series, self).reindex(index=index, **kwargs)
3739
3740 def drop(self, labels=None, axis=0, index=None, columns=None,
C:\Program Files\Anaconda\lib\site-packages\pandas\core\generic.py in reindex(self, *args, **kwargs)
4354 # perform the reindex on the axes
4355 return self._reindex_axes(axes, level, limit, tolerance, method,
-> 4356 fill_value, copy).finalize(self)
4357
4358 def _reindex_axes(self, axes, level, limit, tolerance, method, fill_value,
C:\Program Files\Anaconda\lib\site-packages\pandas\core\generic.py in _reindex_axes(self, axes, level, limit, tolerance, method, fill_value, copy)
4372 obj = obj._reindex_with_indexers({axis: [new_index, indexer]},
4373 fill_value=fill_value,
-> 4374 copy=copy, allow_dups=False)
4375
4376 return obj
C:\Program Files\Anaconda\lib\site-packages\pandas\core\generic.py in _reindex_with_indexers(self, reindexers, fill_value, copy, allow_dups)
4488 fill_value=fill_value,
4489 allow_dups=allow_dups,
-> 4490 copy=copy)
4491
4492 if copy and new_data is self._data:
C:\Program Files\Anaconda\lib\site-packages\pandas\core\internals\managers.py in reindex_indexer(self, new_axis, indexer, axis, fill_value, allow_dups, copy)
1222 # some axes don't allow reindexing with dups
1223 if not allow_dups:
-> 1224 self.axes[axis]._can_reindex(indexer)
1225
1226 if axis >= self.ndim:
C:\Program Files\Anaconda\lib\site-packages\pandas\core\indexes\base.py in _can_reindex(self, indexer)
3085 # trying to reindex on an axis with duplicates
3086 if not self.is_unique and len(indexer):
-> 3087 raise ValueError("cannot reindex from a duplicate axis")
3088
3089 def reindex(self, target, method=None, level=None, limit=None,
ValueError: cannot reindex from a duplicate axis