2024-06-16 13:09:34 发布
网友
我很困惑。 下面是查看数据集形状的命令:
In[] df_faa_dataset.shape Out[] (83, 42)
现在我想查看前5行并输入命令:
In[] df_faa_dataset.head() Out[] (displayed output with 5 rows × 42 columns)
为什么默认情况下.head()方法占用了5行而没有在括号中提及
.head()
Official Documentation
从文档中复制
DataFrame.head(n=5) Returns first n rows
这就是我们在python中建立默认参数值的方式。对于head方法,n=5意味着默认值是5,因此,如果您自己不传递参数值,则使用5
head
n=5
Official Documentation
从文档中复制
这就是我们在python中建立默认参数值的方式。对于
head
方法,n=5
意味着默认值是5,因此,如果您自己不传递参数值,则使用5相关问题 更多 >
编程相关推荐