polars.read_ipc

polars.read_ipc(file: Union[str, BinaryIO, _io.BytesIO, pathlib.Path, bytes], columns: Optional[Union[List[int], List[str]]] = None, n_rows: Optional[int] = None, use_pyarrow: bool = True, memory_map: bool = True, storage_options: Optional[Dict] = None, row_count_name: Optional[str] = None, row_count_offset: int = 0, rechunk: bool = True, **kwargs: Any) polars.internals.frame.DataFrame

Read into a DataFrame from Arrow IPC (Feather v2) file.

Parameters
file

Path to a file or a file-like object. If fsspec is installed, it will be used to open remote files.

columns

Columns to select. Accepts a list of column indices (starting at zero) or a list of column names.

n_rows

Stop reading from IPC file after reading n_rows. Only valid when use_pyarrow=False.

use_pyarrow

Use pyarrow or the native rust reader.

memory_map

Memory map underlying file. This will likely increase performance. Only used when use_pyarrow=True.

storage_options

Extra options that make sense for fsspec.open() or a particular storage connection, e.g. host, port, username, password, etc.

row_count_name

If not None, this will insert a row count column with give name into the DataFrame

row_count_offset

Offset to start the row_count column (only use if the name is set)

rechunk

Make sure that all data is contiguous.

Returns
DataFrame