TypeError: regplot() got an unexpected keyword argument 'zise'
时间: 2023-10-01 09:06:53 浏览: 177
The error message indicates that there is a typo in the code. Instead of 'size', the keyword argument 'zise' was used in the regplot() function. To fix the error, simply change 'zise' to 'size' in the code. Here's an example:
```
import seaborn as sns
import matplotlib.pyplot as plt
tips = sns.load_dataset("tips")
sns.regplot(x="total_bill", y="tip", data=tips, size=5)
plt.show()
```
In this example, we are using the `size` keyword argument instead of `zise`, which should resolve the TypeError.
相关问题
TypeError: got an unexpected keyword argument 'average'
这个错误通常是因为你使用的函数或方法不支持average参数,或者你的参数拼写错误。你可以检查一下你的代码,看看是否有拼写错误或者参数错误。如果你确定你的代码没有问题,那么可能是你使用的库版本过低,需要升级到最新版本。
以下是一个例子,演示了这个错误的产生和解决方法:
<<引用>>:
```python
import numpy as np
a = np.array([1, 2, 3, 4, 5])
print(np.average(a, axis=0, weights=[0.1, 0.2, 0.3, 0.2, 0.2], average='weighted'))
```
运行上述代码会报错:TypeError: average() got an unexpected keyword argument 'average'
<<引用>>:
解决方法是检查一下你使用的库版本是否支持average参数,如果不支持,可以升级到最新版本。如果你确定你的代码没有问题,那么可能是你使用的库版本过低,需要升级到最新版本。
```python
import numpy as np
a = np.array([1, 2, 3, 4, 5])
print(np.average(a, axis=0, weights=[0.1, 0.2, 0.3, 0.2, 0.2]))
```
输出结果为:3.1
TypeError: regplot() got an unexpected keyword argument 'vector_size'
这错误提示表明 `regplot()` 函数不支持 `vector_size` 这个参数。可能原因是你在调用 `regplot()` 函数时错误地使用了 `vector_size` 参数,或者你使用的是一个过时的版本,不支持该参数。你可以检查一下你的代码是否正确,并查看 `regplot()` 函数的文档以确定支持哪些参数。
相关推荐
![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)
![](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)