Traceback (most recent call last): File "D:\hw_stock_2022\实盘选股策略\数据整理.py", line 238, in <module> all_stock_data.reset_index(inplace=True, drop=True) AttributeError: module 'datetime' has no attribute 'now'
时间: 2023-02-16 14:29:25 浏览: 70
这是一个python程序的错误输出,其中提到了文件 "D:\hw_stock_2022\实盘选股策略\数据整理.py" 的第 238 行发生了错误。错误类型是 AttributeError,错误信息是 "module datetime has no attribute now"。这意味着在程序中使用了 datetime 模块中没有的属性 "now"。
相关问题
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)
![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)
![whl](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![whl](https://img-home.csdnimg.cn/images/20210720083646.png)