MCPcopy Create free account
hub / github.com/apache/arrow / deserialize_pandas

Function deserialize_pandas

python/pyarrow/ipc.py:262–280  ·  view source on GitHub ↗

Deserialize a buffer protocol compatible object into a pandas DataFrame. Parameters ---------- buf : buffer An object compatible with the buffer protocol. use_threads : bool, default True Whether to parallelize the conversion using multiple threads. Returns

(buf, *, use_threads=True)

Source from the content-addressed store, hash-verified

260
261
262def deserialize_pandas(buf, *, use_threads=True):
263 """Deserialize a buffer protocol compatible object into a pandas DataFrame.
264
265 Parameters
266 ----------
267 buf : buffer
268 An object compatible with the buffer protocol.
269 use_threads : bool, default True
270 Whether to parallelize the conversion using multiple threads.
271
272 Returns
273 -------
274 df : pandas.DataFrame
275 The buffer deserialized as pandas DataFrame
276 """
277 buffer_reader = pa.BufferReader(buf)
278 with pa.RecordBatchStreamReader(buffer_reader) as reader:
279 table = reader.read_all()
280 return table.to_pandas(use_threads=use_threads)

Callers

nothing calls this directly

Calls 2

BufferReaderMethod · 0.80

Tested by

no test coverage detected