Traceback (most recent call last): File "D:\hw_stock_2022\ETF实盘选股策略(2)\1ETF数据整理.py", line 135, in <module> df_list = pool.map(cal_all_etf_data, sorted(etf_list)) File "C:\Python38\lib\multiprocessing\pool.py", line 364, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "C:\Python38\lib\multiprocessing\pool.py", line 771, in get raise self._value IndexError: single positional indexer is out-of-bounds
时间: 2023-02-07 11:09:23 浏览: 99
这个错误消息表明在文件 "1ETF数据整理.py" 的第 135 行的代码中,调用了 "pool.map" 函数,并且在调用过程中抛出了 "IndexError" 异常。这个异常的具体信息是 "single positional indexer is out-of-bounds",意思是在访问单个位置的数据时,索引越界了。
这个错误的原因可能是在调用 "pool.map" 函数时,传入的参数 "etf_list" 中的某个元素在进行索引时,超出了它的范围。你可以检查这个参数 "etf_list",看看里面的元素是否存在这种情况。
你还可以尝试添加异常处理代码,来捕获这个异常,并进行相应的处理。
相关问题
Traceback (most recent call last): File "D:\hw_stock_2022\ETF实盘选股策略(2)\1ETF数据整理.py", line 147, in <module> all_etf_data = pd.concat(df_list, ignore_index=True) NameError: name 'df_list' is not defined
这是一个 Python 程序的错误消息。它指出在文件 "1ETF数据整理.py" 的第 147 行中,发生了一个名为 `NameError` 的错误。错误的具体原因是:在程序中使用了名为 `df_list` 的变量,但是这个变量并没有被定义(即给它赋值)。
要解决这个错误,需要在程序中正确地定义并初始化变量 `df_list`,然后再运行程序。
Traceback (most recent call last): File "D:\hw_stock_2022\ETF实盘选股策略(2)\0_爬取更新ETF日线数据-new.py", line 49, in <module> path = df.to_csv('./index/sh000001.csv', encoding='gbk', mode='w') NameError: name 'df' is not defined
这个错误提示告诉你在你的代码的第 49 行,你使用了变量 `df`,但是这个变量并没有被定义。可能是你忘记在之前的代码中对这个变量进行赋值,或者是你在之前的代码中拼写错误导致无法正确调用这个变量。你应该检查你的代码,确保这个变量在使用前已经被正确地定义并赋值。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)