0

How could I get the values for all columns during iteration with iterrows? For instance, if you have this small amount of data, you would get all columns:

import pandas as pd

df = pd.DataFrame({'c1': [10], 'c2': [100]})

for index, row in df.iterrows():
    print(row)

However, if the columns in the data frame grow to greater than 80 columns, I get a condensed result like the following:

index                                        0
census_year                               2021
census_division_id                           1
census_division_name         Kootenay Boundary
othr_non_aboriginal                       None
                                   ...        
feature_area_sqm                          None
feature_length_m                        493475
census_division_type_code                 None
ensus_division_type_desc                  None
pop_total_2021                            None
Name: 0, Length: 133, dtype: object

How could I get all columns with its corresponding values instead of three dots?

Thanks

John Barton
  • 1,581
  • 4
  • 25
  • 51
  • 1
    Try something like `pd.options.display.max_rows = 999`. I know this works for DataFrames, but not sure for printing rows themselves. – Michael Cao Feb 23 '23 at 20:53

0 Answers0