Numpy Array Isinstance Nonetype Error