diff --git a/pandas/_libs/lib.pyx b/pandas/_libs/lib.pyx index bc2886e5b531c..80592d4f67c98 100644 --- a/pandas/_libs/lib.pyx +++ b/pandas/_libs/lib.pyx @@ -1192,9 +1192,12 @@ _TYPE_MAP = { "u": "integer", "float32": "floating", "float64": "floating", + "float128": "floating", + "float256": "floating", "f": "floating", "complex64": "complex", "complex128": "complex", + "complex256": "complex", "c": "complex", "string": "string", str: "string", @@ -1216,23 +1219,6 @@ _TYPE_MAP = { bytes: "bytes", } -# types only exist on certain platform -try: - np.float128 - _TYPE_MAP["float128"] = "floating" -except AttributeError: - pass -try: - np.complex256 - _TYPE_MAP["complex256"] = "complex" -except AttributeError: - pass -try: - np.float16 - _TYPE_MAP["float16"] = "floating" -except AttributeError: - pass - @cython.internal cdef class Seen: diff --git a/pandas/tests/series/indexing/test_setitem.py b/pandas/tests/series/indexing/test_setitem.py index 6b0ff2d3e3704..e87a968dee323 100644 --- a/pandas/tests/series/indexing/test_setitem.py +++ b/pandas/tests/series/indexing/test_setitem.py @@ -688,11 +688,7 @@ def is_inplace(self, obj, expected): """ Whether we expect the setting to be in-place or not. """ - try: - return expected.dtype == obj.dtype - except TypeError: - # older numpys - return False + return expected.dtype == obj.dtype def check_indexer(self, obj, key, expected, val, indexer, is_inplace): orig = obj