Skip to content

Implement __matmul__, typehint pd.DataFrame.eval inplace and test conversion for test_frame.py #1053

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
loicdiridollou opened this issue Nov 23, 2024 · 0 comments · Fixed by #1054
Assignees
Labels
inplace Relating to inplace parameter or equivalent Numeric Operations Arithmetic, Comparison, and Logical operations

Comments

@loicdiridollou
Copy link
Member

Describe the bug

  • @ operator on dataframe is not typehinted properly.
  • df.eval("...", inplace=True) returns Unknown
  • Convert test for types into check/assert_type framework

To Reproduce

import pandas as pd

df1 = pd.DataFrame([[0, 1, -2, -1], [1, 1, 1, 1]])
df2 = pd.DataFrame([[0, 1], [1, 2], [-1, -1], [2, 0]])

check(assert_type(df1 @ df2, pd.DataFrame ),pd.DataFrame )
check(assert_type(df1.eval("c = 0 + 1", inplace=True), None), type(None))

Please complete the following information:

  • OS: [e.g. Windows, Linux, MacOS] MacOS
  • OS Version [e.g. 22] 15
  • python version 3.12
  • version of type checker 1.13
  • version of installed pandas-stubs 2.2.3.20241009
@Dr-Irv Dr-Irv added inplace Relating to inplace parameter or equivalent Numeric Operations Arithmetic, Comparison, and Logical operations labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inplace Relating to inplace parameter or equivalent Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants