pk4adi.pk ========= .. py:module:: pk4adi.pk .. autoapi-nested-parse:: @File : pk.py @Contact : Jiang Feng(silencejiang@zju.edu.cn) @License : (C)Copyright 2004-2020, Zhejiang University Functions --------- .. autoapisummary:: pk4adi.pk.calculate_pk pk4adi.pk.print_pk Module 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.