numpy.lib.npyio.DataSource.exists
method
- lib.npyio.DataSource.exists(path)[source]
-
Test if path exists.
Test if
pathexists as (and in this order):- a local file.
- a remote URL that has been downloaded and stored locally in the
DataSourcedirectory. - a remote URL that has not been downloaded, but is valid and accessible.
- Parameters:
-
- pathstr or pathlib.Path
-
Can be a local file or a remote URL.
- Returns:
-
- outbool
-
True if
pathexists.
Notes
When
pathis an URL,existswill return True if it’s either stored locally in theDataSourcedirectory, or is a valid remote URL.DataSourcedoes not discriminate between the two, the file is accessible if it exists in either location.
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.0/reference/generated/numpy.lib.npyio.DataSource.exists.html