reV.losses.utils.month_index

month_index(month_name)[source]

Convert a month name (as string) to an index (0-11) of the month.

Parameters:

month_name (str) – Name of month to corresponding to desired index. This input must match the formatting in calendar.month_name (upper case, no extra whitespace).

Returns:

int – The 0-index of the month, or -1 if the month name is not understood.

Examples

>>> month_index("June")
5
>>> month_index("July")
6
>>> month_index("Jun")
-1
>>> month_index("july")
-1