-1
我有一個DF如果「道」在A列中,添加一個「字」,以一個空列「B」
Weather_opinion:
"the weather is cold"
"it's quite sunny today"
"it's raining"
"today the climate seems to be pleasant"
"I feel dizzy today"
和一個列表:
list_tags = ["cold", "sunny" "raining" "pleasant", "hot", "dry"]
所以,如果一個標籤出現在DF一排,我想補充另一列,與標籤。如果DF中不存在任何單詞,則添加一些通用標籤。
因此,新的輸出將
Weather_opinion〜標籤:
"the weather is cold" ~ "cold"
"it's quite sunny today" ~ "sunny"
"it's raining" ~ "raining"
"today the climate seems to be pleasant" "pleasant"
"I feel dizzy today" ~ "others"
如果超過一個字是什麼禮物? –
和'df'是一個列表,元組,字典,文件..? –