toString Método (Python)

Este método se utiliza para obtener una representación de serie de un objeto CellText.String o CellText.Number . Los valores obtenidos de este método se pueden utilizar en expresiones de serie. Puede llamar a este método en un objeto CellText.String o CellText.Number .

Ejemplo

from spss import CellText
table = spss.BasePivotTable("Table Title",
                            "OMS table subtype")

table.Append(spss.Dimension.Place.row,"row dimension")
table.Append(spss.Dimension.Place.column,"column dimension")

row_cat1 = CellText.String("first row")
row_cat2 = CellText.String("second row")
col_cat1 = CellText.String("first column")
col_cat2 = CellText.String("second column")

table[(row_cat1,col_cat1)] = CellText.String("abc")
cellValue = table[(row_cat1,col_cat1)].toString()
table[(row_cat2,col_cat2)] = CellText.String(cellValue + "d")
  • table[(row_cat1,col_cat1)].toString() devuelve una representación en forma de cadena del objeto CellText (recuerde que las celdas de la tabla se almacenan como objetos CellText ) para la celda con valores de categoría ("first row","first column").