diff --git a/python/cudf/cudf/pandas/_wrappers/numpy.py b/python/cudf/cudf/pandas/_wrappers/numpy.py index d5e669cb58f..1fc53bbbaae 100644 --- a/python/cudf/cudf/pandas/_wrappers/numpy.py +++ b/python/cudf/cudf/pandas/_wrappers/numpy.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. +# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. # All rights reserved. # SPDX-License-Identifier: Apache-2.0 @@ -149,6 +149,7 @@ def ndarray__array_ufunc__(self, ufunc, method, *inputs, **kwargs): # Special wrapping to handle scalar values "_fsproxy_wrap": classmethod(wrap_ndarray), "base": _FastSlowAttribute("base", private=True), + "data": _FastSlowAttribute("data", private=True), }, ) diff --git a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py index 938d22de076..3e8b6d5786c 100644 --- a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py +++ b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py @@ -1927,3 +1927,12 @@ def test_series_dtype_property(): expected = np.dtype(s) actual = np.dtype(xs) assert expected == actual + + +def test_numpy_data_access(): + s = pd.Series([1, 2, 3]) + xs = xpd.Series([1, 2, 3]) + expected = s.values.data + actual = xs.values.data + + assert type(expected) is type(actual)