graphbin.utils.math module¶
Utility functions for math operations.
- graphbin.utils.math.get_std_devs_and_means(*arrays)[source]¶
Get the standard deviations and means of multiple numpy arrays. The values are log-transformed first.
- Parameters:
arrays (
List
[ndarray
[Any
,dtype
[Union
[int64
,float64
]]]]) – A list of numpy arrays.- Return type:
Tuple
[ndarray
[Any
,dtype
[float64
]],ndarray
[Any
,dtype
[float64
]]]- Returns:
An np.array of the resulting standard deviations, and an np.array of the resulting means.
- graphbin.utils.math.log_std(var)[source]¶
Get log-transformed standardized values of a list of variables.
- Parameters:
var (
ndarray
[Any
,dtype
[Union
[int64
,float64
]]]) – An np.array of variables to be transformed.- Return type:
ndarray
[Any
,dtype
[float64
]]- Returns:
An np.array of the transformed variables.
- graphbin.utils.math.log_std_all(variables, sds, means)[source]¶
Get the log-transformed standardized values for all variables.
- Parameters:
variables (
ndarray
[Any
,dtype
[float64
]]) – An np.array of variables to be transformed.sds (
ndarray
[Any
,dtype
[float64
]]) – An np.array of standard deviations.means (
ndarray
[Any
,dtype
[float64
]]) – An np.array of means.
- Return type:
ndarray
[Any
,dtype
[float64
]]- Returns:
An np.array of transformed variables.