我正在使用IronPython中的以下代码在Spotfire中创建摘要表:
def makeStatisticsVisTable(page, dt):
table = page.Visuals.AddNew[TablePlot]()
table.AutoConfigure()
table.Data.DataTableReference = dt
table.Title = "Statistics"
sumTable = page.Visuals.AddNew[SummaryTable]()
sumTable.AutoConfigure()
sumTable.Data.DataTableReference = sampleTable
sumTable.Title = "Summary"
sumTable.Columns.Clear()
for col in dt.Columns:
table.TableColumns.Add(dt.Columns.Item[col.Name])
for col in SampleColumns:
sumTable.Columns.AddNew(col)
sumTable.Aggregations.Clear()
sumTable.Aggregations.AddNew("Count")
sumTable.Aggregations.AddNew("Max")
sumTable.Aggregations.AddNew("Min")
sumTable.Aggregations.AddNew("Avg")
sumTable.Aggregations.AddNew("StdDev")
sumTable.Aggregations.AddNew("StdErr")
return
我想使用自定义表达式包括更多的聚合,例如:
expr = "Max([Col1]) - Min([Col2])"
这可能吗?