Skip to content

utils.validation.check_array throws bad TypeError pandas series is passed in #12699

@greghoop

Description

@greghoop

Description

validation.check_array throws bad TypeError pandas series is passed in. It cropped up when using the RandomizedSearchCV class. Caused when line 480 is executed

480 - if hasattr(array, "dtypes") and len(array.dtypes):

Steps/Code to Reproduce

validation.check_array(y, ensure_2d=False, dtype=None) where y is a pandas series

Expected Results

No error (I'm not familiar with this code so not sure on the details)

Actual Results

TypeError: object of type 'DTYPE NAME OF THE SERIES' has no len()

Versions

0.20.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions