#Create a pivot table table = spss.BasePivotTable("Group Means", "OMS table subtype") table.Append(spss.Dimension.Place.row, spss.GetVariableLabel(groupIndex)) table.Append(spss.Dimension.Place.column, spss.GetVariableLabel(sumIndex)) category2 = spss.CellText.String("Mean") for cat in sorted(Counts): category1 = spss.CellText.Number(cat) table[(category1,category2)] = \ spss.CellText.Number(Totals[cat]/Counts[cat])
Source: SPSS online help.