individual string list to list of string

Viewed 32

I have a text output that has individual list,this format ['a']['b']['c'] and so on and I want to convert this list into a string put in a list, in this format ['a','b','c'].The end goal is to create a new column and append this list of strings to rows in a column.

1 Answers

You can join the lists like this:

list_item = [['a'], ['b'], ['c']]
result = []
for i in list_item:
    result.append(i[0])

print(result)

The result will be this:

['a', 'b', 'c']
Related