Python Forum
Pandas Dataframe through read_csv() - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Pandas Dataframe through read_csv() (/thread-18725.html)



Pandas Dataframe through read_csv() - ift38375 - May-29-2019

Hi Experts,
when i am trying to make dataframe through read_csv() function then it is not showing all columns of CSV file instead of that it is showing some columns as dotted (......).
so how can i show all columns in output clearly ?
>>> import pandas as pd
>>> df = pd.read_csv("F:\KS Stuff\income_data.csv")
>>> print(df)
Output:
GEOID State 2005 2006 ... 2010 2011 2012 2013 0 04000US01 Alabama 37150 37952 ... 40933 42590 43464 41381 1 04000US02 Alaska 55891 56418 ... 57848 57431 63648 61137 2 04000US04 Arizona 45245 46657 ... 46896 48621 47044 50602 3 04000US05 Arkansas 36658 37057 ... 38587 41302 39018 39919 4 04000US06 California 51755 55319 ... 54283 53367 57020 57528
[5 rows x 11 columns]


RE: Pandas Dataframe through read_csv() - buran - May-29-2019

These dots are called ellipsis.

In this case when pretty print the dataframe they replace rows/columns and truncated view is displayed
Note that in fact dataframe has all data, that is just for visualisation.

you can change that in the options
https://pandas.pydata.org/pandas-docs/stable/user_guide/options.html
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.set_option.html#pandas.set_option

e.g. set display.max_columns to None