')[0] if '

问题描述 投票:0回答:1
master_frame_venture['Revised Category List'] = master_frame_venture['category_list'].apply(lambda x: str(x).split('|')[0] if '|' in str(x))

它给出的错误是 "无效语法",正确的语法是什么?

python-3.x pandas
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.