So I have an existing csv file with multiple columns. I am trying to copy each column (one by one) and paste it into a new csv file. The name of the new csv file will be the header of the column.
I am trying to tweak a code that picks specific columns but no luck so far for multiple columns.
import pandas as pd
cols = ['1']
my_file = r"D:/Excel/new_csv_3.csv"
pd.read_csv(my_file, usecols=cols).to_csv(r"D:/Excel/new1.csv",
index=False)