Problem of writing long list of lists file to csv
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.
for line in a1:
with open("my_csv.csv","wb") as f:
writer = csv.writer(f)
Here it is writing only the first four lists.
I have searched for help and it seems it is an issue and
without much of fix.
Please see the following link.
I have now tried pandas and json as follows, but same result.
my_df = pd.DataFrame(lst2)
my_df.to_csv('sbb_csv.csv', index=False, header=False)
with open('sbb1.json', 'w') as F:
# Use the json dumps method to write the list to disk
with open('sbb1.json', 'r') as F:
B = json.loads(F.read())
I am using Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)] on win32
Please suggest what error I may be doing?
Thanking in advance.