GetDefaultFormatSpec Method (Python)

.GetDefaultFormatSpec(). Returns the default format for CellText.Number objects. The returned value is a list with two elements. The first element is the integer code associated with the format. Codes and associated formats are listed in Table 1. For formats with codes 5 (Mean), 12 (Variable), 13 (StdDev), 14 (Difference), and 15 (Sum), the second element of the returned value is the index of the variable in the active dataset whose format is used to determine details of the resulting format. For all other formats, the second element is the Python data type None. You can set the default format with the SetDefaultFormatSpec method.
  • Instances of the BasePivotTable class have an implicit default format of GeneralStat.

Example

table = spss.BasePivotTable("Table Title",
                            "OMS table subtype")
print("Default format: ", table.GetDefaultFormatSpec())