test_util.py 385 B

1234567891011121314
  1. import numpy as np
  2. from pandas import DataFrame
  3. from pandas.tests.copy_view.util import get_array
  4. def test_get_array_numpy():
  5. df = DataFrame({"a": [1, 2, 3]})
  6. assert np.shares_memory(get_array(df, "a"), get_array(df, "a"))
  7. def test_get_array_masked():
  8. df = DataFrame({"a": [1, 2, 3]}, dtype="Int64")
  9. assert np.shares_memory(get_array(df, "a"), get_array(df, "a"))