Python Forum

Full Version: Pandas Dataframe through read_csv()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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]
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/st...tions.html
https://pandas.pydata.org/pandas-docs/st...set_option

e.g. set display.max_columns to None