def get_value(self, series, key):
if isinstance(key, datetime):<EOL><INDENT>if self.tz is not None:<EOL><INDENT>if key.tzinfo is not None:<EOL><INDENT>key = Timestamp(key).tz_convert(self.tz)<EOL><DEDENT>else:<EOL><INDENT>key = Timestamp(key).tz_localize(self.tz)<EOL><DEDENT><DEDENT>return self.get_value_maybe_box(series, key)<EOL><DEDENT>if isinstance(key, time):<EOL><INDENT>locs = self.indexer_at_time(key)<EOL>return series.take(locs)<EOL><DEDENT>try:<EOL><INDENT>return com.maybe_box(self, Index.get_value(self, series, key),<EOL>series, key)<EOL><DEDENT>except KeyError:<EOL><INDENT>try:<EOL><INDENT>loc = self._get_string_slice(key)<EOL>return series[loc]<EOL><DEDENT>except (TypeError, ValueError, KeyError):<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>return self.get_value_maybe_box(series, key)<EOL><DEDENT>except (TypeError, ValueError, KeyError):<EOL><INDENT>raise KeyError(key)<EOL><DEDENT><DEDENT>
Fast lookup of value from 1-dimensional ndarray. Only use this if you
know what you're doing