Initializing help system before first use

xpressinsight.AppBase.initialize_entities

Purpose

Initialize entities to their default values (empty string, 0, empty series or dataframe column, etc.). You can use arguments to specify the entities to be initialized; if no arguments are given, all the entities in the app will be initialized.

When initializing some columns of a data-frame, any other columns already in the data-frame will be retained, as will the data-frame index. The newly added columns will be filled in with the default value for the column entity.


Synopsis
xpressinsight.AppBase.initialize_entities(self, entities: Union[Iterable[str], Iterable[EntityBase]] = None, *, manage: Manage = None, entity_filter: Callable[[Entity], bool] = None, overwrite: bool = False) -> None
Arguments
entities 
The entities to be initialized. May be specified as a list of entity names or entity objects. If names are specified, columns can be identified using the pattern "<frame_name>.<col_name>" or by using their entity names (by default "<frame_name>_<col_name>"). If a DataFrame is specified, that is assumed to include all columns in the frame that have the requested manage attribute (if any were specified).
manage 
The manage-type of entities to be initialized.
entity_filter 
If specified, the given function will be called for each Entity and that entity will be initialized if the function returned True.
overwrite 
Flag indicating whether we should overwrite existing values. If not set to True and one of the selected entities has a value, a ValueError will be raised rather than overwriting the existing value.
Example
Demonstration of initializing all input entities in the model:
>>> import xpressinsight as xi
...
... @xi.AppConfig("My App")
... class InsightApp(xi.AppBase):
...     @xi.ExecModeLoad()
...     def load(self):
...         self.initialize_entities(manage=xi.Manage.INPUT)			
Demonstration of initializing named entities:
>>> import xpressinsight as xi
...
... @xi.AppConfig("My App")
... class InsightApp(xi.AppBase):
...     @xi.ExecModeLoad()
...     def load(self):
...         self.initialize_entities(['SalePrices', 'History'])			
Demonstration of initializing all progress entities in the model, overwriting existing values:
>>> import xpressinsight as xi
...
... @xi.AppConfig("My App")
... class InsightApp(xi.AppBase):
...     @xi.ExecModeLoad()
...     def load(self):
...         self.initialize_entities(entity_filter=lambda e: e.update_progress,
...                                  overwrite=True)			
Further information
The method initialize_entities is part of the class xpressinsight.AppBase.
Related topics

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.