Open
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).