Skip to content

API: should allow setting with enlargement with list-likes #7887

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

Closed
jreback opened this issue Jul 31, 2014 · 8 comments
Closed

API: should allow setting with enlargement with list-likes #7887

jreback opened this issue Jul 31, 2014 · 8 comments
Labels
Deprecate Functionality to remove in pandas Indexing Related to indexing on series/frames, not to indexes themselves

Comments

@jreback
Copy link
Contributor

jreback commented Jul 31, 2014

from #7867

In [1]: s = pd.Series([1,2,3])

In [2]: s
Out[2]: 
0    1
1    2
2    3
dtype: int64

# this is de-facto: s.reindex([[1,2,3]])
In [3]: s.loc[[1,2,3]]
Out[3]: 
1     2
2     3
3   NaN
dtype: float64

should this work?

In [4]: s.loc[[1,2,3]] = 4
KeyError: '[3] not in index'

(Doing this with only included labels works)

@jreback jreback added this to the 0.15.0 milestone Jul 31, 2014
@jreback
Copy link
Contributor Author

jreback commented Jul 31, 2014

cc @immerrr

@jreback jreback modified the milestones: 0.15.1, 0.15.0 Sep 9, 2014
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@hgilde
Copy link

hgilde commented Mar 23, 2017

did this turn out to be harder than it seems?

@jreback
Copy link
Contributor Author

jreback commented Mar 23, 2017

@hgilde no-one has worked on this (and we might eliminate this behavior going forward anyhow).

@hgilde
Copy link

hgilde commented Mar 24, 2017

@jreback hmm, link to the discussion about changing indexing behavior?

@jreback
Copy link
Contributor Author

jreback commented Mar 24, 2017

#15747

@jbrockmendel
Copy link
Member

having spent most of the last couple days on the relevant code in ILoc._setitem_with_indexer, I lean towards "no". figuring out when we need to do expansion is a PITA

@jreback
Copy link
Contributor Author

jreback commented Oct 15, 2020

even better we should deprecate this entirely

@mroeschke mroeschke added Deprecate Functionality to remove in pandas and removed API Design Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Apr 11, 2021
@mroeschke
Copy link
Member

Sounds like generally we dont want to do this anymore. Closing

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

No branches or pull requests

4 participants