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

pandas.Series.nunique.__name__ changes after running dfs #2752

Open
LivSkovhus opened this issue Jul 12, 2024 · 0 comments
Open

pandas.Series.nunique.__name__ changes after running dfs #2752

LivSkovhus opened this issue Jul 12, 2024 · 0 comments

Comments

@LivSkovhus
Copy link

featuretools.dfs() changes pandas.Series.nunique.__name__ when executing an aggregation primitive containing num_unique.

Example:

from pandas import DataFrame, Series
import featuretools as ft 
from woodwork.logical_types import Categorical

df = DataFrame({"index": [1,2,3,4,5], 
                "A": ["cat", "dog", "cat", "horse", "monkey"], 
                "Group": ["X", "X", "Y", "Y", "Y"]})

es = ft.EntitySet(id="test")
es = es.add_dataframe(dataframe_name="df", index="index", dataframe=df, logical_types={"A": Categorical})
es = es.normalize_dataframe(base_dataframe_name="df", new_dataframe_name="group", index="Group")

assert Series.nunique.__name__ == "nunique"

feature_matrix, feature_defs = ft.dfs(
    entityset=es, 
    target_dataframe_name="group", 
    agg_primitives=['num_unique'], 
    trans_primitives=[]
)

assert Series.nunique.__name__ != "nunique"
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