Read a pandas.DataFrame from Feather format. To read as pyarrow.Table use feather.read_table. .. deprecated:: 24.0.0 Use :func:`pyarrow.ipc.open_file` / :class:`pyarrow.ipc.RecordBatchFileReader` instead. Feather V2 is the Arrow IPC file format. Parameters
(source, columns=None, use_threads=True,
memory_map=False, **kwargs)
| 218 | |
| 219 | |
| 220 | def read_feather(source, columns=None, use_threads=True, |
| 221 | memory_map=False, **kwargs): |
| 222 | """ |
| 223 | Read a pandas.DataFrame from Feather format. To read as pyarrow.Table use |
| 224 | feather.read_table. |
| 225 | |
| 226 | .. deprecated:: 24.0.0 |
| 227 | Use :func:`pyarrow.ipc.open_file` / |
| 228 | :class:`pyarrow.ipc.RecordBatchFileReader` instead. |
| 229 | Feather V2 is the Arrow IPC file format. |
| 230 | |
| 231 | Parameters |
| 232 | ---------- |
| 233 | source : str file path, or file-like object |
| 234 | You can use MemoryMappedFile as source, for explicitly use memory map. |
| 235 | columns : sequence, optional |
| 236 | Only read a specific set of columns. If not provided, all columns are |
| 237 | read. |
| 238 | use_threads : bool, default True |
| 239 | Whether to parallelize reading using multiple threads. If false the |
| 240 | restriction is used in the conversion to Pandas as well as in the |
| 241 | reading from Feather format. |
| 242 | memory_map : boolean, default False |
| 243 | Use memory mapping when opening file on disk, when source is a str. |
| 244 | **kwargs |
| 245 | Additional keyword arguments passed on to `pyarrow.Table.to_pandas`. |
| 246 | |
| 247 | Returns |
| 248 | ------- |
| 249 | df : pandas.DataFrame |
| 250 | The contents of the Feather file as a pandas.DataFrame |
| 251 | """ |
| 252 | warnings.warn( |
| 253 | "pyarrow.feather.read_feather is deprecated as of 24.0.0. " |
| 254 | "Use pyarrow.ipc.open_file() / RecordBatchFileReader instead. " |
| 255 | "Feather V2 is the Arrow IPC file format.", |
| 256 | FutureWarning, |
| 257 | stacklevel=2 |
| 258 | ) |
| 259 | return (_read_table_internal( |
| 260 | source, columns=columns, memory_map=memory_map, |
| 261 | use_threads=use_threads).to_pandas(use_threads=use_threads, **kwargs)) |
| 262 | |
| 263 | |
| 264 | def _read_table_internal(source, columns=None, memory_map=False, |