Skip to content

Commit dd769d9

Browse files
committed
Remove duplicate columns in -v output
1 parent ed75ced commit dd769d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/magicformulabr/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,9 @@ def display_results(df, args):
362362
else:
363363
keep_cols = df_display.columns.tolist()
364364

365+
# Remove duplicates preserving order
366+
keep_cols = list(dict.fromkeys(keep_cols))
367+
365368
df_display.reset_index(inplace=True, names="Ticker")
366369
df_display.index = df_display.index + 1
367370
print(df_display.head(args.top).to_string(columns=["Ticker"] + keep_cols))

0 commit comments

Comments
 (0)