Reputation: 77
I am imported CSV and the way the documents told me to do it resulted in failures.
Here is the code that is having the problems.
outfile = open("D:/stock_information/processed data/standard_deviant.csv", "w")
write_outfile = csv.writer(outfile)
for i in range(len(all_standard_deviant_info)):
outfile.writerows(all_standard_deviant_info[i][0])
outfile.writerows(all_standard_deviant_info[i][1])
Does anyone know why it's saying .writerows doesn't exist?
Upvotes: 6
Views: 14007
Reputation: 174756
You need to use,
write_outfile.writerows(all_standard_deviant_info[i][0])
Because outfile
is just a file object not a csv.writer
's object.
Upvotes: 8