8000 BUG: join on column with index by debnathshoham · Pull Request #49360 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: join on column with index #49360

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

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4bf58bd
initial commit
debnathshoham Oct 26, 2022
f4f84f4
Merge branch 'main' of https://github.com/pandas-dev/pandas into gh28…
debnathshoham Oct 27, 2022
00e87ba
test tweak
debnathshoham Oct 27, 2022
a0f6d76
lots of change in test_merge.TestMerge.test_merge_left_empty_right_no…
debnathshoham Oct 27, 2022
e89cacb
multiple tests changed in test_merge.py
debnathshoham Oct 27, 2022
35a4b5d
precommit changes
debnathshoham Oct 27, 2022
20add1c
Merge branch 'main' into gh28243_bug_join_leftindex_righton
debnathshoham Oct 27, 2022
a324be7
Merge branch 'main' of https://github.com/pandas-dev/pandas into gh28…
debnathshoham Oct 27, 2022
eeae11b
tweaked test_join.py
debnathshoham Oct 28, 2022
f824d73 8000
unsure changes in test_merge_asof.py
debnathshoham Oct 28, 2022
d95515c
precommit changes
debnathshoham Oct 28, 2022
a8c78a0
Merge remote-tracking branch 'origin/gh28243_bug_join_leftindex_right…
debnathshoham Oct 28, 2022
751e882
Merge branch 'main' into gh28243_bug_join_leftindex_righton
debnathshoham Oct 28, 2022
4110e2b
Merge branch 'main' of https://github.com/pandas-dev/pandas into gh28…
debnathshoham Oct 28, 2022
66dfff4
test_merge_index_as_string.py tweaks
debnathshoham Oct 28, 2022
c3e5fd2
precommit clean
debnathshoham Oct 28, 2022
86fc699
Merge branch 'main' of https://github.com/pandas-dev/pandas into gh28…
debnathshoham Oct 28, 2022
6f6021d
Merge remote-tracking branch 'origin/gh28243_bug_join_leftindex_right…
debnathshoham Oct 28, 2022
f18b2d2
updated asof join_index
debnathshoham Oct 28, 2022
15f3c9f
added another test and issue
debnathshoham Oct 28, 2022
a9760ff
cleanup precommit
debnathshoham Oct 28, 2022
f096c0c
test cleanup
debnathshoham Oct 28, 2022
aa8ac6d
Merge branch 'main' into gh28243_bug_join_leftindex_righton
debnathshoham Oct 29, 2022
b1b2ac7
Update test_merge_asof.py
debnathshoham Oct 29, 2022
f37d3b4
cosmetic undo
debnathshoham Oct 29, 2022
1cfa627
undo unnecessary cast from tests
debnathshoham Oct 29, 2022
8dcb0bc
Merge remote-tracking branch 'origin/gh28243_bug_join_leftindex_right…
debnathshoham Oct 29, 2022
a9b8412
cosmetic change
debnathshoham Oct 29, 2022
95741d7
updated whatsnew
debnathshoham Oct 29, 2022
ca1e1ed
Merge branch 'main' into gh28243_bug_join_leftindex_righton
debnathshoham Oct 31, 2022
ced3c5b
whatsnew to 2.0.0
debnathshoham Oct 31, 2022
76b9310
Merge branch 'main' into gh28243_bug_join_leftindex_righton
debnathshoham Nov 1, 2022
1c83099
Merge branch 'main' into gh28243_bug_join_leftindex_righton
debnathshoham Nov 1, 2022
9c28ecf
Merge branch 'main' into gh28243_bug_join_leftindex_righton
debnathshoham Nov 8, 2022
81ace15
Merge branch 'main' into gh28243_bug_join_leftindex_righton
debnathshoham Dec 14, 2022
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
test_merge_index_as_string.py tweaks
  • Loading branch information
debnathshoham committed Oct 28, 2022
commit 66dfff4cab21e5879a820886e58d42dc125fdca5
4 changes: 2 additions & 2 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ def merge_asof(
>>> pd.merge_asof(left, right, left_index=True, right_index=True)
left_val right_val
1 a 1
5 b 3
10 c 7
3 b 3
7 c 7

Here is a real-world times-series example

Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/reshape/merge/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,16 +881,16 @@ def test_merge_on_datetime64tz_empty(self):
"date2": [pd.Timestamp("2019", tz=dtz.tz)],
},
columns=["date", "value", "date2"],
)
).astype({"date":"datetime64[ns, UTC]", "date2":"datetime64[ns, UTC]"})
left = right[:0]
result = left.merge(right, on="date")
expected = DataFrame(
{
"value_x": Series(dtype=float),
"date2_x": Series(dtype="object"),
"date": Series(dtype="object"),
"date2_x": Series(dtype=dtz),
"date": Series(dtype=dtz),
"value_y": Series(dtype=float),
"date2_y": Series(dtype="object"),
"date2_y": Series(dtype=dtz),
},
columns=["value_x", "date2_x", "date", "value_y", "date2_y"],
)
Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/reshape/merge/test_merge_index_as_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,6 @@ def test_join_indexes_and_columns_on(df1, df2, left_index, join_type):
result = left_df.join(
right_df, on=["outer", "inner"], how=join_type, lsuffix="_x", rsuffix="_y"
)

tm.assert_frame_equal(result, expected, check_like=True)
expected.index = result.index
if not (join_type=="outer" and left_index=="inner"):
tm.assert_frame_equal(result, expected, check_like=True)
0