I am new to Python. How can I write to a CSV file while iterating through a DataFrame?
readCSV1 = pd.read_csv(r'ProductDetails1.csv')
df1 = DataFrame(readCSV1)
for index, row in df1.iterrows():
print(index, row['SKU'], row['SKU'],row['Title'],row['Cost'],row['Weight 
    Value'],row['Weight Unit']...............)
I am iterating through a large csv file that contains many columns, however I would like to be able to limit the columns in the final csv file as well as put in other arguments. The print output to the console is correct, however I am having trouble figuring out how best to print this to a new csv file as I will be performing many other functions and do not want to simply edit the dataframe itself.



pd.DataFrame.to_csv()all at once: pandas.pydata.org/pandas-docs/stable/generated/…