Skip to content

Commit 43ba17f

Browse files
author
Oleh Kozynets
committed
Add a separate unit test.
1 parent f94722b commit 43ba17f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pandas/tests/frame/methods/test_select_dtypes.py

+23
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,29 @@ def test_select_dtypes_exclude_include_using_list_like(self):
9494
e = df[["b", "e"]]
9595
tm.assert_frame_equal(r, e)
9696

97+
def test_select_dtypes_exclude_include_int(self):
98+
df = DataFrame(
99+
{
100+
"a": list("abc"),
101+
"b": list(range(1, 4)),
102+
"c": np.arange(3, 6).astype("int32"),
103+
"d": np.arange(4.0, 7.0, dtype="float64"),
104+
"e": [True, False, True],
105+
"f": pd.date_range("now", periods=3).values,
106+
}
107+
)
108+
exclude = (np.datetime64,)
109+
include = np.bool_, "int"
110+
r = df.select_dtypes(include=include, exclude=exclude)
111+
e = df[["b", "c", "e"]]
112+
tm.assert_frame_equal(r, e)
113+
114+
exclude = ("datetime",)
115+
include = "bool", int
116+
r = df.select_dtypes(include=include, exclude=exclude)
117+
e = df[["b", "c", "e"]]
118+
tm.assert_frame_equal(r, e)
119+
97120
def test_select_dtypes_include_using_scalars(self):
98121
df = DataFrame(
99122
{

0 commit comments

Comments
 (0)