Skip to content

Allow to provide custom column name for transformed feature #83

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

Closed
ragrawal opened this issue Apr 5, 2017 · 4 comments
Closed

Allow to provide custom column name for transformed feature #83

ragrawal opened this issue Apr 5, 2017 · 4 comments

Comments

@ragrawal
Copy link
Collaborator

ragrawal commented Apr 5, 2017

I have a datetime values in a column, "submitted_at", and I am trying to construct two features out of it, namely: day of week and hour of day. However the output dataframe contains "submitted_at" twice. Once for day of week feature and another for hour of day feature.

@dukebody
Copy link
Collaborator

dukebody commented Apr 8, 2017

Hi @ragrawal . Can you post the code you are using? You can always change afterwards the name of the output columns to the ones you want.

@dukebody
Copy link
Collaborator

dukebody commented Apr 8, 2017

Sorry, didn't really read the title of the issue. What do you think about an API like:

mapper = DataFrameMapper([
    ('target', Transformer1(), 'transformed_target_1'),
    ('target', Transformer2(), 'transformed_target_2')
])

Meaning that the result of applying Transformer1 to the column target should be placed in a column with name transformed_target_1, and equivalent for the second one?

This is probably quite easy to do by passing the chosen names to the get_names method, if present.

@ragrawal
Copy link
Collaborator Author

submitted a pull request related to this: #91

@dukebody
Copy link
Collaborator

Fixed in #92.

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

2 participants