AttributeError: the 'module' object does not have the 'TimeSeries' attribute after python Validation.py

Just start your Tucker Balch settlement investment. I use virtualbox and install Ubuntu. After installing QSTK, I launched python Validation.py (step 7). I keep getting:

AttributeError: the 'module' object does not have the 'TimeSeries' attribute

There are many similar questions, so I believe the problem is using the same name as the file somewhere in the code. I was wondering if anyone has a solution specific to this class and QSTK.

Full error:

Traceback (most recent call last):
 File "Validation.py", line 122 in <module>
  import QSTK.qstkutil.tsutil as tsu
 File "usr/local/lib/python2.7/dist-packages/QSTK-0.2.8 py2.7.egg/QSTK/qstkutil/tsutil.py", line 19, in <module>
  from QSTK.qstkutil import qsdateutil
 File "usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkutil/qsdateutil.py", line 38, in <module>
  GTS_DATES = _cache_dates()
 File "usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkutil/qsdateutil.py", line 36, in _cache_dates
  return pd.TimeSeries(index=dates, data=dates) 
AttributeError: 'module' object has no attribute 'TimeSeries' 
+4
source share
3 answers

. pandas lib. ( -/Library/Python/2.7/site-packages/QSTK/qstkutil), qstkutil.py QSTK. "TimeSeries" "".

(https://github.com/QuantSoftware/QuantSoftwareToolkit/issues/73)

+4

. , 2 "TimeSeries" "Series" /usr/local/lib/python 2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkutil/qsdateutil.py. "TimeSeries" /usr/local/lib/python 2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkutil/tsutil.py, - .

+3

Changing TimeSeriesto Seriesfixes the problem for me.

It seems that

import pandas as pd; 
pd.TimeSeries = pd.Series        

should work, but not for me.

+1
source

Source: https://habr.com/ru/post/1681041/


All Articles