Login
Back to bricks list
Introduction Version

NumericHelper

Helper to manipulate numerics

Functions

IS_FLOAT - @staticmethod

Check if value is float

Parameters:
NameTypeDefault valueDescription
valueAny
Return type:
bool
IS_INT - @staticmethod

Check if value is int

Parameters:
NameTypeDefault valueDescription
valueAny
Return type:
bool
LIST_2D_TO_FLOAT - @staticmethod

Convert a list of list of any to list of list of float. Replace infinity by default_value

                if True they are removed
Parameters:
NameTypeDefault valueDescription
list_2dList _description_ [list[any]]
remove_nonebool False If false, the non converted element are keep as none, list[any]
default_valueAny
Return type:
List
LIST_TO_FLOAT - @staticmethod

Convert a list of any to list of float. Replace infinity by default_value

                if True they are removed
Parameters:
NameTypeDefault valueDescription
list_List _description_ [any]
remove_nonebool False If false, the non converted element are keep as none, list[any]
default_valueAny
Return type:
List
LIST_TO_INT - @staticmethod

Convert a list of any to list of int. if True they are removed

Parameters:
NameTypeDefault valueDescription
list_List _description_ [any]
remove_nonebool False If false, the non converted element are keep as none, list[any]
Return type:
List
TO_FLOAT - @staticmethod

Convert any to float. If NaN, inf or not convertible to float, returns default_value

Parameters:
NameTypeDefault valueDescription
valueAny
default_valueAny
Return type:
Optional
TO_INT - @staticmethod

Convert any to int. If not convertible to int or NaN, returns None

Parameters:
NameTypeDefault valueDescription
valueAny
default_valueAny
Return type:
Optional