@@ -82,16 +82,33 @@ def test_select_dtypes_exclude_include_using_list_like(self):
82
82
e = df [["b" , "c" , "e" ]]
83
83
tm .assert_frame_equal (r , e )
84
84
85
+ exclude = ("datetime" ,)
86
+ include = "bool" , "int64" , "int32"
87
+ r = df .select_dtypes (include = include , exclude = exclude )
88
+ e = df [["b" , "e" ]]
89
+ tm .assert_frame_equal (r , e )
90
+
91
+ def test_select_dtypes_exclude_include_int (self ):
92
+ df = DataFrame (
93
+ {
94
+ "a" : list ("abc" ),
95
+ "b" : list (range (1 , 4 )),
96
+ "c" : np .arange (3 , 6 ).astype ("int32" ),
97
+ "d" : np .arange (4.0 , 7.0 , dtype = "float64" ),
98
+ "e" : [True , False , True ],
99
+ "f" : pd .date_range ("now" , periods = 3 ).values ,
100
+ }
101
+ )
85
102
exclude = (np .datetime64 ,)
86
103
include = np .bool_ , "int"
87
104
r = df .select_dtypes (include = include , exclude = exclude )
88
- e = df [["b" , "e" ]]
105
+ e = df [["b" , "c" , " e" ]]
89
106
tm .assert_frame_equal (r , e )
90
107
91
108
exclude = ("datetime" ,)
92
- include = "bool" , "int64" , "int32"
109
+ include = "bool" , int
93
110
r = df .select_dtypes (include = include , exclude = exclude )
94
- e = df [["b" , "e" ]]
111
+ e = df [["b" , "c" , " e" ]]
95
112
tm .assert_frame_equal (r , e )
96
113
97
114
def test_select_dtypes_include_using_scalars (self ):
0 commit comments