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

ENH: Allow for custom variable/value column names when melt()'ing #3649

Merged
merged 3 commits into from May 21, 2013

Conversation

@hoechenberger
Copy link
Contributor

commented May 19, 2013

ENH, CLN: When melt()'ing, allow for specification of custom variable and value names of the resulting DataFrame. Also fix indentation in melt() example to reflect actual output.

ENH, CLN: When melt()'ing, allow for specification of custom variable…
… and value names of the resulting DataFrame. Also fix indentation in melt() example to reflect actual output.
@jreback

This comment has been minimized.

Copy link
Contributor

commented May 19, 2013

can u add a test and release notes mention (doc string example in v0.11.1 if u want too)
thxs

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 20, 2013

can you connect travis? see CONTRIBUTING.md for instructions....

and for a couple of the tests can you do something like:

result = melt......
expected = ......
tm.assert_frame_equal(result,expected)

to actually compare values and indicies (in this case its actually important as you are provide
some new functionaility that changes the column names, need to have a test for that)

similar to how test_pairs tests things (but doesn't have to be extensive....just a couple
of cases to make sure that melt is doing what you ask in various scenarios)

e.g. empty frame
incorrect frame
etc..

thanks

@hoechenberger

This comment has been minimized.

Copy link
Contributor Author

commented May 20, 2013

Thanks for your helpful feedback! I'm completely new to Python, testing, and Git(hub) :) I will try to improve my contribution. Stay tuned!

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 20, 2013

@hoechenberger see if you can connect travis on this....thxs

@hoechenberger

This comment has been minimized.

Copy link
Contributor Author

commented May 20, 2013

I will look into this tomorrow, thanks! :)

@hoechenberger

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2013

Now I'm wondering whether, as part of a good practice, I should create my test DataFrames manually or via methods from pandas.util.testing? I see both methods used across the pandas testing code...

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 21, 2013

you do either -

whatever works for testing te feature u r doing
you also might find makeCustomDataFrame useful (in testing as well)
since u r testing reshaping

@hoechenberger

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2013

I think I sort of srewed the branching here. But eventually got things merged back into the master branch. Travis-CI is currently testing the code, I'm excited.

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 21, 2013

to avoid pulling in the merge to this branch, do this:

git br this_branch --set-upstream master

then

git checkout master
git pull

updates master

git checkout this_branch
git pull --rebase

will pull in any changes w/o creating a merge commit
you might need to fix any conflicts

separately, pls rebase this to 1 or more commits (and you can eliminate the merge commit too)

git checkout this_branch
git rebase -i <commit prior to your branch>

remove the line of the merge branches
you can s to meld commits together

when done

git push origin this_branch -f

will replace all of the commits on this branch with the new ones
(with out the f it appends the newest commits)

@hoechenberger

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2013

Thanks! I think it's finally in a useful shape, no? :)

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 21, 2013

yes...that looks good.....once travis finishes will merge

thanks

git is an animal...once you tame it, its your friend :)

@hoechenberger

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2013

Great, thanks! I'm crossing my fingers ;)

jreback added a commit that referenced this pull request May 21, 2013
Merge pull request #3649 from hoechenberger/master
ENH: Allow for custom variable/value column names when melt()'ing

@jreback jreback merged commit 4c12848 into pandas-dev:master May 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.