def first_index_et(data_list, value):
    '''same as data_list.index(value), except with exception handling
    Also finds 'nan' values'''
    try:
        if type(value) == float and math.isnan(value):
            return next(data[0] for data in enumerate(data_list)
              if (type(data[1]) in (float, np.float64, np.float32, np.float96)
              and math.isnan(data[1])))
        else:
            return next(data[0] for data in enumerate(data_list) if data[1] == value)
    except (ValueError, StopIteration): return - 1
same as data_list.index(value), except with exception handling
    Also finds 'nan' values
recipes/Python/578071_Fast_Indexing_functions_greater_thless_thequal/recipe-578071.py