pk4adi

@File : __init__.py @Contact : Jiang Feng(silencejiang@zju.edu.cn) @License : (C)Copyright 2004-2020, Zhejiang University

Submodules

Attributes

Functions

calculate_pk(x_in, y_in[, auto_print])

Compute the pk value to Measure the Performance of Anesthetic Depth Indicators.

print_pk(result[, floatfmt, tablefmt])

Pretty display of a pk calculation result.

compare_pks(pk1, pk2[, auto_print])

Compare two answers of the pk values, which is the output of the function calculate_pk().

print_pks(result[, floatfmt, tablefmt])

Pretty display of two pk calculation result comparison.

print_table(df[, floatfmt, tablefmt])

Pretty display of table.

Package Contents

calculate_pk(x_in, y_in, auto_print=True)[source]
Compute the pk value to Measure the Performance of Anesthetic Depth Indicators.

print_pk() will be called before returning ans by default.

Parameters:
  • x_in (a list or a pandas series (pandas.Series()).) – Indicator.

  • y_in (a list or a pandas series (pandas.Series()).) – State.

  • auto_print (bool.) – Whether to print the ans before returning it or not.

Returns:

ans – A dict containing all the matrix and variables involved. Use the script ‘print(ans.keys())’ to get the details. The most important variables have already been printed.

Return type:

a dict.

References

To be added.

Notes

To be added.

print_pk(result, floatfmt='.3f', tablefmt='simple')[source]

Pretty display of a pk calculation result.

Parameters:
  • result (a dict.) – Must be the return value of function calculate_pk().

  • floatfmt (string.) – Decimal number formatting.

  • tablefmt (string.) – Table format (e.g. ‘simple’, ‘plain’, ‘html’, ‘latex’, ‘grid’, ‘rst’). For a full list of available formats, please refer to https://pypi.org/project/tabulate/

Return type:

Nothing will be returned.

Notes

To be added.

compare_pks(pk1, pk2, auto_print=True)[source]
Compare two answers of the pk values, which is the output of the function calculate_pk().

print_pks() will be called before returning ans by default.

Parameters:
  • pk1 (a dict.) – The output of the function calculate_pk().

  • pk2 (a dict.) – The output of the function calculate_pk().

  • auto_print (bool.) – Whether to print the ans before returning it or not.

Returns:

ans – A dict containing all the matrix and variables involved. Use the script ‘print(ans.keys())’ to get the details. Specially, the P values and the interal it located will be calculated using the scipy.stats packages. The most important variables have already been printed.

Return type:

a dict.

References

To be added.

Notes

To be added.

print_pks(result, floatfmt='.3f', tablefmt='simple')[source]

Pretty display of two pk calculation result comparison.

Parameters:
  • result (a dict.) – Must be the return value of function compare_pks().

  • floatfmt (string.) – Decimal number formatting.

  • tablefmt (string.) – Table format (e.g. ‘simple’, ‘plain’, ‘html’, ‘latex’, ‘grid’, ‘rst’). For a full list of available formats, please refer to https://pypi.org/project/tabulate/

Return type:

Nothing will be returned.

Notes

To be added.

print_table(df, floatfmt='.3f', tablefmt='simple')[source]

Pretty display of table.

Parameters:
  • df (a pandas.DataFrame.) – Dataframe to print.

  • floatfmt (string.) – Decimal number formatting.

  • tablefmt (string.) – Table format (e.g. ‘simple’, ‘plain’, ‘html’, ‘latex’, ‘grid’, ‘rst’). For a full list of available formats, please refer to https://pypi.org/project/tabulate/.

Return type:

Nothing will be returned.

Notes

To be added.

__version__ = '0.1.5'