df.apply(lambda x: [1 if 'apple' in i for i in x])语法错误的原因是少了 else语句语法正确的写法应该是:df.apply(lambda x: [1 if 'apple' in i else 0 for i in x])但是这样写也是不符合你的语意的可以参考上面答案或着如下[ 1 if 'apple' in i else 0 for i in df['lists'] ]
赞0踩0评论0
回答了问题2019-07-17
初学者安装LNMP,提示Failed to start php-fpm.service: Unit is not loaded properly