Read a pandas.DataFrame from Feather format. To read as pyarrow.Table use feather.read_table. Parameters ---------- source : str file path, or file-like object You can use MemoryMappedFile as source, for explicitly use memory map. columns : sequence, optional
(source, columns=None, use_threads=True,
memory_map=False, **kwargs)
| 196 | |
| 197 | |
| 198 | def read_feather(source, columns=None, use_threads=True, |
| 199 | memory_map=False, **kwargs): |
| 200 | """ |
| 201 | Read a pandas.DataFrame from Feather format. To read as pyarrow.Table use |
| 202 | feather.read_table. |
| 203 | |
| 204 | Parameters |
| 205 | ---------- |
| 206 | source : str file path, or file-like object |
| 207 | You can use MemoryMappedFile as source, for explicitly use memory map. |
| 208 | columns : sequence, optional |
| 209 | Only read a specific set of columns. If not provided, all columns are |
| 210 | read. |
| 211 | use_threads : bool, default True |
| 212 | Whether to parallelize reading using multiple threads. If false the |
| 213 | restriction is used in the conversion to Pandas as well as in the |
| 214 | reading from Feather format. |
| 215 | memory_map : boolean, default False |
| 216 | Use memory mapping when opening file on disk, when source is a str. |
| 217 | **kwargs |
| 218 | Additional keyword arguments passed on to `pyarrow.Table.to_pandas`. |
| 219 | |
| 220 | Returns |
| 221 | ------- |
| 222 | df : pandas.DataFrame |
| 223 | The contents of the Feather file as a pandas.DataFrame |
| 224 | """ |
| 225 | return (read_table( |
| 226 | source, columns=columns, memory_map=memory_map, |
| 227 | use_threads=use_threads).to_pandas(use_threads=use_threads, **kwargs)) |
| 228 | |
| 229 | |
| 230 | def read_table(source, columns=None, memory_map=False, use_threads=True): |