我在pandas DataFrame中有两列:authors和name.我想创建第三列:单元格的值是True相应的行name包含在相应的行中authors,False否则.
authors
name
True
False
所以结果如下图所示.
我已经试过.str.contains(),.str.extract(),.str.find(),.where(),等,但Python中返回一个错误:"系列"的对象是可变的,因此它们不能被散列.有谁知道如何在Python中创建第三列?
.str.contains()
.str.extract()
.str.find()
.where()
python dataframe pandas
dataframe ×1
pandas ×1
python ×1