我有一个如下的 pandas 数据框:
coname1 coname2
Apple [Microsoft, Apple, Google]
Yahoo [American Express, Jet Blue]
Gap Inc [American Eagle, Walmart, Gap Inc]
我希望创建一个新列,用于标记coname1中的字符串是否包含在conames中。因此,从上面的示例中,数据框现在将是:
coname1 coname2 isin
Apple [Microsoft, Apple, Google] True
Yahoo [American Express, Jet Blue] False
Gap Inc [American Eagle, Walmart, Gap Inc] True