-
Notifications
You must be signed in to change notification settings - Fork 76
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
issue in cell 776, missing group by of feature columns #4
Comments
not working for categorical column, error "unhashable type: 'list'" |
Hey Nithin, when i run this command: dfn = build_anonymized_dataset(df, finished_partitions, feature_columns, sensitive_column) it shows me this error.
|
AttributeError: 'list' object has no attribute 'to_dict' How to solve this mistake, please |
I got the same error. this is workaround below. def agg_categorical_column(series):
# workearound here
series.astype('category')
return [','.join(set(series))] |
I got the same error too. It could be found that the df. agg() returned a Series instead of a Dataframe, so I transformed it. this is workaround below. grouped_columns = df.loc[partition].agg(aggregations, squeeze=False)
sensitive_counts = df.loc[partition].groupby(sensitive_column).agg({sensitive_column : 'count'})
#insert
df2=grouped_columns.to_frame()
grouped_columns=pd.DataFrame(df2.values.T,columns=df2.index)
#insert_end |
I was able to make it work, I had to change the file anonypy.py on the lines 79 and 108 Replacing this line
with this one
Hope it helps. |
The text was updated successfully, but these errors were encountered: