cache Property (Python)

The cache property of a Dataset object specifies whether caching is used when cases in the associated dataset are read or modified. Caching typically improves performance when cases are modified in a random manner. It is not recommended when cases are read or modified sequentially.

  • The cache property is Boolean, where True specifies that caching is used. The default is False.
  • When cache=True, you cannot make the following changes: append or insert cases, add or delete variables, change the variable type.
  • The value of the cache property can be modified over the life of a Dataset object. Setting cache=False commits any changes that were specified while cache was set to True.
  • The cache property is available for release 22 Fix Pack 1 and higher.

Example

import spss
spss.StartDataStep()
datasetObj = spss.Dataset('data1')
datasetObj.cache = True
spss.EndDataStep()