0

I am sure this has been asked a million times, but I must be googling the wrong thing. I am playing with a Kaggle dataset that is multidimensional (81 fields). The function is simple:

def calc_missing_data(df):
    total = df.isnull().sum().sort_values(ascending=False)
    percent_1 = df.isnull().sum()/df.isnull().count()*100
    percent_2 = (round(percent_1, 1)).sort_values(ascending=False)
    missing_data = pd.concat([total, percent_2], axis=1, keys=['Total', '%'])
    return missing_data

calc_missing_data(df)

But the output is limited to only part of the fields:

enter image description here

Is there a way to see all the outputs? Thank you.

Eupatoria
  • 130
  • 1
  • 9
  • The duplicate flag is wrong, or at least redirect to a wrong question. The redirected question in fact asks how to widen the DataFrame in IDLE or text based terminal. In this question context, Jupyter Notebook provide some method other than IDLE, for example: `IPython.display.display(IPython.HTML(dataframe.to_html()))` –  Jan 30 '20 at 03:39

1 Answers1

0

You can set the option to show all columns by setting the max_columns shown to none:

import pandas as pd
pd.set_option('display.max_columns', None)

should work.

Alireza Tajadod
  • 327
  • 1
  • 8
  • Thanks! However, it didn't seem to work. It did display all the fields in some other outputs (e.g. for describe() ), but not in the particular case at which I am looking. – Eupatoria Jan 29 '20 at 20:12