假设我有一个名为 BRANDS 的列表,其中包含品牌名称:
BRANDS = ['Samsung', 'Apple', 'Nike', .....]
Dataframe A的结构如下:
row item_title brand_name
1 | Apple 6S | Apple
2 | Nike BB Shoes | na <-- need to fill with Nike
3 | Samsung TV | na <--need fill with Samsung
4 | Used bike | na <--No need to do anything because there is no brand_name in the title
....
我想用Nike填充第2行的brand_name列,Samsung填充第3行,因为它们为空,并且item_title包含在品牌列表BRANDS中能找到的关键字。我该怎么做?