Skip to content

Commit e62746a

Browse files
authored
TST: add a test for selecting columns in DataFrame with big-endian dtype (#57519)
add a test: big-endian support selecting columns
1 parent 260a703 commit e62746a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/frame/indexing/test_indexing.py

+10
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,16 @@ def test_setitem_value_coercing_dtypes(self, indexer, idx):
15371537
expected = DataFrame([[1, np.nan], [2, np.nan], ["3", np.nan]], dtype=object)
15381538
tm.assert_frame_equal(df, expected)
15391539

1540+
def test_big_endian_support_selecting_columns(self):
1541+
# GH#57457
1542+
columns = ["a"]
1543+
data = [np.array([1, 2], dtype=">f8")]
1544+
df = DataFrame(dict(zip(columns, data)))
1545+
result = df[df.columns]
1546+
dfexp = DataFrame({"a": [1, 2]}, dtype=">f8")
1547+
expected = dfexp[dfexp.columns]
1548+
tm.assert_frame_equal(result, expected)
1549+
15401550

15411551
class TestDataFrameIndexingUInt64:
15421552
def test_setitem(self):

0 commit comments

Comments
 (0)