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
multiple columns alias name is not effect! #128
Comments
`import pandas as pd data = pd.DataFrame({'pet': ['cat', 'dog', 'dog', 'fish', None, 'dog', 'cat', 'fish'], mapper = DataFrameMapper([ ['children_salary_0', 'children_salary_1', 'age_pet_0', 'age_pet_1'] |
I will try to solve this problem! |
Can you describe what do you expect vs. what is the current behavior? I don't quite understand where is the issue. The input |
@dukebody
Yes, the input alias1 is unuse, so I using the list:
But this code will raise error, so I update dataframe_mapper.py code, add some functions, hope it helps. The second result I expect it should be:
#129 checks failed, i don't know why. |
@devforfu finally remove these errors. |
@bifeng I believe you can get the columns you want using the right syntax with the
It outputs:
what is what you expect. Right? The problem in your original code is that if you use the feature definition:
then it applies the Let me know if the solution I outlined works for you. |
I think he wants to avoid redundancy. Actually, it might be best to allow an aliases variable in gen_features |
I honestly don't think it's too much writing... However to avoid redundancy one can write something like:
|
In that case, I have the feeling that we should modify gen_features (because it seems like your are essentially providing functionality of that function. |
@dukebody any update on adding list of aliases to |
['pet_cat', 'pet_dog', 'pet_fish', 'children_scaled_0', 'children_scaled_1', 'age']
The text was updated successfully, but these errors were encountered: