Output data from all columns in a dataframe in pandas

Output data from all columns in a dataframe in pandas

Asked on December 20, 2018 in Pandas.
Add Comment


  • 2 Answer(s)

    Suppose the output data of all columns should be displayed though it will not fit in the screen:

    print paramdata.values
    

    The above code using matrix representation converts the dataframe to the numpy array:

    paramdata.columns
    

    The column names can be stored using the above code

    paramdata.index
    

    The row names can be stored using the above code.

    Answered on December 20, 2018.
    Add Comment

    Use the function  to_csv() and stdout:

    import sys
     
    paramdata.to_csv(sys.stdout)
    

    The above code displays the whole dataframe though it may not be nice though the function to_csv() can be used to set the parameters for column separator:

    One can also use .to_csv() and initialise it to None.

    paramdata.to_csv(None)
    
    Answered on December 20, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.