I am trying to read from csv file that only has one column. I need to combine all of the string into one for instance Row[1]=="Hallo." and Row[2]=="Goodbye." into string=="Hallo. Goodbye.".
import csv
data=None
with open('reviews.csv',encoding='utf-8') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_reader:
data2=(row[0])
print(f'\n{data}.')
line_count += 1
data+=data2
print(f'Processed {line_count} lines.')
Current error I'm getting is:
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
I have searched and read few posts but cannot seem to understand it.
datafrom None type to an empty string:data=''