0

I have to import file csv in jupyter but it does not display all data in the file csv, it has only display 5 first row and 5 last row, what can i do ? (I use pandas module)

I asked my friend and he said that in pandas it has a function to display all but he can't remember what is it.

seralouk
  • 30,938
  • 9
  • 118
  • 133
Anh
  • 9
  • This is already well covered on StackOverflow. Examples: [here](https://stackoverflow.com/questions/66657047/showing-all-rows-and-columns-of-pandas-dataframe) and [here](https://stackoverflow.com/q/16424493/8508004), to just point to a couple. – Wayne Mar 28 '23 at 14:43

1 Answers1

1

Your friend is right. You can specify the max rows to be printed.

import pandas as pd


df = pandas.read_csv("data.csv")
pd.set_option('display.max_rows', df.shape[0]+1)

print(df)

Also, setting 'display.max_rows' to None:

pd.set_option('display.max_rows', None)

will display all rows.

seralouk
  • 30,938
  • 9
  • 118
  • 133