0

I am trying to run the following code in a Kaggle notebook block/cell.

dfv2i = dfv2.dropna(axis=0)
dfv2i.head()
dfv2i.info()

When I run just the first two lines, it works and outputs the head of the dataframe. When I run all three lines, it only outputs info() and does not output the head(). If I want to run both, I have to put them in separate code blocks/cells...or put info() before head()... why is this?

  • `head()` and `info()` do not actually print anything by themselves. jupyter cells just print the output of the last command as a convenience. if you want multiple outputs to be shown, you need to put them in different cells, or print them explicitly like `print(dfv2i.head())` (but `print()` removes html formatting) – tdy Nov 24 '22 at 17:49

0 Answers0