| 1 | warn_on_dtype with DataFrame |
| 2 | #### Description |
| 3 | |
| 4 | ``warn_on_dtype`` has no effect when input is a pandas ``DataFrame`` |
| 5 | |
| 6 | #### Steps/Code to Reproduce |
| 7 | ```python |
| 8 | from sklearn.utils.validation import check_array |
| 9 | import pandas as pd |
| 10 | df = pd.DataFrame([[1, 2, 3], [2, 3, 4]], dtype=object) |
| 11 | checked = check_array(df, warn_on_dtype=True) |
| 12 | ``` |
| 13 | |
| 14 | #### Expected result: |
| 15 | |
| 16 | ```python-traceback |
| 17 | DataConversionWarning: Data with input dtype object was converted to float64. |
| 18 | ``` |
| 19 | |
| 20 | #### Actual Results |
| 21 | No warning is thrown |
| 22 | |
| 23 | #### Versions |
| 24 | Linux-4.4.0-116-generic-x86_64-with-debian-stretch-sid |
| 25 | Python 3.6.3 |Anaconda, Inc.| (default, Nov 3 2017, 19:19:16) |
| 26 | [GCC 7.2.0] |
| 27 | NumPy 1.13.1 |
| 28 | SciPy 0.19.1 |
| 29 | Scikit-Learn 0.20.dev0 |
| 30 | Pandas 0.21.0 |
| 31 | |
| 32 | warn_on_dtype with DataFrame |
| 33 | #### Description |
| 34 | |
| 35 | ``warn_on_dtype`` has no effect when input is a pandas ``DataFrame`` |
| 36 | |
| 37 | #### Steps/Code to Reproduce |
| 38 | ```python |
| 39 | from sklearn.utils.validation import check_array |
| 40 | import pandas as pd |
| 41 | df = pd.DataFrame([[1, 2, 3], [2, 3, 4]], dtype=object) |
| 42 | checked = check_array(df, warn_on_dtype=True) |
| 43 | ``` |
| 44 | |
| 45 | #### Expected result: |
| 46 | |
| 47 | ```python-traceback |
| 48 | DataConversionWarning: Data with input dtype object was converted to float64. |
| 49 | ``` |
| 50 | |
| 51 | #### Actual Results |
| 52 | No warning is thrown |
| 53 | |
| 54 | #### Versions |
| 55 | Linux-4.4.0-116-generic-x86_64-with-debian-stretch-sid |
| 56 | Python 3.6.3 |Anaconda, Inc.| (default, Nov 3 2017, 19:19:16) |
| 57 | [GCC 7.2.0] |
| 58 | NumPy 1.13.1 |
| 59 | SciPy 0.19.1 |
| 60 | Scikit-Learn 0.20.dev0 |
| 61 | Pandas 0.21.0 |
| 62 | |