Skip to content

Commit

Permalink
Update pretty.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Aug 4, 2023
1 parent 9a5708c commit c64caf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion river/utils/pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def print_table(
raise ValueError("all the columns must be of the same length")

# Determine the width of each column based on the maximum length of it's elements
col_widths = [max(*map(len, col), len(header)) for header, col in zip(headers, columns)]
col_widths = [max(len(col) if col else 0, len(header)) for header, col in zip(headers, columns)]

# Make a template to print out rows one by one
row_format = " ".join(["{:" + str(width + 2) + "s}" for width in col_widths])
Expand Down

0 comments on commit c64caf5

Please sign in to comment.