numpy.DataSource.openΒΆ
-
DataSource.
open
(path, mode='r', encoding=None, newline=None)[source]ΒΆ Open and return file-like object.
If
path
is an URL, it will be downloaded, stored in theDataSource
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 bypath
. Default is βrβ.- encoding : {None, str}, optional
Open text file with given encoding. The default encoding will be what
io.open
uses.- newline : {None, str}, optional
Newline to use when reading text file.
Returns: - out : file object
File object.