tga_data_analysis.measure

class tga_data_analysis.measure.Measure(name=None)[source]

Bases: object

A class to handle and analyze a series of measurements or data points. It provides functionalities to add new data, compute averages, and calculate standard deviations, supporting the analysis of replicated measurement data.

Initialize a Measure object to store and analyze data.

Parameters:

name (str, optional) – An optional name for the Measure object, used for identification and reference in analyses.

add(replicate, value)[source]

Add a new data point or series of data points to the Measure object.

Parameters:
  • replicate (int) – The identifier for the replicate to which the data belongs.

  • value (np.ndarray | pd.Series | float | int) – The data point(s) to be added. Can be a single value or a series of values.

Return type:

None

ave()[source]

Calculate and return the average of the data points across all replicates.

Returns:

The average values for the data points.

Return type:

np.ndarray

np_ddof: int = 0
classmethod set_std_type(new_std_type)[source]

Set the standard deviation type for all instances of Measure.

This class method configures whether the standard deviation calculation should be performed as a sample standard deviation or a population standard deviation.

Parameters:

new_std_type (Literal["population", "sample"]) – The type of standard deviation to use (‘population’ or ‘sample’).

std()[source]

Calculate and return the standard deviation of the data points across all replicates.

Returns:

The standard deviation of the data points.

Return type:

np.ndarray

std_type: Literal['population', 'sample'] = 'population'
stk(replicate=None)[source]

Retrieve the data points for a specific replicate or all data if no replicate is specified.

Parameters:

replicate (int, optional) – The identifier for the replicate whose data is to be retrieved. If None, data for all replicates is returned.

Returns:

The data points for the specified replicate or all data.

Return type:

np.ndarray | float