Skip to content

Fix right hand side dict assignment for DataFrames #9877

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

Merged
merged 4 commits into from
Apr 14, 2015
Merged

Fix right hand side dict assignment for DataFrames #9877

merged 4 commits into from
Apr 14, 2015

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Apr 13, 2015

closes #9874

@cpcloud cpcloud self-assigned this Apr 13, 2015
@cpcloud cpcloud added this to the 0.16.1 milestone Apr 13, 2015
@cpcloud cpcloud added Bug Indexing Related to indexing on series/frames, not to indexes themselves labels Apr 13, 2015
cpcloud added a commit that referenced this pull request Apr 14, 2015
Fix right hand side dict assignment for DataFrames
@cpcloud cpcloud merged commit 74f7c26 into pandas-dev:master Apr 14, 2015
@cpcloud cpcloud deleted the fix-index-dict-assign branch April 14, 2015 14:15
@@ -249,6 +249,14 @@ new column.
If you are using the IPython environment, you may also use tab-completion to
see these accessible attributes.

You can also assign a ``dict`` to a row of a ``DataFrame``:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you maybe specify here that the dict keys are matched with the column names?

@jreback
Copy link
Contributor

jreback commented May 27, 2015

@tjragan that's very odd to do anyhow. Supported for nested data structues is very limited, especially with indexing operations.

@tjragan
Copy link

tjragan commented May 27, 2015

It may be odd, but I have a fairly complex data analysis project that uses this extensively. In any case, preserving pandas’ ability to store arbitrary python objects seems like a good idea, and this essentially removes the ability to have a key-value store in a cell.

Dr. T.J. Ragan
Research Associate

Department of Biochemistry, University of Leicester
Henry Wellcome Building, Lancaster Road
Leicester LE1 9HN, United Kingdom

On 27 May 2015, at 11:57, jreback <[email protected]mailto:[email protected]> wrote:

@tjraganhttps://github.com/tjragan that's very odd to do anyhow. Supported for nested data structues is very limited, especially with indexing operations.


Reply to this email directly or view it on GitHubhttps://github.com//pull/9877#issuecomment-105868361.

@jreback
Copy link
Contributor

jreback commented May 27, 2015

@tjragan what version of pandas are you using where this actually works? it doesn't work in >=0.14.1

@tjragan
Copy link

tjragan commented May 27, 2015

it broke when I installed 0.16.1, but works in 0.16.0

On 27 May 2015, at 20:56, jreback <[email protected]mailto:[email protected]> wrote:

@tjraganhttps://github.com/tjragan what version of pandas are you using where this actually works? it doesn't work in >=0.14.1


Reply to this email directly or view it on GitHubhttps://github.com//pull/9877#issuecomment-106053838.

@jreback
Copy link
Contributor

jreback commented May 27, 2015

ok, see #10219

pull-requests to fix are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dictionary assignment with loc with existing index doesn't properly match column names in dict
4 participants