Pretty-print an entire Pandas Series / DataFrame

后端 未结 12 2211
再見小時候
再見小時候 2020-11-22 03:26

I work with Series and DataFrames on the terminal a lot. The default __repr__ for a Series returns a reduced sample, with some head and tail values, but the res

12条回答
  •  太阳男子
    2020-11-22 04:01

    You can achieve this using below method. just pass the total no. of columns present in the DataFrame as arg to

    'display.max_columns'

    For eg :

    df= DataFrame(..)
    with pd.option_context('display.max_rows', None, 'display.max_columns', df.shape[1]):
        print(df)
    

提交回复
热议问题