Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: Assigning Panel item using .ix/.loc no longer works #7763
Comments
|
hmm, must be an alignment issue. thanks, marking as a bug. note that
|
jreback
added Bug Indexing
labels
Jul 15, 2014
jreback
added this to the
0.15.0
milestone
Jul 15, 2014
spitz-dan-l
commented
Sep 3, 2014
|
Any update on this? I have a situation where I need to replace the columns of a 'minor'-oriented panel, necessitating Any suggested workarounds for this? |
|
that syntax should work |
spitz-dan-l
commented
Sep 3, 2014
|
Investigation showed what's different about my use case. My issue is I am trying to add columns. For the example above, my panel was set up like so:
I'm trying to add a 'd' column to the panel:
such that only the 'A' label gets its values replaced. For B and C, the 'd' column should be NaN. The way I'd thought to do it was:
But this doesn't add 'd'. I end up with:
Is this how it ought to behave? Am I asking for what I want the wrong way? |
spitz-dan-l
commented
Sep 3, 2014
|
@jreback yes. Example code: https://gist.github.com/spitz-dan-l/01a8e7788ffaeec87fd7 |
|
@spitz-dan-l prob best to just reindex the axes to the union of the axes you want e.g. something like
or you can use |
spitz-dan-l
commented
Sep 3, 2014
|
thanks! |
creeson commentedJul 15, 2014
I am updating a codebase from an OLD version of pandas (0.7.3) to current version (0.14.1).
The following code has stopped working correctly (using .ix[] or .loc[]):
Output:
However, if I simply do this:
It behaves as expected:
Also, if I assign more than just the item, it works fine:
Thanks.