Python Error Numpy Ndarray Object Is Possibly Null Typescript