How do I check if a file exists or not, without using the try statement?
If you imported NumPy already for other purposes then there is no need to import other libraries like pathlib, os, paths, etc.
pathlib
os
paths
import numpy as np np.DataSource().exists("path/to/your/file")
This will return true or false based on its existence.