pk4adi ====== .. py:module:: pk4adi .. autoapi-nested-parse:: @File : __init__.py @Contact : Jiang Feng(silencejiang@zju.edu.cn) @License : (C)Copyright 2004-2020, Zhejiang University Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pk4adi/pk/index /autoapi/pk4adi/pkc/index /autoapi/pk4adi/utils/index Attributes ---------- .. autoapisummary:: pk4adi.__version__ Functions --------- .. autoapisummary:: pk4adi.calculate_pk pk4adi.print_pk pk4adi.compare_pks pk4adi.print_pks pk4adi.print_table Package Contents ---------------- .. py:function:: calculate_pk(x_in, y_in, auto_print=True) Compute the pk value to Measure the Performance of Anesthetic Depth Indicators. print_pk() will be called before returning ans by default. :param x_in: Indicator. :type x_in: a list or a pandas series (pandas.Series()). :param y_in: State. :type y_in: a list or a pandas series (pandas.Series()). :param auto_print: Whether to print the ans before returning it or not. :type auto_print: bool. :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. :rtype: a dict. .. rubric:: References To be added. .. rubric:: Notes To be added. .. py:function:: print_pk(result, floatfmt='.3f', tablefmt='simple') Pretty display of a pk calculation result. :param result: Must be the return value of function calculate_pk(). :type result: a dict. :param floatfmt: Decimal number formatting. :type floatfmt: string. :param tablefmt: 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/ :type tablefmt: string. :rtype: Nothing will be returned. .. rubric:: Notes To be added. .. py:function:: compare_pks(pk1, pk2, auto_print=True) 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. :param pk1: The output of the function calculate_pk(). :type pk1: a dict. :param pk2: The output of the function calculate_pk(). :type pk2: a dict. :param auto_print: Whether to print the ans before returning it or not. :type auto_print: bool. :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. :rtype: a dict. .. rubric:: References To be added. .. rubric:: Notes To be added. .. py:function:: print_pks(result, floatfmt='.3f', tablefmt='simple') Pretty display of two pk calculation result comparison. :param result: Must be the return value of function compare_pks(). :type result: a dict. :param floatfmt: Decimal number formatting. :type floatfmt: string. :param tablefmt: 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/ :type tablefmt: string. :rtype: Nothing will be returned. .. rubric:: Notes To be added. .. py:function:: print_table(df, floatfmt='.3f', tablefmt='simple') Pretty display of table. :param df: Dataframe to print. :type df: a pandas.DataFrame. :param floatfmt: Decimal number formatting. :type floatfmt: string. :param tablefmt: 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/. :type tablefmt: string. :rtype: Nothing will be returned. .. rubric:: Notes To be added. .. py:data:: __version__ :value: '0.1.5'