Elffuss BraidHub

kikocis/auto-code-rover public

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