gpt4 book ai didi

python - ModuleNotFoundError : No module named 'sklearn.externals.six'

转载 作者:行者123 更新时间:2023-12-04 11:05:29 29 4
gpt4 key购买 nike

我不断收到错误

ModuleNotFoundError: No module named 'sklearn.externals.six'
运行以下代码时:
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
import pandas as pd
import mglearn
import numpy as np
from IPython.display import display
import matplotlib as pl
import sklearn

iris_dataset = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris_dataset['data'], iris_dataset['target'], random_state=0)
iris_dataframe = pd.DataFrame(X_train, columns=iris_dataset.feature_names)
pd.plotting.scatter_matrix(iris_dataframe, c=y_train, figsize=(15, 15), marker='o', hist_kwds={'bins':20}, s=60, alpha=.8, cmap=mglearn.cm3)
有没有我没有导入或安装的模块?

最佳答案

你可以使用类似下面的东西..

from six import StringIO

关于python - ModuleNotFoundError : No module named 'sklearn.externals.six' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61901365/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com