【发布时间】:2021-10-16 14:03:14
【问题描述】:
数据集如下所述 定义变量是考试。 考试.shape = (29,2)
|Hours| |Pass|
0 |0.5 | |0|
1 |0.75| |0|
2 |1.00| |0|
3 |1.25| |0|
4 |1.50| |0|
截图中附有清晰的图片
X = exam.Hours
y = exam.Pass
X.shape = (29,) # The column number one is not mentioned
y.shape = (29,) # The column value is not mentioned
预期结果
X.shape = (29,1)
y.shape = (29,1)
【问题讨论】:
-
一列系列,wjich 是一维对象,因此是单个形状值。 Shape 是一个元组,因此显示为 (29,)。
标签: python pandas dataframe numpy dataset