Table of Contents¶
t3co/utils/print_class_objects¶
obj_to_string¶
Converts an object or list of objects to a formatted string representation.
Arguments:
obj
Union[object, List[object]] - The object or list of objects to convert.extra
str, optional - Indentation string for nested objects. Defaults to " ".
Returns:
str
- Formatted string representation of the object.
handle_nan¶
Replaces NaN values in an object with None.
Arguments:
obj
Union[float, dict, list] - The object to process.
Returns:
Union[None, dict, list, float]: The processed object with NaN values replaced by None.
custom_default¶
Custom default function for JSON serialization.
Arguments:
obj
object - The object to serialize.
Returns:
Union[None, dict, str]: The serialized object.
to_flat_dict¶
Python
def to_flat_dict(obj: object,
include_predix: bool = True,
prefix: str = "",
delimiter: str = "_") -> dict
Flattens a nested object into a dictionary.
Arguments:
obj
object - The object to flatten.include_predix
bool, optional - Whether to include the prefix in the keys. Defaults to True.prefix
str, optional - The prefix for the keys. Defaults to "".delimiter
str, optional - The delimiter for the keys. Defaults to "_".
Returns:
dict
- The flattened dictionary.
remove_df_attrs¶
Removes DataFrame attributes from an object.
Arguments:
obj
object - The object to process.