ijazz.categorize ================ .. py:module:: ijazz.categorize Functions --------- .. autoapisummary:: ijazz.categorize.categorize Module Contents --------------- .. py:function:: categorize(df: pandas.DataFrame, category_dict: dict, cut='', prefix='cat', var_prefixes=None, var_suffixes=['1', '2']) -> numpy.ndarray Create the categories for both lepton based on a dataframe containing the categorisation variable per lepton under the form var1, var2 for lepton 1 and lepton 2, the name of the variables to categorize upon are specified in the the category dictionnary along with the corresponding bining. :param df: input dataframe containing the variable to categorize :type df: pd.DataFrame :param category_dict: dictionary for categorisation, e.g. {'pt': [25, 50, 100], 'abs_eta': [0, 1, 2]} :type category_dict: dict :param cut: cut to be use if df.eval(cut) to apply a selection. Defaults to "". :type cut: str, optional :param prefix: prefix used for the categorisation. Defaults to 'cat'. :type prefix: str, optional :returns: array with the category numbers that have been created :rtype: np.ndarray