我不断收到错误
ModuleNotFoundError: No module named 'sklearn.externals.six'
Run Code Online (Sandbox Code Playgroud)
运行以下代码时:
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)
Run Code Online (Sandbox Code Playgroud)
是否有我尚未导入或安装的模块?
大家好,我一直在尝试通过他们的在线教程来学习 React。我将代码复制并粘贴到 Visual Studio Code 中,每次运行 demo.html 时,页面都是空白的。我到达控制台,发现它们是一个语法错误“Uncaught SyntaxError:预期表达式,得到'<'”如果我刚刚完成了复制和粘贴工作,这怎么可能?我不知道这是否与 javascript 位于单独的文件中有关?
我了解了这段代码背后的概念,但我无法弄清楚它为什么起作用。如果有任何帮助,非常感谢!
这是名为 test.js 的脚本
function Welcome(props) { return <h1> Hello {props.name} </h1>;
}
const element = <Welcome name="Sara" />;ReactDOM.render(
element,
document.getElementById('root')
);
Run Code Online (Sandbox Code Playgroud)
这是 demo.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<!-- We will put our React component inside this div. -->
<div id='root'></div>
<!-- Load React. -->
<!-- Note: when deploying, replace "development.js" with "production.min.js". -->
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" …Run Code Online (Sandbox Code Playgroud)