-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Allow Panel to expand along major and minor indexes #4979
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
Comments
you are asking for 2 different things, arithmetic alignment (see issue #4971), and arbitrary indexing, implemented here (for 0.13): http://pandas.pydata.org/pandas-docs/dev/whatsnew.html#indexing-api-changes can you show a use case (with code). can incoporate as tests. |
I think I got the formatting right Thanks! I should start using the dev version, instead of release! |
fyi...you should use |
Yep. I've gotten into the habit of using pylab as my swissknife, because it imports a bunch of other stuff automatically! |
this is enabled from this issue (in 0.13): #2578 |
Thanks! |
Hey maybe I've misread the above but to me it seems this still isn't working on v0.13.1 ? Running the code above given by kghose and displaying 'pn['C']' (to view df2) yields
even though expected would be
if I understand this issue correctly? |
no when you do an assignment (this applies to Series,DataFrame, or Panel). The object being assigned is aligned with the existing, meaning it will have the same indicies. Any additional indicies of the object being aligned (e.g. all of them in df2) are essentially discarded. You could do what you want say with a concat which makes a union of the indicies. (Assignment with alignment is kind of like a left join) |
related #4971
Currently Panel will allow us to expand along the items dimension and will align cells in added DataFrames to the current major and minor indexes. However, if our DataFrame has a major or minor indexes not present in the original Panel, our append will silently fail (NaN s will populate the whole item)
I feel that a more natural behavior is for the Panel to expand along its major and minor axes to accomodate the new data.
I have to add here that I am really enjoying Panel and I find the logical progression from Series -> DataFrame -> Panel very well thought out.
Thanks.
The text was updated successfully, but these errors were encountered: