pandas.read_orc#

pandas.read_orc(path, columns=None, use_nullable_dtypes=_NoDefault.no_default, **kwargs)[source]#

Load an ORC object from the file path, returning a DataFrame.

New in version 1.0.0.

Parameters
pathstr, path object, or file-like object

String, path object (implementing os.PathLike[str]), or file-like object implementing a binary read() function. The string could be a URL. Valid URL schemes include http, ftp, s3, and file. For file URLs, a host is expected. A local file could be: file://localhost/path/to/table.orc.

columnslist, default None

If not None, only these columns will be read from the file. Output always follows the ordering of the file and not the columns list. This mirrors the original behaviour of pyarrow.orc.ORCFile.read().

use_nullable_dtypesbool, default False

Whether or not to use nullable dtypes as default when reading data. If set to True, nullable dtypes are used for all dtypes that have a nullable implementation, even if no nulls are present.

Note

The nullable dtype implementation can be configured by calling pd.set_option("mode.dtype_backend", "pandas") to use numpy-backed nullable dtypes or pd.set_option("mode.dtype_backend", "pyarrow") to use pyarrow-backed nullable dtypes (using pd.ArrowDtype).

New in version 2.0.

**kwargs

Any additional kwargs are passed to pyarrow.

Returns
DataFrame

Notes

Before using this function you should read the user guide about ORC and install optional dependencies.