Guest User

Untitled

a guest
Sep 18th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 KB | None | 0 0
  1.  
  2.  
  3. $ python ZiplineDebug.py
  4. Traceback (most recent call last):
  5. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/pandas/core/indexing.py", line 1395, in _has_valid_type
  6. error()
  7. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/pandas/core/indexing.py", line 1390, in error
  8. (key, self.obj._get_axis_name(axis)))
  9. KeyError: 'the label [2016-09-16 00:00:00+00:00] is not in the [index]'
  10.  
  11. During handling of the above exception, another exception occurred:
  12.  
  13. Traceback (most recent call last):
  14. File "ZiplineDebug.py", line 29, in <module>
  15. environ=os.environ)
  16. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/zipline/utils/run_algo.py", line 360, in run_algorithm
  17. environ=environ,
  18. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/zipline/utils/run_algo.py", line 179, in _run
  19. overwrite_sim_params=False,
  20. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/zipline/algorithm.py", line 709, in run
  21. for perf in self.get_generator():
  22. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/zipline/gens/tradesimulation.py", line 230, in transform
  23. handle_benchmark(normalize_date(dt))
  24. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/zipline/gens/tradesimulation.py", line 190, in handle_benchmark
  25. benchmark_source.get_value(date)
  26. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/zipline/sources/benchmark_source.py", line 75, in get_value
  27. return self._precalculated_series.loc[dt]
  28. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/pandas/core/indexing.py", line 1296, in __getitem__
  29. return self._getitem_axis(key, axis=0)
  30. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/pandas/core/indexing.py", line 1466, in _getitem_axis
  31. self._has_valid_type(key, axis)
  32. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/pandas/core/indexing.py", line 1403, in _has_valid_type
  33. error()
  34. File "/home/username/anaconda3/envs/zipline/lib/python3.4/site-packages/pandas/core/indexing.py", line 1390, in error
  35. (key, self.obj._get_axis_name(axis)))
  36. KeyError: 'the label [2016-09-16 00:00:00+00:00] is not in the [index]'
  37. (zipline) username@hostname:~/projects/zipline$
  38.  
  39.  
  40.  
  41.  
  42.  
  43. (zipline) username@hostname:~/projects/zipline$ cat ZiplineDebug.py
  44. from zipline.api import symbol
  45. from zipline import run_algorithm
  46.  
  47.  
  48. import pandas as pd
  49. import os
  50. from datetime import datetime
  51. import pytz
  52.  
  53.  
  54. def initialize(context):
  55. # context.asset = symbol('AAPL')
  56. pass
  57.  
  58. def handle_data(context, data):
  59. pass
  60.  
  61.  
  62. tz = pytz.timezone("US/Mountain")
  63. start = datetime(2016, 9, 16, tzinfo=tz)
  64. end = datetime(2017, 9, 2, tzinfo=tz)
  65.  
  66. perfData = run_algorithm(start=start,
  67. end=end,
  68. bundle="quantopian-quandl",
  69. initialize=initialize,
  70. capital_base=40000.00,
  71. handle_data=handle_data,
  72. environ=os.environ)
  73.  
  74.  
  75.  
  76. (zipline) username@hostname:~/projects/zipline$
  77.  
  78. (zipline) username@hostname:~/projects/zipline$ grep start ZiplineDebug.py
  79. start = datetime(2016, 9, 17, tzinfo=tz)
  80. perfData = run_algorithm(start=start,
  81. (zipline) username@hostname:~/projects/zipline$ python ZiplineDebug.py
  82. (zipline) username@hostname:~/projects/zipline$
  83.  
  84. # packages in environment at /home/username/anaconda3/envs/zipline:
  85. pandas 0.18.1 np111py34_0
  86. pandas-datareader 0.2.1 py34_0
  87. python 3.4.5 0
  88. python-dateutil 2.6.1 py34_0
  89. zipline 1.1.1 np111py34_0 Quantopian
  90. (zipline) username@hostname:~$
Advertisement
Add Comment
Please, Sign In to add comment