2

I have searched StackOverflow and Google but can't find a satisfactory explanation.

I'm hoping someone can help me display all rows of a printout in an IPython notebook.

I have the following code:

g = df.columns.to_series().groupby(df.dtypes).groups
feature_name_dict = {k.name: v for k, v in g.items()}
print(feature_name_dict)

I've also tried:

g = df.columns.to_series().groupby(df.dtypes).groups
feature_name_dict = {k.name: v for k, v in g.items()}
with pd.option_context('display.max_rows', None, 'display.max_columns', None): 
    print(feature_name_dict)

The results I get are:

{'int32': Index(['1_m_v1', '2_m_v1', '3_m_v1', '4_m_v1', '5_m_v1', '6_m_v1', '7_m_v1',
       '8_m_v1', '9_m_v1', '10_m_v1',
       ...
       '1994_y_v2', 'F_v3', 'M_v3', 'F_v4', 'M_v4', 'H_v5', 'W_v5', 'X_v5',
       'C_v9', 'X_v9'],
      dtype='object', length=159), 'int64': Index(['dev'], dtype='object'), 'float64': Index(['v6', 'v7', 'v8', 'v12', 'v13'], dtype='object')}

How can I get a full printout?

EDIT:

If moderator actually looked at question s/he would see that my code attempts what is addressed in the referenced question for "possible duplicate" and it doesn't work

Windstorm1981
  • 2,564
  • 7
  • 29
  • 57
  • Possible duplicate of [Pandas: Setting no. of max rows](https://stackoverflow.com/questions/16424493/pandas-setting-no-of-max-rows) – amanb Apr 28 '19 at 19:55
  • 1
    @amanb Read my question and compare to the answer you reference. You see I TRY THAT SPECIFIC code and it doesnt work. – Windstorm1981 Apr 28 '19 at 20:00

1 Answers1

0

in place of print(feature_name_dict) use print(str(feature_name_dict)). That should work.

saurabh
  • 2,389
  • 3
  • 22
  • 37