File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 8
8
import pandas .util ._test_decorators as td
9
9
10
10
import pandas as pd
11
- from pandas .core .arrays import PandasArray
11
+ from pandas .arrays import PandasArray
12
+ from pandas .core .arrays .numpy_ import PandasDtype
12
13
import pandas .util .testing as tm
13
14
14
15
@@ -96,3 +97,20 @@ def test_series_constructor_with_astype():
96
97
result = pd .Series (PandasArray (ndarray ), dtype = "float64" )
97
98
expected = pd .Series ([1.0 , 2.0 , 3.0 ], dtype = "float64" )
98
99
tm .assert_series_equal (result , expected )
100
+
101
+
102
+ @pytest .mark .parametrize ('dtype, expected' , [
103
+ ('bool' , True ),
104
+ ('int' , True ),
105
+ ('uint' , True ),
106
+ ('float' , True ),
107
+ ('complex' , True ),
108
+ ('str' , False ),
109
+ ('bytes' , False ),
110
+ ('datetime64[ns]' , False ),
111
+ ('object' , False ),
112
+ ('void' , False )
113
+ ])
114
+ def test_is_numeric (dtype , expected ):
115
+ dtype = PandasDtype (dtype )
116
+ assert dtype ._is_numeric is expected
You can’t perform that action at this time.
0 commit comments