0

In my dataframe, I have a one column which has a very large set with a lot of information.

When I do:

df.head()

It crops the column data so I can't see it all. Any ideas how stop the cropping and have scrollbar instead?

Thanks

More Than Five
  • 9,959
  • 21
  • 77
  • 127

3 Answers3

1

An easy solution is to just set display.max_colwidth to -1 like:

pd.set_option('display.max_colwidth', -1)
Dr G.
  • 1,298
  • 9
  • 17
0

The command df.head() prints the first few rows of a dataframe, df.tail() the last rows. It is 5 by default, but you could say, e.g., df.head(20) to get 20 rows.

df should return the entire data frame and with df[n:m] you can return the rows from n to m, just df[:5] is the same as the head function.

See here for more on data frames.

data_henrik
  • 16,724
  • 2
  • 28
  • 49
0

One to do this:

pd.set_option('max_colwidth', 2000)
More Than Five
  • 9,959
  • 21
  • 77
  • 127