Hope you all are doing great. I have got a problem while writing some code. I have a CSV file with 2 columns. One is a mark (number between 1 and 5) and the other one contains the review that corresponds to it. My actual goal is to make a new CSV file, but modifying the note, which should be a 1 if the mark is >= 3 else 0. I'm actually stucked on this :
train_csv_path = "hotel_reviews.csv"
with open('new_hotel_reviews.csv', 'w') as newfile:
writer = csv.writer(newfile)
with open(train_csv_path, 'r') as f:
reader = csv.reader(f)
for row in reader:
writer.writerow(row)
It writes in the file, but I have a blank row between each row. Also I don't know how I'll access the first column to change it to 1 or 0.
The CSV file is semi-colon delimited.