条件格式Python

时间:2018-09-01 18:07:50

标签: python

如何解决该错误? 我在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

1 个答案:

答案 0 :(得分:0)

从右侧卸下支架

conditions  = [ table['Lump'] >= 5000 , table['SIP'] >= 3000 , (table['Lump']>= 5000 & table['SIP'] >= 3000),table['SIP'] < 3000]