Python Jupyter Pandas NameError:未定义名称'data'

问题描述 投票:-1回答:1

这些是我的图书馆

import pandas as pd
import numpy as np
import seaborn as sns

这些是另一个

from sklearn import linear_model
from sklearn.model_selection import train_test_split

当我尝试运行此命令时


x = data.iloc[:,:-1]
y = data['Class']

显示此错误

NameError Traceback (most recent call last)
<ipython-input-13-431e580384e5> in <module>
----> 1 x = data.iloc[:,:-1]
      2 y = data['Class']
NameError: name 'data' is not defined
python jupyter data-science nameerror
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.