Skip to content

CLN: remove values_from_object #32715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,6 @@ cdef:
float64_t NaN = <float64_t>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:
Expand Down
3 changes: 0 additions & 3 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/computation/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down