Pandas printing ALL dtypes

后端 未结 3 1561
执念已碎
执念已碎 2020-12-14 15:57

This seems like a very simple problem, however it\'s driving me round the bend. I\'m sure it should be solved by RTFM, but I\'ve looked at the options and I can see the one

相关标签:
3条回答
  • 2020-12-14 16:39

    Do this:

    with pd.option_context('display.max_rows', None, 'display.max_columns', None):
        print(df.dtypes)
    
    0 讨论(0)
  • 2020-12-14 16:41

    another way around is to group by dtype as follows:

    x = df.columns.to_series().groupby(df.dtypes).groups
    x
    {dtype('object'): ['Date', 'Selection', 'Result'], dtype('float64'): ['profit', 'PL', 'cumPL'] 
    
    0 讨论(0)
  • 2020-12-14 16:54

    I tried this and worked:

    df.info(verbose=True)
    
    0 讨论(0)
提交回复
热议问题