df.head() sometimes doesn't work in Pandas, Python

后端 未结 3 840
故里飘歌
故里飘歌 2020-12-09 09:55

I\'m a beginner in Python and the Pandas library, and I\'m rather confused by some basic functionality of DataFrame. I\'ve got a pandas DataFrame as below:



        
3条回答
  •  甜味超标
    2020-12-09 10:09

     DataFrame.head(n=5)
    

    Return the first n rows.

    This function returns the first n rows for the object based on position. It is useful for quickly testing if your object has the right type of data in it.

    Parameters:

    n : int, default 5
    

    Number of rows to select.

    Returns:

    obj_head : type of caller
    

    The first n rows of the caller object.

提交回复
热议问题