fishtable_to_pandas#

cosmicjellyfish.analysis.fishconsumer.fishtable_to_pandas(paramstab, fishAnalysis, default_titles=['Relative 1sigma errors: ', 'Absolute 1sigma errors: '], title='', set_titles=False, apply_formats=False, filter_names=None, return_data_bar=False)[source]#

Converts a fisher matrix table to pandas DataFrames. This function takes a list of parameters and a FisherAnalysis object, and returns two pandas DataFrames: one for relative errors (as percentages) and one for absolute errors. It can also return data for bar plots.

Parameters:
  • paramstab (list) – List of parameter names to include in the table.

  • fishAnalysis (FisherAnalysis) – The FisherAnalysis object containing the fisher matrices.

  • default_titles (list, optional) – Default titles for the tables. Default is [“Relative 1sigma errors: “, “Absolute 1sigma errors: “].

  • title (str, optional) – Additional title to append to the default titles. Default is “”.

  • set_titles (bool, optional) – If True, set captions for the DataFrames. Default is False.

  • apply_formats (list or False, optional) – If provided, should be a list of two format strings to apply to the relative and absolute DataFrames. Default is False.

  • filter_names (list or None, optional) – List of fisher matrix names to filter when returning bar plot data. Default is None.

  • return_data_bar (bool, optional) – If True, return data formatted for bar plots instead of DataFrames. Default is False.

Returns:

If return_data_bar is False, returns a tuple of two pandas DataFrames (fish_df, fish_df_abs). If return_data_bar is True, returns a dictionary with keys as formatted fisher names and values as relative errors.

Return type:

tuple or dict