I have this data in a .csv file and I want to remove 1st 4 rows from my csv file and just save rest of the file in my dataset using python!
import csv
with open('dataset1.csv','rb') as inp, open('dataset-1copy.csv','wb') as out:
i = 0
for line in inp:
if i >= 4:
print(line)
csv.writer(out).writerows()
i+= 1
using this code and getting error:
Error Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_14912/736960677.py in <module>
4 if i >= 5:
5 print(line)
----> 6 csv.writer(out).writerows(line)
7 i+= 1
8
Error: iterable expected, not int