pandas 1.4.2

ParametersBackRef
_get_filepath_or_buffer(filepath_or_buffer: 'FilePath | BaseBuffer', encoding: 'str' = 'utf-8', compression: 'CompressionOptions' = None, mode: 'str' = 'r', storage_options: 'StorageOptions' = None) -> 'IOArgs'

Parameters

filepath_or_buffer : a url, filepath (str, py.path.local or pathlib.Path),

or buffer

compression : str or dict, default 'infer'

For on-the-fly compression of the output data. If 'infer' and 'filepath_or_buffer' path-like, then detect compression from the following extensions: '.gz', '.bz2', '.zip', '.xz', or '.zst' (otherwise no compression). Set to None for no compression. Can also be a dict with key 'method' set to one of { 'zip' , 'gzip' , 'bz2' , 'zstd' } and other key-value pairs are forwarded to zipfile.ZipFile , gzip.GzipFile , bz2.BZ2File , or zstandard.ZstdDecompressor , respectively. As an example, the following could be passed for faster compression and to create a reproducible gzip archive: compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1} .

versionchanged
encoding : the encoding to use to decode bytes, default is 'utf-8'
mode : str, optional
storage_options : dict, optional

Extra options that make sense for a particular storage connection, e.g. host, port, username, password, etc., if using a URL that will be parsed by fsspec , e.g., starting "s3://", "gcs://". An error will be raised if providing this argument with a local path or a file-like buffer. See the fsspec and backend storage implementation docs for the set of allowed keys and values

versionadded
..versionchange:: 1.2.0 :

Returns the dataclass IOArgs.

If the filepath_or_buffer is a url, translate and return the buffer. Otherwise passthrough.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.io.parsers.readers.read_table pandas.io.parsers.readers.read_csv pandas.core.generic.NDFrame.to_csv

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/io/common.py#254
type: <class 'function'>
Commit: