Skip to content

BUG: Fix concat DataFrame and Series with ignore_index=True #60983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Mar 7, 2025
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3d1cb46
modified the files according to bug#60237
Anurag-Varma Feb 18, 2025
a153646
Merge branch 'bug#60237' of https://github.com/Anurag-Varma/pandas in…
Anurag-Varma Feb 18, 2025
3d40bca
Update doc/source/whatsnew/v3.0.0.rst
Anurag-Varma Feb 18, 2025
43e97c5
moved test case to frame and serier folders
Anurag-Varma Feb 18, 2025
0b47d24
fix pyarrow import error
Anurag-Varma Feb 18, 2025
f4922c2
inconsistent issue fix
Anurag-Varma Feb 22, 2025
252e5b2
added test cases and fixed old pr test cases
Anurag-Varma Feb 22, 2025
f98a814
added rst and small changes in tests file
Anurag-Varma Feb 22, 2025
c73a931
Merge branch 'main' of https://github.com/Anurag-Varma/pandas into bu…
Anurag-Varma Feb 22, 2025
d9de374
fixed column name issue for column wise concat
Anurag-Varma Feb 23, 2025
e19e820
fixed text case for concat
Anurag-Varma Feb 23, 2025
42c51ec
fix test cases issue
Anurag-Varma Feb 23, 2025
a6ef45a
Trigger redeployment
Anurag-Varma Feb 23, 2025
1750d6a
Merge branch 'main' into bug#60723
Anurag-Varma Feb 24, 2025
952e292
Merge branch 'main' into bug#60723
Anurag-Varma Feb 25, 2025
dba9778
fixed reviewed changes and added extra test cases
Anurag-Varma Mar 4, 2025
5787d95
Merge branch 'main' of https://github.com/pandas-dev/pandas into bug#…
Anurag-Varma Mar 4, 2025
48d2e06
Merge branch 'bug#60723' of https://github.com/Anurag-Varma/pandas in…
Anurag-Varma Mar 4, 2025
d53dc0a
removed duplicate test case
Anurag-Varma Mar 4, 2025
bf40bb5
Merge branch 'main' into bug#60723
Anurag-Varma Mar 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed text case for concat
  • Loading branch information
Anurag-Varma committed Feb 23, 2025
commit e19e820b66391b7d00a8676030c44942fd95f86d
12 changes: 10 additions & 2 deletions pandas/tests/reshape/concat/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,19 @@ def test_concat_mixed_objs_index_names(self):
s2 = Series(arr, index=index, name="bar")
df = DataFrame(arr.reshape(-1, 1), index=index)

expected = concat([s1.to_frame(), df, s2.to_frame()])
expected = DataFrame(
np.kron(np.where(np.identity(3) == 1, 1, np.nan), arr).T,
index=index.tolist() * 3,
columns=["foo", 0, "bar"],
)
result = concat([s1, df, s2])
tm.assert_frame_equal(result, expected)

expected = concat([s1.to_frame(), df, s2.to_frame()], ignore_index=True)
expected = DataFrame(
np.kron(np.where(np.identity(3) == 1, 1, np.nan), arr).T,
index=np.arange(30, dtype=np.int64),
columns=["foo", 0, "bar"],
)
result = concat([s1, df, s2], ignore_index=True)
tm.assert_frame_equal(result, expected)

Expand Down
Loading