4

The following rows in the table are ranked highest to lowest based on sales. I like how the output shows me the top sales as well as the worst sales. But I would like to view more than just 5 from each end. I have tried to increase the rows that I can view with this code:

pd.options.display.max_rows = 20

but I still get the same view:

New York                                    PROD_DESC  SLS_QTY
1500           BUBBLICIOUS GUM  5 SVG SR/APL     1850
330                AIRCAST MEDIUM RIGHT BRAC     1272
31                             25 CENT CANDY     1272
1441               BOOST PLUS VERY VANILLA L     1272
1440               BOOST PLUS INSTCHOC  27 X     1272
                                      ...      ...
3693             GEL BUNION GUARD LITTLE TOE       -1
7585                       RIB BELT FEM UNIV       -1
5136         JEAN NATE AFTER BATH POWDER 6OZ       -1
7353  POVIDINE IODINE 10% OINTMENT 1OZ MAJOR       -2
1235       BENADRYL ITCH RELIEF STICK 0.47OZ       -2

Anyone know what I am doing wrong?

2 Answers2

2

This is because of the massive amount of rows you have. When you have a lot of rows the data frame will always by default show the top and bottom 5 rows. If you want to to see a specific amount of rows from the top you can always just use the head function.

df = pd.DataFrame(data)
df.head(20)
scottapotamus
  • 548
  • 3
  • 18
0

you can set how many rows appear in the terminal:

pd.set_option('display.height', number)
pd.set_option('display.max_rows', number)

probably just the second depending on your version

Pandas: Setting no. of max rows

Derek Eden
  • 4,403
  • 3
  • 18
  • 31