美文网首页
2018-12-14

2018-12-14

作者: 牧野之月 | 来源:发表于2018-12-15 03:32 被阅读13次

 ` # to determine each bookings' source

df2.loc[:,'source'] = 'yyy'

source = ["instagram", "google","yelp","facebook","apple","salon","pinterest","event","twitter","website","friend"]

for item in source:

    source_a = df[df["Source"] == item]

    tmp = set(source_a["full name"])

    df2["source"] = df2.apply(lambda x: item if x["Full Name"] in tmp else x["source"],axis=1) ` 

相关文章

网友评论

      本文标题:2018-12-14

      本文链接:https://www.haomeiwen.com/subject/lukohqtx.html