def get_value(self, series, key):
<EOL>s = getattr(series, '<STR_LIT>', series)<EOL>if isinstance(s, (ExtensionArray, Index)) and is_scalar(key):<EOL><INDENT>try:<EOL><INDENT>iloc = self.get_loc(key)<EOL>return s[iloc]<EOL><DEDENT>except KeyError:<EOL><INDENT>if (len(self) > <NUM_LIT:0> and<EOL>(self.holds_integer() or self.is_boolean())):<EOL><INDENT>raise<EOL><DEDENT>elif is_integer(key):<EOL><INDENT>return s[key]<EOL><DEDENT><DEDENT><DEDENT>s = com.values_from_object(series)<EOL>k = com.values_from_object(key)<EOL>k = self._convert_scalar_indexer(k, kind='<STR_LIT>')<EOL>try:<EOL><INDENT>return self._engine.get_value(s, k,<EOL>tz=getattr(series.dtype, '<STR_LIT>', None))<EOL><DEDENT>except KeyError as e1:<EOL><INDENT>if len(self) > <NUM_LIT:0> and (self.holds_integer() or self.is_boolean()):<EOL><INDENT>raise<EOL><DEDENT>try:<EOL><INDENT>return libindex.get_value_box(s, key)<EOL><DEDENT>except IndexError:<EOL><INDENT>raise<EOL><DEDENT>except TypeError:<EOL><INDENT>if is_iterator(key):<EOL><INDENT>raise InvalidIndexError(key)<EOL><DEDENT>else:<EOL><INDENT>raise e1<EOL><DEDENT><DEDENT>except Exception:  <EOL><INDENT>raise e1<EOL><DEDENT><DEDENT>except TypeError:<EOL><INDENT>if is_scalar(key):  <EOL><INDENT>raise IndexError(key)<EOL><DEDENT>raise InvalidIndexError(key)<EOL><DEDENT>
Fast lookup of value from 1-dimensional ndarray. Only use this if you
know what you're doing.