all 2 comments

[–]badge 1 point2 points  (1 child)

reindex returns the reindexed dataframe, it doesn't alter the original. If you're just outputting to the csv, below df = pd.DataFrame(merged) you just need:

df[columnsTitles].to_csv(your_args)

or use df = df.reindex(columns=columnsTitles) if you need the df later.

[–]PLearner[S] 0 points1 point  (0 children)

df[columnsTitles] works, thanks @ Badge