Skip to content

BUG: Fix setitem with 1d matrix #44669

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 10 commits into from
Dec 14, 2021
Merged

Conversation

ivirshup
Copy link
Contributor

@ivirshup ivirshup commented Nov 29, 2021

Fixes the case df["mean"] = sparse.random(100, 10).mean(axis=1) assigning a broken column.

Wasn't sure where the test should go, I feel like there must be a test for x = np.ones((10, 1)); df["x"] = x somewhere.

@ivirshup ivirshup changed the title Fix setitem with 1d matrix BUG: Fix setitem with 1d matrix Nov 29, 2021
@ivirshup
Copy link
Contributor Author

Tests fail with the new array manager, but don't with the block manager. Not sure what I should do about that, as it's unclear if this is intentional.

@jreback jreback added the Constructors Series/DataFrame/Index/pd.array Constructors label Nov 29, 2021
@ivirshup
Copy link
Contributor Author

ivirshup commented Dec 2, 2021

What should be done about the tests failing with the new data manager?

I, personally, would expect the two dimensional array that only has multiple indices along one dimension to keep working for column assignment.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

pls add a whatsnew note. i think you can just skip for array manager for now. or fix it.

@ivirshup
Copy link
Contributor Author

ivirshup commented Dec 6, 2021

pls add a whatsnew note

Added

i think you can just skip for array manager for now. or fix it.

I'm a bit short on time for the moment, so I'd opt to skip it.

I've opened an issue for this: #44788

Is there documentation somewhere about what the new array manager is exactly? My assumption is it's around the BlockManager rewrite?

@jreback
Copy link
Contributor

jreback commented Dec 6, 2021

use @td.skip_array_manager_not_yet_implemented (and put the reference to the issue you are skipping).

or can do like this

pandas/tests/reshape/concat/test_concat.py: def test_concat_copy(self, using_array_manager): (see that test)

@ivirshup
Copy link
Contributor Author

ivirshup commented Dec 6, 2021

Added the skip, I think the remaining CI failures are unrelated.

@jbrockmendel
Copy link
Member

Is there documentation somewhere about what the new array manager is exactly?

Not really. I think there has been reticence to put it in the public docs because it is still experimental and may be removed.

@ivirshup
Copy link
Contributor Author

ivirshup commented Dec 9, 2021

I think there has been reticence to put it in the public docs because it is still experimental and may be removed.

Might be useful to mention in the contributing docs. It was a little confusing why tests were failing on CI at first.


Was there anything else I should do here?

@jbrockmendel
Copy link
Member

Was there anything else I should do here?

just merge master pls

@jreback jreback added this to the 1.4 milestone Dec 14, 2021
@jreback jreback merged commit 01f4b7b into pandas-dev:master Dec 14, 2021
@jreback
Copy link
Contributor

jreback commented Dec 14, 2021

thanks @ivirshup very nice. sorry for the delay, quite a number of ci issues came up of late.

@ivirshup
Copy link
Contributor Author

No worries, thanks for the merge!

simonjayhawkins added a commit to simonjayhawkins/pandas that referenced this pull request Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Constructors Series/DataFrame/Index/pd.array Constructors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: 1.3.0 column assignment via single columnnp.matrix behaviour change
3 participants