SciPy

This is documentation for an old release of NumPy (version 1.8.0). Read this page in the documentation of the latest stable release (version > 1.17).

numpy.DataSource.open

DataSource.open(path, mode='r')[source]

Open and return file-like object.

If path is an URL, it will be downloaded, stored in the DataSource directory and opened from there.

Parameters :

path : str

Local file path or URL to open.

mode : {‘r’, ‘w’, ‘a’}, optional

Mode to open path. Mode ‘r’ for reading, ‘w’ for writing, ‘a’ to append. Available modes depend on the type of object specified by path. Default is ‘r’.

Returns :

out : file object

File object.