Pretty-print an entire Pandas Series / DataFrame

后端 未结 12 2403
再見小時候
再見小時候 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 03:56

    After importing pandas, as an alternative to using the context manager, set such options for displaying entire dataframes:

    pd.set_option('display.max_columns', None)  # or 1000
    pd.set_option('display.max_rows', None)  # or 1000
    pd.set_option('display.max_colwidth', -1)  # or 199
    

    For full list of useful options, see:

    pd.describe_option('display')
    

提交回复
热议问题