【发布时间】:2019-06-01 03:24:13
【问题描述】:
我是数据科学领域的新手。 我是通过这篇文章来的 https://towardsdatascience.com/train-test-split-and-cross-validation-in-python-80b61beca4b6 在这里,我无法按照他们编写的代码加载糖尿病数据集。
# Load the Diabetes dataset
columns = “age sex bmi map tc ldl hdl tch ltg glu”.split() # Declare the columns names
diabetes = datasets.load_diabetes() # Call the diabetes dataset from sklearn
df = pd.DataFrame(diabetes.data, columns=columns) # load the dataset as a pandas data frame
y = diabetes.target # define the target variable (dependent variable) as y
我曾尝试通过 csv 加载数据集,但没有成功。
【问题讨论】:
-
尝试时会发生什么?您收到错误消息吗?将其包含在您的问题中。
-
确保使用实引号
"来分隔字符串,而不是代码片段中的“和”,。
标签: python python-3.x machine-learning