Full output in mission screen; truncated output in script window

Screen Link:
https://app.dataquest.io/m/347/working-with-missing-and-duplicate-data/8/handle-missing-values-by-dropping-columns

My Code:

combined.isnull().sum()

When I type this into the “script window” on the right-side of my browswer (what should I be calling that area?) I get the expected output:

Output
COUNTRY                          0
DYSTOPIA RESIDUAL               19
ECONOMY GDP PER CAPITA          19
FAMILY                          19
FREEDOM                         19
                              ... 
TRUST GOVERNMENT CORRUPTION     19
UPPER CONFIDENCE INTERVAL      332
WHISKER HIGH                   334
WHISKER LOW                    334
YEAR                             0
Length: 17, dtype: int64

By contrast, the “mission text window” on the left-side of my browser (what should I call that area?) shows:

combined.isnull().sum()
COUNTRY                          0
DYSTOPIA RESIDUAL               19
ECONOMY GDP PER CAPITA          19
FAMILY                          19
FREEDOM                         19
GENEROSITY                      19
HAPPINESS RANK                  19
HAPPINESS SCORE                 19
HEALTH LIFE EXPECTANCY          19
LOWER CONFIDENCE INTERVAL      332
REGION                           0
STANDARD ERROR                 331
TRUST GOVERNMENT CORRUPTION     19
UPPER CONFIDENCE INTERVAL      332
WHISKER HIGH                   334
WHISKER LOW                    334
YEAR                             0
dtype: int64

So the $64,000 question is: how can I get the output to show the full results and not truncate it with ellipses? I was able to see the full list by assigning the result back to a variable and then use the variable inspector to “look inside” but that solution feels hokey.

I did find this on Stack Overflow but that feels like using a sledgehammer to kill a fly…is there a “newspaper solution” someone can recommend? Or better yet, teach me something on this subject that I’m missing?

2 Likes

Use pd.set_option

pd.set_option('display.max_rows', None)
print(combined.isnull().sum())

Or Converting into string also works

print(combined.isnull().sum().to_string())
1 Like

Nice! These are the “newspapers” I was looking for! :sunglasses:

Much appreciated @DishinGoyani