Re: Problem of writing long list of lists file to csv

2018-05-22 Thread subhabangalore
On Tuesday, May 22, 2018 at 3:55:58 PM UTC+5:30, Peter Otten wrote: > > > > lst2=lst1[:4] > > with open("my_csv.csv","wb") as f: > > writer = csv.writer(f) > > writer.writerows(lst2) > > > > Here it is writing only the first four lists. > > Hint: look at the first line

Re: Problem of writing long list of lists file to csv

2018-05-22 Thread Peter Otten
subhabangal...@gmail.com wrote: > lst2=lst1[:4] > with open("my_csv.csv","wb") as f: > writer = csv.writer(f) > writer.writerows(lst2) > > Here it is writing only the first four lists. Hint: look at the first line in the quotation above. -- https://mail.python.org/ma

Problem of writing long list of lists file to csv

2018-05-22 Thread subhabangalore
I have a list of lists (177 lists). I am trying to write them as file. I used the following code to write it in a .csv file. import csv def word2vec_preprocessing(): a1=open("/python27/EngText1.txt","r") list1=[] for line in a1: line1=line.lower().replace(".","").split()