Skip to content
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

Performance degradation in sa.annotated.pandas #3

Open
kbrodt opened this issue Oct 30, 2019 · 1 comment
Open

Performance degradation in sa.annotated.pandas #3

kbrodt opened this issue Oct 30, 2019 · 1 comment

Comments

@kbrodt
Copy link

kbrodt commented Oct 30, 2019

Hello,

I launched a simple comparison of apply between pandas and sa.annotated.pandas and got performance 0.018s in the first case and 12.47s in the second one. Also I cannot print annotated dataframe. What I do uncorrect here?

To reproduce:

import time


def test_new_apply(is_sa=False):
    if is_sa:
        import sa.annotated.pandas as pd
    else:
        import pandas as pd

    a = pd.DataFrame(list(range(10 ** 5)), columns=['x'])
    if is_sa:
        # print(a.head())  # <- raises AttributeError: 'Operation' object has no attribute 'max'
        pass
    else:
        print(a.head())
    start = time.time()
    a['xp1'] = a['x'].apply(lambda x: x + 1)
    print(time.time() - start)


test_new_apply(is_sa=False)
test_new_apply(is_sa=True)

Environment:

Python 3.6.8
[GCC 8.3.0] on linux

pandas==0.25.2
sa==0.0.4

@kbrodt
Copy link
Author

kbrodt commented Oct 30, 2019

Probably It is due to non annotated lambda.

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

No branches or pull requests

1 participant