function:
Код: Выделить всё
def split_and_order(string_samp):
return string_samp.split(",")
Код: Выделить всё
sorted_list = [split_and_order(j) for j in michelin["FacilitiesAndServices"]]
Код: Выделить всё
[['Air conditioning',
'Car park',
'Interesting wine list',
'Restaurant offering vegetarian menus',
'Wheelchair access'],
['Air conditioning',
'Car park',
'Interesting wine list',
'Restaurant offering vegetarian menus',
'Wheelchair access'],
['Air conditioning',
'Car park',
'Interesting wine list',
'Restaurant offering vegetarian menus',
'Wheelchair access'],
['Air conditioning',
'Car park',
'Interesting wine list',
'Restaurant offering vegetarian menus',
'Wheelchair access'],
['Air conditioning',
'Car park',
'Interesting wine list',
'Restaurant offering vegetarian menus',
'Wheelchair access']]
Код: Выделить всё
0 Air conditioning,Wheelchair access
1 Air conditioning,Car park,Wheelchair access
2 Air conditioning,Car park,Wheelchair access
3 Air conditioning,Car park,Garden or park,Inter...
4 Air conditioning,Interesting wine list,Wheelch...
5 Air conditioning,Interesting wine list,Restaur...
Name: FacilitiesAndServices, dtype: object
Подробнее здесь: https://stackoverflow.com/questions/790 ... umn-pandas