Traceback (most recent call last): File "C:\Python38\lib\multiprocessing\pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "C:\Python38\lib\multiprocessing\pool.py", line 48, in mapstar return list(map(*args)) File "D:\hw_stock_2022\ETF实盘选股策略(2)\1ETF数据整理.py", line 47, in cal_all_etf_data df['收盘价_复权'] = df['复权因子'] * (df.iloc[0]['收盘价'] / df.iloc[0]['复权因子']) File "C:\Python38\lib\site-packages\pandas\core\indexing.py", line 1073, in __getitem__ return self._getitem_axis(maybe_callable, axis=axis) File "C:\Python38\lib\site-packages\pandas\core\indexing.py", line 1625, in _getitem_axis self._validate_integer(key, axis) File "C:\Python38\lib\site-packages\pandas\core\indexing.py", line 1557, in _validate_integer raise IndexError("single positional indexer is out-of-bounds") IndexError: single positional indexer is out-of-bounds
时间: 2023-07-24 22:58:01 浏览: 241
Mac下anaconda中Spyder打开报错Traceback(most recent call last)…问题
5星 · 资源好评率100%
这是一个 Python 的错误信息,看起来是在使用 Pandas 库进行数据处理时出现了问题。具体的错误是“single positional indexer is out-of-bounds”,意思是指定的索引超出了数据范围。
可能需要检查代码中使用的索引是否正确,或者数据是否有缺失导致索引出现错误。
阅读全文