)
from pandas.tests.frame.common import TestData
import pandas.util.testing as tm
+from pandas.compat import is_platform_little_endian
class TestDataFrameConvertTo(TestData):
),
],
)
+ @pytest.mark.skipif(not is_platform_little_endian(),reason="expected values assume little-endian")
def test_to_records_dtype(self, kwargs, expected):
# see gh-18146
df = DataFrame({"A": [1, 2], "B": [0.2, 1.5], "C": ["a", "bc"]})
),
],
)
+ @pytest.mark.skipif(not is_platform_little_endian(),reason="expected values assume little-endian")
def test_to_records_dtype_mi(self, df, kwargs, expected):
# see gh-18146
result = df.to_records(**kwargs)
tm.assert_almost_equal(result, expected)
+ @pytest.mark.skipif(not is_platform_little_endian(),reason="expected values assume little-endian")
def test_to_records_dict_like(self):
# see gh-18146
class DictLike:
tm.assert_numpy_array_equal(np.array([2]) * td, expected)
msg = (
"ufunc '?multiply'? cannot use operands with types"
- r" dtype\('<m8\[ns\]'\) and dtype\('<m8\[ns\]'\)"
+ r" dtype\('[<>]m8\[ns\]'\) and dtype\('[<>]m8\[ns\]'\)"
)
with pytest.raises(TypeError, match=msg):
td * other
"the dtype timedelta64 is not supported for parsing",
dict(dtype={"A": "timedelta64", "B": "float64"}),
),
- ("the dtype <U8 is not supported for parsing", dict(dtype={"A": "U8"})),
+ ("the dtype [<>]U8 is not supported for parsing", dict(dtype={"A": "U8"})),
],
ids=["dt64-0", "dt64-1", "td64", "<U8"],
)