select_dtypes() got an unexpected keyword argument 'numeric_only'
时间: 2023-10-03 14:10:37 浏览: 28
The error message "select_dtypes() got an unexpected keyword argument 'numeric_only'" indicates that you are using a version of pandas that does not support the `numeric_only` parameter in the `select_dtypes()` function.
The `numeric_only` parameter was added in pandas version 1.2.0, so if you are using an older version of pandas, you will need to upgrade to a newer version to use this parameter.
If you are already using a newer version of pandas and still encountering this error, make sure that you are spelling the parameter correctly and that you are using it within the `select_dtypes()` function. If the error persists, try restarting your kernel or updating your pandas installation.
相关问题
load_model got an unexpected keyword argument 'name
load_model函数是keras中的一个方法,用于加载之前训练好的模型,以便进行预测或继续训练等操作。在使用load_model时,若出现"got an unexpected keyword argument 'name'"的错误提示,通常是因为该函数的调用参数中包括了不被支持的name参数。
解决该问题的方法,一般需要检查代码中load_model的参数传递方式是否正确,是否传递了不必要的关键字参数。如果不确定如何使用该函数,可以查看keras官方文档,文档中详细介绍了该函数的使用方法和支持的参数,可以根据需要进行调整使用。除此之外,还可以通过升级Keras版本、重新安装keras等方式解决该问题。在遇到该问题时,建议充分检查代码和环境等因素,以确保代码正确性和稳定性。
corr() got an unexpected keyword argument 'numeric_only'
这个错误提示是因为在 pandas 1.2.0 之后的版本中,"corr()" 函数不再支持 "numeric_only" 参数。如果你想要计算数值型列之间的相关性,可以在计算前使用 ".select_dtypes()" 方法,选择只包含数值型列的子集,然后再使用 "corr()" 函数进行计算。例如:
```
numeric_df = df.select_dtypes(include='number')
correlation_matrix = numeric_df.corr()
```
这将会选择数据框 df 中所有数值型列的子集,然后计算这些列之间的相关性,得到一个相关性矩阵。
相关推荐
![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)
![](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)