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
Now that you know a little about me, let me tell you about the issue I am
having:
Description of Issue
When I go to import zipline, I get the error:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NaTType'
The above error occurs in the file '/venv/lib/python3.7/site-packages/trading_calendars/calendar_helpers.py'
The specific line of code causing the issue is:
NP_NAT = np.array([pd.NaT], dtype=np.int64)[0]
What did you expect to happen?
zipline would be imported without issue.
What happened instead?
The full trace:
Traceback (most recent call last):
File "/venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3441, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
import zipline
File "/pycharm-community-2021.2/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/venv/lib/python3.7/site-packages/zipline/init.py", line 21, in
from trading_calendars import get_calendar
File "/pycharm-community-2021.2/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/PycharmProjects/ziplineReloaded/venv/lib/python3.7/site-packages/trading_calendars/init.py", line 16, in
from .trading_calendar import TradingCalendar
File "/pycharm-community-2021.2/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/PycharmProjects/ziplineReloaded/venv/lib/python3.7/site-packages/trading_calendars/trading_calendar.py", line 33, in
from .calendar_helpers import (
File "/pycharm-community-2021.2/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/PycharmProjects/ziplineReloaded/venv/lib/python3.7/site-packages/trading_calendars/calendar_helpers.py", line 7, in
NP_NAT = np.array([pd.NaT], dtype=np.int64)[0] # Original line from Classic Zipline.
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NaTType'
Here is how you can reproduce this issue on your machine:
What steps have you taken to resolve this already?
I searched online for info about NaT and how to convert this data type to int64 as per my limited understanding of what this line tries to do.
I tried simply omitting "dtype=np.int64" from the line in question. This change allowed me to import zipline without problems.
However it causes "RuntimeWarning: overflow encountered in long_scalars
NANOSECONDS_PER_MINUTE," when attempting to ingest a custom data bundle. I can provide more info on this if needed.
Tried pasting the full TypeError message into stackoverflow but I couldn't find a fix or similar issue thread.
...
Anything else?
NaT means "Not a Time Object" yes? Is the point of this line to simply create a blank time or datetime object as a place holder?
Thank you very much in advance for any assistance that can be shared.
...
Sincerely,
playingwithpy
The text was updated successfully, but these errors were encountered:
Dear Zipline Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
Pycharm 2021.2 CE
*Operating System == Linux 5.11.0-7620-generic x86_64 GNU/Linux
*Python Version == Python 3.7.11
*Python Bitness == 64
*Installed Via == pip install zipline-reloaded
alembic==1.6.5
alphalens==0.4.0
backcall==0.2.0
bcolz-zipline==1.2.3.post2
Bottleneck==1.3.2
cached-property==1.5.2
certifi==2021.5.30
charset-normalizer==2.0.4
click==8.0.1
cycler==0.10.0
decorator==5.0.9
empyrical==0.5.5
empyrical-reloaded==0.5.7
greenlet==1.1.0
h5py==3.3.0
idna==3.2
importlib-metadata==4.6.3
intervaltree==3.1.0
ipython==7.26.0
ipython-genutils==0.2.0
iso3166==1.0.1
iso4217==1.6.20180829
jedi==0.18.0
joblib==1.0.1
kiwisolver==1.3.1
Logbook==1.5.3
lru-dict==1.1.7
lxml==4.6.3
Mako==1.1.4
MarkupSafe==2.0.1
matplotlib==3.4.2
matplotlib-inline==0.1.2
multipledispatch==0.6.0
multitasking==0.0.9
networkx==2.6.2
numexpr==2.7.3
numpy==1.21.1
pandas==1.3.1
pandas-datareader==0.10.0
parso==0.8.2
patsy==0.5.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.3.1
prompt-toolkit==3.0.19
ptyprocess==0.7.0
pyfolio==0.9.2
Pygments==2.9.0
pyparsing==2.4.7
python-dateutil==2.8.2
python-editor==1.0.4
python-interface==1.6.1
pytz==2021.1
requests==2.26.0
scikit-learn==0.24.2
scipy==1.7.1
seaborn==0.11.1
six==1.16.0
sortedcontainers==2.4.0
SQLAlchemy==1.4.22
statsmodels==0.12.2
TA-Lib==0.4.21
threadpoolctl==2.2.0
toolz==0.11.1
trading-calendars==2.1.1
traitlets==5.0.5
typing-extensions==3.10.0.0
urllib3==1.26.6
wcwidth==0.2.5
yfinance==0.1.63
zipline-reloaded==2.0.0.post1
zipp==3.5.0
Now that you know a little about me, let me tell you about the issue I am
having:
Description of Issue
When I go to import zipline, I get the error:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NaTType'
The above error occurs in the file '/venv/lib/python3.7/site-packages/trading_calendars/calendar_helpers.py'
The specific line of code causing the issue is:
NP_NAT = np.array([pd.NaT], dtype=np.int64)[0]
What did you expect to happen?
zipline would be imported without issue.
What happened instead?
The full trace:
Traceback (most recent call last):
File "/venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3441, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
import zipline
File "/pycharm-community-2021.2/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/venv/lib/python3.7/site-packages/zipline/init.py", line 21, in
from trading_calendars import get_calendar
File "/pycharm-community-2021.2/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/PycharmProjects/ziplineReloaded/venv/lib/python3.7/site-packages/trading_calendars/init.py", line 16, in
from .trading_calendar import TradingCalendar
File "/pycharm-community-2021.2/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/PycharmProjects/ziplineReloaded/venv/lib/python3.7/site-packages/trading_calendars/trading_calendar.py", line 33, in
from .calendar_helpers import (
File "/pycharm-community-2021.2/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/PycharmProjects/ziplineReloaded/venv/lib/python3.7/site-packages/trading_calendars/calendar_helpers.py", line 7, in
NP_NAT = np.array([pd.NaT], dtype=np.int64)[0] # Original line from Classic Zipline.
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NaTType'
Here is how you can reproduce this issue on your machine:
Reproduction Steps
...
What steps have you taken to resolve this already?
I searched online for info about NaT and how to convert this data type to int64 as per my limited understanding of what this line tries to do.
I tried simply omitting "dtype=np.int64" from the line in question. This change allowed me to import zipline without problems.
However it causes "RuntimeWarning: overflow encountered in long_scalars
NANOSECONDS_PER_MINUTE," when attempting to ingest a custom data bundle. I can provide more info on this if needed.
Tried pasting the full TypeError message into stackoverflow but I couldn't find a fix or similar issue thread.
...
Anything else?
NaT means "Not a Time Object" yes? Is the point of this line to simply create a blank time or datetime object as a place holder?
Thank you very much in advance for any assistance that can be shared.
...
Sincerely,
playingwithpy
The text was updated successfully, but these errors were encountered: