Dash DataTable 前端过滤器中的复合运算符
Compound operators in Dash DataTable front-end filter
是否可以在前端通过复合运算符过滤 Dash DataTable (dt) 列?例如我有一列 'NumDays' 并按 > 6
筛选查找 'NumDays' 大于 6 的记录。
但是如何在前端过滤((NumDays > 6) & (NumDays <= 15?))
?是否有查询语法的帮助页面?官方过滤 page 似乎也有简单的运算符作为过滤器。谢谢
&&
似乎对我有用。我正在使用 Python 3.6.1。参见示例代码:
style_data_conditional=[
{
'if': {
'column_id': 'avf',
'filter_query': '{avf} < 10000'
},
'backgroundColor': '#ff6961', # red
},
{
'if': {
'column_id': 'avf',
'filter_query': '({avf} < 12000) && ({avf} >= 10000)'
},
'backgroundColor': 'yellow', # yellow
},
{
'if': {
'column_id': 'avf',
'filter_query': '{avf} >= 12000'
},
'backgroundColor': '#7CFC00', # green
},
]
是否可以在前端通过复合运算符过滤 Dash DataTable (dt) 列?例如我有一列 'NumDays' 并按 > 6
筛选查找 'NumDays' 大于 6 的记录。
但是如何在前端过滤((NumDays > 6) & (NumDays <= 15?))
?是否有查询语法的帮助页面?官方过滤 page 似乎也有简单的运算符作为过滤器。谢谢
&&
似乎对我有用。我正在使用 Python 3.6.1。参见示例代码:
style_data_conditional=[
{
'if': {
'column_id': 'avf',
'filter_query': '{avf} < 10000'
},
'backgroundColor': '#ff6961', # red
},
{
'if': {
'column_id': 'avf',
'filter_query': '({avf} < 12000) && ({avf} >= 10000)'
},
'backgroundColor': 'yellow', # yellow
},
{
'if': {
'column_id': 'avf',
'filter_query': '{avf} >= 12000'
},
'backgroundColor': '#7CFC00', # green
},
]