Skip to content

Commit 649d303

Browse files
committed
TST: change dtype on expected output instead of input
1 parent f3abd2b commit 649d303

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/tests/reshape/test_reshape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,14 @@ def test_dataframe_dummies_prefix_list(self, df, sparse):
397397

398398
def test_dataframe_dummies_prefix_str(self, df, sparse):
399399
# not that you should do this...
400-
df[['C']] = df[['C']].astype(np.uint8)
401400
result = get_dummies(df, prefix='bad', sparse=sparse)
402401
bad_columns = ['bad_a', 'bad_b', 'bad_b', 'bad_c']
403402
expected = DataFrame([[1, 1, 0, 1, 0],
404403
[2, 0, 1, 1, 0],
405404
[3, 1, 0, 0, 1]],
406405
columns=['C'] + bad_columns,
407406
dtype=np.uint8)
407+
expected = expected.astype({"C": np.int64})
408408
assert_frame_equal(result, expected)
409409

410410
def test_dataframe_dummies_subset(self, df, sparse):

0 commit comments

Comments
 (0)