Pandas中head( )函数
在用Pandas读取数据之后,我们往往想要观察一下数据读取是否准确,这就要用到Pandas里面的head( )函数,但是一直有疑问,为什么用head( )函数只能读取前五行数据。接下来给大家分析一下head( )函数原型:
1、应用实例
2、具体原函数原型及讲解
DataFrame.head(n=5)
Return the first n rows.
Parameters: n : int, default 5
Number of rows to select.
Returns: obj_head : type of caller
The first n rows of the caller object.
从上面可以看到,head( )函数的原型中,默认的参数size大小是 5,所以会返回 5 个数据。