Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Pandas Dataframe through read_csv()
#1
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]
buran wrote May-29-2019, 05:49 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Quote
#2
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
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  read_csv error ilcaa72 2 272 May-29-2019, 02:58 PM
Last Post: ilcaa72

Forum Jump:


Users browsing this thread: 1 Guest(s)