Skip to content

Commit

Permalink
code sample for pandas-dev#47127
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed May 28, 2022
1 parent 50df686 commit 7224941
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bisect/47127.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# BUG: concat column order behaviors changes after 1.4 #47127

import pandas as pd

print(pd.__version__)

pdf = pd.DataFrame({"A": [0, 2, 4], "B": [1, 3, 5], "C": [6, 7, 8]})
result = pd.concat(
[pdf, pdf["C"], pdf["A"]], ignore_index=True, join="outer", sort=True
)
print(result)

expected = pd.Index([0, "A", "B", "C"], dtype="object")
pd.testing.assert_index_equal(result.columns, expected)

0 comments on commit 7224941

Please sign in to comment.