4.7.5.2.1.1.2. statsmodels.tools.dump2module.HoldIt.save

HoldIt.save(what=None, filename=None, header=True, useinstance=True, comment=None, print_options=None)[source]

write attributes of this instance to python module given by filename

Parameters:

what : list or None

list of attributes that are added to the module. If None (default) then all attributes in __dict__ that do not start with an underline will be saved.

filename : string

specifies filename with path. If the file does not exist, it will be created. If the file is already exists, then the new data will be appended to the file.

header : bool

If true, then the imports of the module and the class definition are written before writing the data.

useinstance : bool

If true, then the data in the module are attached to an instance of a holder class. If false, then each array will be saved as separate variable.

comment : string

If comment is not empty then this string will be attached as a description comment to the data instance in the saved module.

print_options : dict or None

The print_options for the numpy arrays will be updated with this. see notes

Notes

The content of an numpy array are written using repr, which can be controlled with the np.set_printoptions. The numpy default is updated with: precision=20, linewidth=100, nanstr=’nan’, infstr=’inf’

This should provide enough precision for double floating point numbers. If one array has more than 1000 elements, then threshold should be overwritten by the user, see keyword argument print_options.