-
Notifications
You must be signed in to change notification settings - Fork 29
ValueError: 0 is not in range #4
Copy link
Copy link
Open
Description
run the command "python3 run_first_time.py"
.......
984 sh.600917 重庆燃气
985 sh.600918 中泰证券
Traceback (most recent call last):
File "/home/zjp/.local/lib/python3.8/site-packages/pandas/core/indexes/range.py", line 346, in get_loc
return self._range.index(new_key)
ValueError: 0 is not in range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "run_first_time.py", line 46, in <module>
calculate_stock_spec.calculate_all_spec('sh', 'sh.000001')
File "/home/zjp/workstaging/StockIndicatorAnalyzer/calculate_stock_spec.py", line 58, in calculate_all_spec
daily['relaprice'] = daily['close']/daily['close'][0]
File "/home/zjp/.local/lib/python3.8/site-packages/pandas/core/series.py", line 882, in __getitem__
return self._get_value(key)
File "/home/zjp/.local/lib/python3.8/site-packages/pandas/core/series.py", line 991, in _get_value
loc = self.index.get_loc(label)
File "/home/zjp/.local/lib/python3.8/site-packages/pandas/core/indexes/range.py", line 348, in get_loc
raise KeyError(key) from err
KeyError: 0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels