"not all arguments converted during string formatting",
"can't multiply sequence by non-int of type 'float'",
"ufunc 'subtract' cannot use operands with types dtype",
- r"ufunc 'add' cannot use operands with types dtype\('<M8\[ns\]'\)",
+ r"ufunc 'add' cannot use operands with types dtype\('[<>]M8\[ns\]'\)",
r"ufunc 'add' cannot use operands with types dtype\('float\d{2}'\)",
"cannot subtract DatetimeArray from ndarray",
]
date_range,
)
import pandas._testing as tm
+from pandas.compat import is_platform_little_endian
class TestDataFrameToRecords:
+ [np.asarray(df.iloc[:, i]) for i in range(3)],
dtype={
"names": ["A", "level_1", "0", "1", "2"],
- "formats": ["O", "O", "<f8", "<f8", "<f8"],
+ "formats": ["O", "O", "<f8", "<f8", "<f8"] if is_platform_little_endian() else ["O", "O", ">f8", ">f8", ">f8"],
},
)
tm.assert_numpy_array_equal(result, expected)
("2022-01-01", "2022-01-01", "2022-01-01"),
("2022-01-02", "2022-01-02", "2022-01-02"),
],
- dtype=[("1", "<M8[ns]"), ("2", "<M8[ns]"), ("3", "<M8[ns]")],
+ dtype=[("1", "<M8[ns]"), ("2", "<M8[ns]"), ("3", "<M8[ns]")] if is_platform_little_endian() else [("1", ">M8[ns]"), ("2", ">M8[ns]"), ("3", ">M8[ns]")],
)
result = df.to_records(index=False)