5

I am working with python 3 and the pandas package in visual studio code and I the print() function is not displaying correctly.

For example when I am using df.head() it looks good.

df.head() example

But If I use the print() statement I no longer see all of the columns next to each other, some of them get dragged down for some reason. And I can't see the entire data

print(df) example

Anyone knows what I can do to see the entire data, and all of the columns next to each other?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Mihai Stoica
  • 75
  • 1
  • 1
  • 5

1 Answers1

4

The problem comes from library pandas that cuts part of your dataframe when it's too long. Before your print, add this line:

pandas.set_option('max_row', None)

to display the entier row.

Also, you will be able to see all your data adding None argument in head():

trading.head(None)
dallonsi
  • 1,299
  • 1
  • 8
  • 29