Код: Выделить всё
def find_and_suck_hashtag_vacuum(string, keyword, output):
return [output if keyword in string else np.nan]
Код: Выделить всё
string_samp = ['Air conditioning,Car park,Interesting wine list,Restaurant offering vegetarian menus,Wheelchair access']
output = find_and_suck_hashtag_vacuum(string_samp, "Air", "AC")
Подробнее здесь: https://stackoverflow.com/questions/790 ... -in-string
Мобильная версия