Aspect-based-opinion-mining-NLP-with-Python- icon indicating copy to clipboard operation
Aspect-based-opinion-mining-NLP-with-Python- copied to clipboard

how to combine the lists of strings into one list as showed in result :)

Open zhangby2085 opened this issue 5 years ago • 2 comments

with open('reviewdatainonecomment.csv', 'r',encoding='utf-8') as f: reader = csv.reader(f) result = list(reader)

result = result[2]#if I use the example Employee_Perfomance_Data.csv, it not works well, we have to combine the lists of strings into one list, result result

zhangby2085 avatar Oct 23 '20 19:10 zhangby2085

Hi Zhangby,

Yes, we have to combine all the text into one list, and that's what is there in my file "reviewdatainonecomment.csv" which I made by combining all the text into one comment and then read that file. So please combine all the text into one from employee_performance_data.csv and then load it. you should be good to go.

Please let me know how it goes.

Best, Mit

mlp9 avatar Oct 23 '20 19:10 mlp9

Hi Mit,

A very big thank you for the information, can you share the code?

I have tried many times to set up an empty list and combine joinlist into the one as you did, and it doesn't work well.

import csv with open(r'C:\Users\Men\Documents\Downloads\App Review python\reviews.csv', 'r') as f:

 reader = csv.reader(f)
 newlist=[]
 for i in reader:
     newlist.append(i[1])
     print(newlist)

the printed results are different if:

 reader = csv.reader(f)
 for i in reader:
     print(i[1])

Have a great weekend, Zhangby

zhangby2085 avatar Oct 24 '20 17:10 zhangby2085