1

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
  • 151,199
  • 17
  • 111
  • 216
Mihai Stoica
  • 25
  • 1
  • 4

1 Answers1

2

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,238
  • 1
  • 6
  • 24