def first_non_zero(arr):
    """
    Return the index of the first element that is not zero, None, nan, or False
    (basically, what ever makes "if element" True)
    The other way to do this would be where(arr)[0][0], but in some cases (large array, few non zeros))
    this function is quicker.
    Note: If no element is "non zero", the function returns None
    """
    for i, a in enumerate(arr):
        if a:
            return i
    return None