AttributeError Traceback (most recent call last) <ipython-input-26-7401c2f31978> in <module>
时间: 2024-05-31 13:13:43 浏览: 173
It seems like you are trying to run some code in Python and getting an `AttributeError`. Can you please provide more information about the error, such as the full traceback and the code that you are running?
相关问题
AttributeError Traceback (most recent call last) <ipython-input-18-484e38e099dc> in <module>() 1 from sklearn import preprocessing ----> 2 minmiax_scale = preprocessing.MinMaxSacler((0,1)) AttributeError: module 'sklearn.preprocessing' has no attribute 'MinMaxSacler'
您好!根据错误信息,看起来是由于您拼写错误导致的。正确的类名应该是 `MinMaxScaler` 而不是 `MinMaxSacler`。请修改代码如下:
```python
from sklearn import preprocessing
minmax_scale = preprocessing.MinMaxScaler((0,1))
```
请注意修改后的代码中的 `MinMaxScaler` 拼写正确。如果还有其他问题,请随时提问。
result = X_train.join(y_train) result.head()AttributeError Traceback (most recent call last) <ipython-input-32-957a4f0008b1> in <module> ----> 1 result = X_train.join(y_train) 2 result.head() AttributeError: 'numpy.ndarray' object has no attribute 'join'
这个错误是因为 numpy.ndarray 对象没有 join() 方法。如果你想将 X_train 和 y_train 拼接在一起,可以使用 numpy.concatenate() 方法。例如:result = numpy.concatenate((X_train, y_train), axis=1)。然后,你可以使用 result.head() 方法查看结果的前几行。
阅读全文