Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to view all columns in Pandas Data frame [duplicate]

Tags:

I am trying to output all columns of a data frame .

Here is the code below:

df_advertiser_activity_part_qa  = df_advertiser_activity_part.loc[(df_advertiser_activity_part['advertiser_id']==209988 )] df_advertiser_activity_part_qa.sort(columns ='date_each_day_et')  df_advertiser_activity_part_qa 

when I output the data frame not all columns gets displayed . This has 21 columns and between some columns there is just there dots "..." I am using ipython notebook . Is there a way by which this can be ignored.

like image 686
sushmit Avatar asked Feb 27 '15 23:02

sushmit


1 Answers

try:

pandas.set_option('display.max_columns', None) 

but depending how many columns you have this is not a good idea. The data is being abbreviated because you have too many columns to fit practically on the screen.

You might be better off saving to a .csv to inspect the data.

df.to_csv('myfile.csv') 

or if you have lots of rows:

df.head(1000).to_csv('myfile.csv') 
like image 167
JAB Avatar answered Oct 21 '22 16:10

JAB