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

Function test_buffer_to_numpy

python/pyarrow/tests/test_io.py:473–482  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

471
472@pytest.mark.numpy
473def test_buffer_to_numpy():
474 # Make sure creating a numpy array from an arrow buffer works
475 byte_array = bytearray(20)
476 byte_array[0] = 42
477 buf = pa.py_buffer(byte_array)
478 array = np.frombuffer(buf, dtype="uint8")
479 assert array[0] == byte_array[0]
480 byte_array[0] += 1
481 assert array[0] == byte_array[0]
482 assert array.base == buf
483
484
485@pytest.mark.numpy

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected