Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Test/fix case where use of "All" causes problems in pivot_table with margins=True #3335
Comments
jreback
modified the milestone: 0.15.0, 0.14.0
Mar 11, 2014
jreback
added the
Good as first PR
label
Jan 26, 2015
jreback
modified the milestone: 0.16.0
Jan 26, 2015
TheInan
commented
Mar 30, 2015
|
I'd like to take a stab at this if no one minds |
|
go for it! |
TheInan
commented
Apr 27, 2015
|
Would it be an appropriate solution to have any instances of "All" used as an index or column changed to "All_" in the original dataframe and the resulting pivot table so that having a user use "All" as a column name will not cause issues anymore? |
|
I'm not sure exactly what "problems" are caused by this issue, but generally speaking it's a better idea to raise an exception and force users to take some fallback action themselves rather than silently proceeding with some guess about user intent. |
TheInan
commented
Apr 27, 2015
|
Alright then, I think I'll just scan the DataFrame for any instances of All being used as a value or column title, and if there is one, I'll raise an exception. The problem was that when margins was passed in as true, columns with the title "All" were added to the dataframe, and then add a later point, instances of "All" columns had aggregates data filled into them, so if the original data used "All" it was being replaced I think |
|
need to define what is the incorrect behavior here first. |
jreback
added this to the
Next Major Release
milestone
Apr 28, 2015
TheInan
commented
May 2, 2015
|
So this is what I have so far showing the issue. What happens is that when aggregating the data, as the script is going through the columns, it looks for All columns to aggregate data under. When "foo" was changed to "All" in the next DataFrame, the output is clearly nothing like that of the first pivot table. As a result, its probably most appropriate to raise an error when "All" is being used as a data point since it would be more trouble than its worth to rewrite the code around just this corner case.
|
lexual
referenced
this issue
Jun 6, 2015
Closed
ENH: #3335 Pivot table support for setting name of margins column. #10296
lexual
added a commit
to lexual/pandas
that referenced
this issue
Jun 6, 2015
|
|
lexual |
618110c
|
lexual
referenced
this issue
Nov 12, 2015
Merged
ENH: #3335 Pivot table support for setting name of margins column. #11581
lexual
added a commit
to lexual/pandas
that referenced
this issue
Nov 15, 2015
|
|
lexual |
1ca006c
|
jreback
modified the milestone: 0.17.1, Next Major Release
Nov 15, 2015
jreback
closed this
in #11581
Nov 15, 2015
jreback
added a commit
that referenced
this issue
Nov 15, 2015
|
|
jreback |
10fe47e
|
wesm commentedApr 13, 2013
No description provided.