huracanpy.utils.category.categorize#
- huracanpy.utils.category.categorize(variable, bins=None, labels=None, convention=None, variable_units=None)[source]#
Calculate a generic category from a variable and a set of thresholds
- Parameters:
variable (array_like) – The variable to be categorized
bins (array_like) – Bounds for the categories, including upper and lower bounds
labels (array_like) – Name of the categories. len(labels) = len(bins) -1
convention (str) –
Klotzbach
Simpson
Saffir-Simpson
variable_units (str) – The units of the input variable. Only needs to be specified if they are different to the units of the bins and they are not already in the attributes of the variable.
- Returns:
The category label for each value in the input variable
- Return type: