Skip to content

warn_on_dtype with DataFrame #10948

@wdevazelhes

Description

@wdevazelhes

Description

warn_on_dtype has no effect when input is a pandas DataFrame

Steps/Code to Reproduce

from sklearn.utils.validation import check_array
import pandas as pd
df = pd.DataFrame([[1, 2, 3], [2, 3, 4]], dtype=object)
checked = check_array(df, warn_on_dtype=True)

Expected result:

DataConversionWarning: Data with input dtype object was converted to float64.

Actual Results

No warning is thrown

Versions

Linux-4.4.0-116-generic-x86_64-with-debian-stretch-sid
Python 3.6.3 |Anaconda, Inc.| (default, Nov 3 2017, 19:19:16)
[GCC 7.2.0]
NumPy 1.13.1
SciPy 0.19.1
Scikit-Learn 0.20.dev0
Pandas 0.21.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions