Skip to content

Commit 47f970a

Browse files
committed
Fix input values for testing
1 parent ab4d36d commit 47f970a

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

pandas/tests/frame/methods/test_sort_values.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -581,23 +581,11 @@ def test_sort_values_item_cache(self, using_array_manager):
581581

582582
def test_sort_values_reshaping(self):
583583
# GH 39426
584-
rand_low = 0
585-
rand_high = 100
586-
n_cols = 32
587-
n_rows = 4
588-
589-
random_state = np.random.RandomState(seed=42)
590-
test_dict = {
591-
int((i - n_cols / 2) % n_cols + 1): random_state.randint(
592-
rand_low, rand_high, size=(n_rows)
593-
)
594-
for i in range(n_cols)
595-
}
596-
df = DataFrame(test_dict)
597-
df = df.sort_values(df.index[0], axis=1, ignore_index=True)
584+
values = list(range(21))
585+
expected = DataFrame([values], columns=values)
586+
df = expected.sort_values(expected.index[0], axis=1, ignore_index=True)
598587

599-
assert df.shape == (n_rows, n_cols)
600-
assert list(df.columns) == list(range(n_cols))
588+
tm.assert_frame_equal(df, expected)
601589

602590

603591
class TestDataFrameSortKey: # test key sorting (issue 27237)

0 commit comments

Comments
 (0)