Python Forum
Pandas Dataframe through read_csv()
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]
Reply
#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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 690 Dec-04-2023, 09:48 PM
Last Post: sanky1990
  Question on pandas.dataframe merging two colums shomikc 4 783 Jun-29-2023, 11:30 AM
Last Post: snippsat
  Pandas AttributeError: 'DataFrame' object has no attribute 'concat' Sameer33 5 5,301 Feb-17-2023, 06:01 PM
Last Post: Sameer33
  help how to get size of pandas dataframe into MB\GB mg24 1 2,230 Jan-28-2023, 01:23 PM
Last Post: snippsat
  pandas dataframe into csv .... exponent issue mg24 10 1,706 Jan-20-2023, 08:15 PM
Last Post: deanhystad
  How to assign a value to pandas dataframe column rows based on a condition klllmmm 0 798 Sep-08-2022, 06:32 AM
Last Post: klllmmm
  How to retrieve records in a DataFrame (Python/Pandas) that contains leading or trail mmunozjr 3 1,695 Sep-05-2022, 11:56 AM
Last Post: Pedroski55
  "Vlookup" in pandas dataframe doug2019 3 1,796 May-09-2022, 01:35 PM
Last Post: snippsat
  Increase the speed of a python loop over a pandas dataframe mcva 0 1,290 Jan-21-2022, 06:24 PM
Last Post: mcva
  for loop in dataframe in pandas Paulman 7 2,673 Dec-02-2021, 12:15 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020