Skip to content

Performance degradation in sa.annotated.pandas #3

@kbrodt

Description

@kbrodt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions