Quantcast
Viewing all articles
Browse latest Browse all 47

Answer by durjoy for How do I check whether a file exists without exceptions?

If you imported NumPy already for other purposes then there is no need to import other libraries like pathlib, os, paths, etc.

import numpy as npnp.DataSource().exists("path/to/your/file")

This will return true or false based on its existence.


Viewing all articles
Browse latest Browse all 47

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>