Skip to content

Commit a41ba3f

Browse files
code sample for pandas-dev#42396
1 parent 8689a7c commit a41ba3f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bisect/42396.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BUG: astype() on an integer DataFrame changes the order of data #42396
2+
3+
import numpy as np
4+
import pandas as pd
5+
6+
print(pd.__version__)
7+
8+
npa = np.random.RandomState(0).randint(1000, size=(20, 8))
9+
df = pd.DataFrame(npa, columns=[f"c{i}" for i in range(8)]).iloc[:6, :3]
10+
result = df.astype("int32")
11+
print(result)
12+
13+
pd.testing.assert_frame_equal(result, df, check_dtype=False)

0 commit comments

Comments
 (0)