Skip to content

fix arguments to pandas pd.merge #145

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 1 commit into from
Feb 7, 2022
Merged

Conversation

Dr-Irv
Copy link
Contributor

@Dr-Irv Dr-Irv commented Feb 4, 2022

pylance 2022.2.0

The following code:

import pandas as pd

df1 = pd.DataFrame([["a", 1], ["b", 2]], columns=["let", "num"]).set_index("let")

s2 = df1["num"]

res = pd.merge(s2, df1, left_index=True, right_index=True)

print(res)

reports

Argument of type "Series[S1@__getitem__]" cannot be assigned to parameter "left" of type "DataFrame" in function "merge"
  "Series[S1@__getitem__]" is incompatible with "DataFrame"

This PR fixes that issue. Note it was previously fixed in #61 and then broken in #129 .

@gramster gramster merged commit 8266baf into microsoft:main Feb 7, 2022
@Dr-Irv Dr-Irv deleted the mergefix branch February 18, 2022 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants