Statistics#
Functions for calculating the population statistics of a dataset output by FlickerPrint.
- flickerprint.analysis.statistics.create_stats_csv(stats: dict[DataFrame], output_dir: str = './statistics.csv') None #
Creates a CSV file from the statistics dictionary produced by
population_statistics()
.- Parameters:
stats (dict[pd.DataFrame]) – A dictionary of statistics dataframes. Typically created by the population_statistics function.
output_dir (str) – The output directory for the CSV file. Can also be an
IOBuffer
, as appropriate.
- flickerprint.analysis.statistics.population_statistics(granule_data: DataFrame, _gui: bool = False)#
Calculates the population statistics for a given dataset.
- Parameters:
granule_data (pd.DataFrame) – The data to calculate the statistics for. This should be a DataFrame containing the aggregate data output by FlickerPrint.
_gui (bool) – If True, the outputs are rounded and converted to strings so that they can be displayed correctly in the GUI.
- Returns:
A dictionary of DataFrames, each containing the statistics for a given experiment. The keys are the experiment names.
- Return type:
dict[pd.DataFrame]