I have a Pandas Series of lists of strings:
0 [slim, waist, man]
1 [slim, waistline]
2
You can use the list concatenation operator like below -
lst1 = ['hello','world']
lst2 = ['bye','world']
newlst = lst1 + lst2
print(newlst)
>> ['hello','world','bye','world']
Or you can use list.extend()
function as below -
lst1 = ['hello','world']
lst2 = ['bye','world']
lst1.extend(lst2)
print(lst1)
>> ['hello', 'world', 'bye', 'world']
Benefits of using extend
function is that it can work on multiple types, where as concatenation
operator will only work if both LHS and RHS are lists.
Other examples of extend
function -
lst1.extend(('Bye','Bye'))
>> ['hello', 'world', 'Bye', 'Bye']