Python pandas.core.indexes.base._try_get_item() Examples

The following are 5 code examples of pandas.core.indexes.base._try_get_item(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.core.indexes.base , or try the search function .
Example #1
Source File: numeric.py    From recruit with Apache License 2.0 6 votes vote down vote up
def __contains__(self, other):
        if super(Float64Index, self).__contains__(other):
            return True

        try:
            # if other is a sequence this throws a ValueError
            return np.isnan(other) and self.hasnans
        except ValueError:
            try:
                return len(other) <= 1 and ibase._try_get_item(other) in self
            except TypeError:
                pass
        except TypeError:
            pass

        return False 
Example #2
Source File: numeric.py    From vnpy_crypto with MIT License 6 votes vote down vote up
def __contains__(self, other):
        if super(Float64Index, self).__contains__(other):
            return True

        try:
            # if other is a sequence this throws a ValueError
            return np.isnan(other) and self.hasnans
        except ValueError:
            try:
                return len(other) <= 1 and ibase._try_get_item(other) in self
            except TypeError:
                pass
        except TypeError:
            pass

        return False 
Example #3
Source File: numeric.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 6 votes vote down vote up
def __contains__(self, other):
        if super(Float64Index, self).__contains__(other):
            return True

        try:
            # if other is a sequence this throws a ValueError
            return np.isnan(other) and self.hasnans
        except ValueError:
            try:
                return len(other) <= 1 and ibase._try_get_item(other) in self
            except TypeError:
                pass
        except TypeError:
            pass

        return False 
Example #4
Source File: numeric.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def __contains__(self, other):
        if super(Float64Index, self).__contains__(other):
            return True

        try:
            # if other is a sequence this throws a ValueError
            return np.isnan(other) and self.hasnans
        except ValueError:
            try:
                return len(other) <= 1 and ibase._try_get_item(other) in self
            except TypeError:
                return False
        except:
            return False 
Example #5
Source File: numeric.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def __contains__(self, other):
        if super(Float64Index, self).__contains__(other):
            return True

        try:
            # if other is a sequence this throws a ValueError
            return np.isnan(other) and self.hasnans
        except ValueError:
            try:
                return len(other) <= 1 and ibase._try_get_item(other) in self
            except TypeError:
                return False
        except:
            return False