-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
API DesignIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
The implementation of Series.get
currenlty simply is:
def get(self, key, default=None):
try:
return self[key]
except (KeyError, ValueError, IndexError):
return default
So it is simply using []
/ __getitem__
under the hood.
Somehow I think this is the expected thing, but the consequence is that it brings along all complexities of __getitem__
in pandas (whether to fallback to positional or not ..).
So, if we want, we could make get
more strict by using loc
under the hood (and it should be possible to do that with a deprecation in a first phase for those cases that loc
raises but []
returns a value).
Metadata
Metadata
Assignees
Labels
API DesignIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action