Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to print all rows/data from csv file with Pandas in Python?

Problem

I have a CSV file which has 100 rows. I want to print them all with pandas module. But It only printing 10 rows. How can I print all of them?

Code

from pandas import *

cvs=read_csv('sample.csv')

print(cvs)

Output which I get

    Serial Number                   Company Name  ...         Description Leave
0   9788189999599                 TALES OF SHIVA  ...                mark     0
1   9780099578079      1Q84 THE COMPLETE TRILOGY  ...                Mark     0
2   9780198082897                       MY KUMAN  ...                Mark     0
3   9780007880331        THE GOD OF SMAAL THINGS  ...  4TH HARPER COLLINS     2
4   9780545060455               THE BLACK CIRCLE  ...  4TH HARPER COLLINS     0
..            ...                            ...  ...                 ...   ...
94  9788184821536  MORE STORIES FROM THE JATAKAS  ...                 ACK     0
95  9788184821543           MORE TALES OF BIRBAL  ...                 ACK     0
96  9788184821550         TALES FROM THE JATAKAS  ...                 ACK     0
97  9788184821567               RAMarkS OF MEWAR  ...                 ACK     0
98  9788184821574       THE SONS OF THE PANDAVAS  ...                 ACK     0

[99 rows x 5 columns]
[Finished in 5.6s]

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can try this one

from pandas import *

cvs=read_csv('sample.csv')
pandas.set_option('display.max_rows', csv.shape[0]+1)

print(cvs)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading