diff --git a/pandas/_libs/lib.pyx b/pandas/_libs/lib.pyx index db1abae4d6ff3..dc2e8c097bc14 100644 --- a/pandas/_libs/lib.pyx +++ b/pandas/_libs/lib.pyx @@ -94,20 +94,6 @@ cdef: float64_t NaN = np.NaN -def values_from_object(obj: object): - """ - Return my values or the object if we are say an ndarray. - """ - func: object - - func = getattr(obj, '_internal_get_values', None) - if func is not None: - # Includes DataFrame, for which we get frame.values - obj = func() - - return obj - - @cython.wraparound(False) @cython.boundscheck(False) def memory_usage_of_objects(arr: object[:]) -> int64_t: diff --git a/pandas/core/common.py b/pandas/core/common.py index 6230ee34bcd50..056b564ead0e0 100644 --- a/pandas/core/common.py +++ b/pandas/core/common.py @@ -87,9 +87,6 @@ def maybe_box_datetimelike(value, dtype=None): return value -values_from_object = lib.values_from_object - - def is_bool_indexer(key: Any) -> bool: """ Check whether `key` is a valid boolean indexer. diff --git a/pandas/core/computation/expressions.py b/pandas/core/computation/expressions.py index fdc299ccdfde8..7f93472c766d7 100644 --- a/pandas/core/computation/expressions.py +++ b/pandas/core/computation/expressions.py @@ -121,12 +121,12 @@ def _evaluate_numexpr(op, op_str, a, b): def _where_standard(cond, a, b): - # Caller is responsible for calling values_from_object if necessary + # Caller is responsible for extracting ndarray if necessary return np.where(cond, a, b) def _where_numexpr(cond, a, b): - # Caller is responsible for calling values_from_object if necessary + # Caller is responsible for extracting ndarray if necessary result = None if _can_use_numexpr(None, "where", a, b, "where"):