[ Web Proxy ]
URL:
Viewing: https://arrow.apache.org/docs/python/generated/../integration/../generated/pyarrow.memory_map.html [Back]  [Original]

pyarrow.memory_map — Apache Arrow v25.0.1
Back to top
Search the docs ...:

pyarrow.memory_map#

pyarrow.memory_map(path, mode='r')#

Open memory map at file path. Size of the memory map cannot change.

Parameters:
pathstr
mode{r, r+, w}, default r

Whether the file is opened for reading (r), writing (w) or both (r+).

Returns:
mmapMemoryMappedFile

Examples

Reading from a memory map without any memory allocation or copying:

>>> import pyarrow as pa
>>> with pa.output_stream('example_mmap.txt') as stream:
...     stream.write(b'Constructing a buffer referencing the mapped memory')
...
51
>>> with pa.memory_map('example_mmap.txt') as mmap:
...     mmap.read_at(6,45)
...
b'memory'

Web Proxy Viewer  |  New URL  |  Original Page