如何解决该错误? 我在Python中使用条件格式。
我的代码:
conditions = [
table['Lump'] >= 5000 ,
table['SIP'] >= 3000 ,
(table['Lump'] >= 5000 & table['SIP'] >= 3000),
table['SIP'] < 3000]
]
choices = [ "Lump", 'SIP','Both','Low' ]
table['Status'] = np.select(conditions, choices, default=np.nan)
错误显示:
File "<ipython-input-501-03acb2a1fc51>", line 1
conditions = [ table['Lump'] >= 5000 , table['SIP'] >= 3000 ,
(table['Lump']>= 5000 & table['SIP'] >= 3000),table['SIP'] < 3000]
SyntaxError: invalid syntax
答案 0 :(得分:0)
从右侧卸下支架
conditions = [ table['Lump'] >= 5000 , table['SIP'] >= 3000 , (table['Lump']>= 5000 & table['SIP'] >= 3000),table['SIP'] < 3000]