Pandas printing ALL dtypes

后端 未结 3 1567
执念已碎
执念已碎 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: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'] 
    

提交回复
热议问题