/* Generated by Cython 0.15.1 on Sun Jul 22 15:37:35 2012 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else

#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif

#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif

#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif

#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)

#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif

#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__pandas__lib
#define __PYX_HAVE_API__pandas__lib
#include "stdio.h"
#include "stdlib.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "pythread.h"
#include "stdint.h"
#include "datetime.h"
#include "datetime_helper.h"
#include "numpy/ndarrayobject.h"
#include "numpy_helper.h"
#include "numpy/npy_common.h"
#include "datetime/np_datetime.h"
#include "datetime/np_datetime_strings.h"
#include "khash.h"
#include "math.h"
#include "kvec.h"
#include "skiplist.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || defined(__INTEL_COMPILER)
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif

#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif

static const char *__pyx_f[] = {
  "datetime.pyx",
  "stats.pyx",
  "inference.pyx",
  "tseries.pyx",
  "hashtable.pyx",
  "groupby.pyx",
  "properties.pyx",
  "skiplist.pyx",
  "moments.pyx",
  "reindex.pyx",
  "reduce.pyx",
  "join.pyx",
  "engines.pyx",
  "numpy.pxd",
  "util.pxd",
  "bool.pxd",
  "complex.pxd",
  "datetime.pxd",
};

/* "numpy.pxd":724
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "numpy.pxd":725
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "numpy.pxd":726
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "numpy.pxd":727
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "numpy.pxd":731
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "numpy.pxd":732
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "numpy.pxd":733
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "numpy.pxd":734
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "numpy.pxd":738
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "numpy.pxd":739
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "numpy.pxd":748
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "numpy.pxd":749
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "numpy.pxd":750
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "numpy.pxd":752
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "numpy.pxd":753
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "numpy.pxd":754
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "numpy.pxd":756
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "numpy.pxd":757
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "numpy.pxd":759
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "numpy.pxd":760
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "numpy.pxd":761
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

/* "pandas/src/tseries.pyx":56
 * cdef inline int int_min(int a, int b): return a if a <= b else b
 * 
 * ctypedef unsigned char UChar             # <<<<<<<<<<<<<<
 * 
 * cimport util
 */
typedef unsigned char __pyx_t_6pandas_3lib_UChar;

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

/*--- Type declarations ---*/
struct __pyx_obj_6pandas_3lib_SeriesBinGrouper;
struct __pyx_obj_6pandas_3lib_IndexableSkiplist;
struct __pyx_obj_6pandas_3lib_IndexEngine;
struct __pyx_obj_6pandas_3lib_ObjectEngine;
struct __pyx_obj_6pandas_3lib_DictFactorizer;
struct __pyx_obj_6pandas_3lib_Int64Engine;
struct __pyx_obj_6pandas_3lib_DatetimeEngine;
struct __pyx_obj_6pandas_3lib_Float64Engine;
struct __pyx_obj_6pandas_3lib__TSObject;
struct __pyx_obj_6pandas_3lib_HashTable;
struct __pyx_obj_6pandas_3lib_PyObjectHashTable;
struct __pyx_obj_6pandas_3lib_Int32HashTable;
struct __pyx_obj_6pandas_3lib_Int64HashTable;
struct __pyx_obj_6pandas_3lib_SeriesIndex;
struct __pyx_obj_6pandas_3lib_Factorizer;
struct __pyx_obj_6pandas_3lib__PandasNull;
struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates;
struct __pyx_obj_6pandas_3lib_ObjectVector;
struct __pyx_obj_6pandas_3lib_Int64Factorizer;
struct __pyx_obj_6pandas_3lib_cache_readonly;
struct __pyx_obj_6pandas_3lib_AxisProperty;
struct __pyx_obj_6pandas_3lib__Timestamp;
struct __pyx_obj_6pandas_3lib_SeriesGrouper;
struct __pyx_obj_6pandas_3lib_Reducer;
struct __pyx_obj_6pandas_3lib_Slider;
struct __pyx_obj_6pandas_3lib__NaT;
struct __pyx_obj_6pandas_3lib_Int64Vector;
struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time;
struct __pyx_obj_6pandas_3lib_ValuesProperty;
struct __pyx_obj_6pandas_3lib_Node;
struct __pyx_obj_6pandas_3lib_StringHashTable;
struct __pyx_obj_6pandas_3lib_Float64HashTable;

/* "numpy.pxd":763
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "numpy.pxd":764
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "numpy.pxd":765
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "numpy.pxd":767
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_opt_args_6pandas_3lib_convert_to_tsobject;
struct __pyx_t_6pandas_3lib_pairs;

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":484
 * 
 * # helper to extract datetime and int64 from several different possibilities
 * cpdef convert_to_tsobject(object ts, object tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Extract datetime and int64 from any of:
 */
struct __pyx_opt_args_6pandas_3lib_convert_to_tsobject {
  int __pyx_n;
  PyObject *tz;
};

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":523
 * # Rolling median, min, max
 * 
 * ctypedef double_t (* skiplist_f)(object sl, int n, int p)             # <<<<<<<<<<<<<<
 * 
 * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op):
 */
typedef __pyx_t_5numpy_double_t (*__pyx_t_6pandas_3lib_skiplist_f)(PyObject *, int, int);

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":651
 * # https://github.com/kwgoodman/bottleneck
 * 
 * cdef struct pairs:             # <<<<<<<<<<<<<<
 *     double value
 *     int death
 */
struct __pyx_t_6pandas_3lib_pairs {
  double value;
  int death;
};

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":109
 *         return result
 * 
 * cdef class SeriesBinGrouper:             # <<<<<<<<<<<<<<
 *     '''
 *     Performs grouping operation according to bin edges, rather than labels
 */
struct __pyx_obj_6pandas_3lib_SeriesBinGrouper {
  PyObject_HEAD
  Py_ssize_t nresults;
  Py_ssize_t ngroups;
  int passed_dummy;
  PyObject *arr;
  PyObject *index;
  PyObject *dummy;
  PyObject *f;
  PyObject *bins;
};


/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":46
 * NIL = Node(np.inf, [], [])
 * 
 * cdef class IndexableSkiplist:             # <<<<<<<<<<<<<<
 *     '''
 *     Sorted collection supporting O(lg n) insertion, removal, and
 */
struct __pyx_obj_6pandas_3lib_IndexableSkiplist {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *__pyx_vtab;
  Py_ssize_t size;
  Py_ssize_t maxlevels;
  struct __pyx_obj_6pandas_3lib_Node *head;
};


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":52
 * 
 * 
 * cdef class IndexEngine:             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly:
 */
struct __pyx_obj_6pandas_3lib_IndexEngine {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *__pyx_vtab;
  PyObject *vgetter;
  struct __pyx_obj_6pandas_3lib_HashTable *mapping;
  int over_size_threshold;
  int unique;
  int monotonic;
  int initialized;
  int monotonic_check;
  int unique_check;
};


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":346
 * }
 * 
 * cdef class ObjectEngine(IndexEngine):             # <<<<<<<<<<<<<<
 * 
 *     # cdef PyObjectHashTable mapping
 */
struct __pyx_obj_6pandas_3lib_ObjectEngine {
  struct __pyx_obj_6pandas_3lib_IndexEngine __pyx_base;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":915
 * 
 * 
 * cdef class DictFactorizer:             # <<<<<<<<<<<<<<
 * 
 *     cdef public:
 */
struct __pyx_obj_6pandas_3lib_DictFactorizer {
  PyObject_HEAD
  PyObject *table;
  PyObject *uniques;
  Py_ssize_t count;
};


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":263
 * 
 * 
 * cdef class Int64Engine(IndexEngine):             # <<<<<<<<<<<<<<
 * 
 *     # cdef Int64HashTable mapping
 */
struct __pyx_obj_6pandas_3lib_Int64Engine {
  struct __pyx_obj_6pandas_3lib_IndexEngine __pyx_base;
};


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":365
 * 
 * 
 * cdef class DatetimeEngine(Int64Engine):             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, object val):
 */
struct __pyx_obj_6pandas_3lib_DatetimeEngine {
  struct __pyx_obj_6pandas_3lib_Int64Engine __pyx_base;
};


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":316
 *         return result
 * 
 * cdef class Float64Engine(IndexEngine):             # <<<<<<<<<<<<<<
 * 
 *     # cdef Float64HashTable mapping
 */
struct __pyx_obj_6pandas_3lib_Float64Engine {
  struct __pyx_obj_6pandas_3lib_IndexEngine __pyx_base;
};


/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":473
 * 
 * # lightweight C object to hold datetime & int64 pair
 * cdef class _TSObject:             # <<<<<<<<<<<<<<
 *     cdef:
 *         pandas_datetimestruct dts      # pandas_datetimestruct
 */
struct __pyx_obj_6pandas_3lib__TSObject {
  PyObject_HEAD
  pandas_datetimestruct dts;
  __pyx_t_5numpy_int64_t value;
  PyObject *tzinfo;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":90
 * 
 * 
 * cdef class HashTable:             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_6pandas_3lib_HashTable {
  PyObject_HEAD
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":676
 *         return uniques
 * 
 * cdef class PyObjectHashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_pymap_t *table
 * 
 */
struct __pyx_obj_6pandas_3lib_PyObjectHashTable {
  struct __pyx_obj_6pandas_3lib_HashTable __pyx_base;
  struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable *__pyx_vtab;
  kh_pymap_t *table;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":220
 *         return reverse, labels, counts[:count].copy()
 * 
 * cdef class Int32HashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_int32_t *table
 * 
 */
struct __pyx_obj_6pandas_3lib_Int32HashTable {
  struct __pyx_obj_6pandas_3lib_HashTable __pyx_base;
  struct __pyx_vtabstruct_6pandas_3lib_Int32HashTable *__pyx_vtab;
  kh_int32_t *table;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":324
 *         return reverse, labels, counts[:count].copy()
 * 
 * cdef class Int64HashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_int64_t *table
 * 
 */
struct __pyx_obj_6pandas_3lib_Int64HashTable {
  struct __pyx_obj_6pandas_3lib_HashTable __pyx_base;
  struct __pyx_vtabstruct_6pandas_3lib_Int64HashTable *__pyx_vtab;
  kh_int64_t *table;
};


/* "/home/wesm/code/pandas/pandas/src/properties.pyx":45
 *         obj._set_axis(self.axis, value)
 * 
 * cdef class SeriesIndex(object):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object _check_type
 */
struct __pyx_obj_6pandas_3lib_SeriesIndex {
  PyObject_HEAD
  PyObject *_check_type;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":844
 * 
 * 
 * cdef class Factorizer:             # <<<<<<<<<<<<<<
 *     cdef public PyObjectHashTable table
 *     cdef public uniques
 */
struct __pyx_obj_6pandas_3lib_Factorizer {
  PyObject_HEAD
  struct __pyx_obj_6pandas_3lib_PyObjectHashTable *table;
  PyObject *uniques;
  Py_ssize_t count;
};


/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1379
 *     return counts
 * 
 * cdef class _PandasNull:             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(_PandasNull self, object other, int op):
 */
struct __pyx_obj_6pandas_3lib__PandasNull {
  PyObject_HEAD
};


/* "/home/wesm/code/pandas/pandas/src/inference.pyx":492
 *     return maybe_convert_objects(x, try_float=1)
 * 
 * def try_parse_dates(ndarray[object] values, parser=None,             # <<<<<<<<<<<<<<
 *                     dayfirst=False):
 *     cdef:
 */
struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates {
  PyObject_HEAD
  PyObject *__pyx_v_datetime;
  PyObject *__pyx_v_dayfirst;
  PyObject *__pyx_v_parse;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":47
 * 
 * 
 * cdef class ObjectVector:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_6pandas_3lib_ObjectVector {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pandas_3lib_ObjectVector *__pyx_vtab;
  kv_object_t vec;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":881
 * 
 * 
 * cdef class Int64Factorizer:             # <<<<<<<<<<<<<<
 *     cdef public Int64HashTable table
 *     cdef public list uniques
 */
struct __pyx_obj_6pandas_3lib_Int64Factorizer {
  PyObject_HEAD
  struct __pyx_obj_6pandas_3lib_Int64HashTable *table;
  PyObject *uniques;
  Py_ssize_t count;
};


/* "/home/wesm/code/pandas/pandas/src/properties.pyx":3
 * from cpython cimport PyDict_Contains, PyDict_GetItem, PyDict_GetItem
 * 
 * cdef class cache_readonly(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly:
 */
struct __pyx_obj_6pandas_3lib_cache_readonly {
  PyObject_HEAD
  PyObject *fget;
  PyObject *name;
};


/* "/home/wesm/code/pandas/pandas/src/properties.pyx":31
 *             return val
 * 
 * cdef class AxisProperty(object):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t axis
 */
struct __pyx_obj_6pandas_3lib_AxisProperty {
  PyObject_HEAD
  Py_ssize_t axis;
};


/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":365
 * # (see Timestamp class above). This will serve as a C extension type that
 * # shadows the python class, where we do any heavy lifting.
 * cdef class _Timestamp(datetime):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         int64_t value, nanosecond
 */
struct __pyx_obj_6pandas_3lib__Timestamp {
  PyDateTime_DateTime __pyx_base;
  struct __pyx_vtabstruct_6pandas_3lib__Timestamp *__pyx_vtab;
  __pyx_t_5numpy_int64_t value;
  __pyx_t_5numpy_int64_t nanosecond;
  PyObject *offset;
};


/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":215
 *         return result
 * 
 * cdef class SeriesGrouper:             # <<<<<<<<<<<<<<
 *     '''
 *     Performs generic grouping operation while avoiding ndarray construction
 */
struct __pyx_obj_6pandas_3lib_SeriesGrouper {
  PyObject_HEAD
  Py_ssize_t nresults;
  Py_ssize_t ngroups;
  int passed_dummy;
  PyObject *arr;
  PyObject *index;
  PyObject *dummy;
  PyObject *f;
  PyObject *labels;
};


/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":4
 * import numpy as np
 * 
 * cdef class Reducer:             # <<<<<<<<<<<<<<
 *     '''
 *     Performs generic reduction operation on a C or Fortran-contiguous ndarray
 */
struct __pyx_obj_6pandas_3lib_Reducer {
  PyObject_HEAD
  Py_ssize_t increment;
  Py_ssize_t chunksize;
  Py_ssize_t nresults;
  PyObject *arr;
  PyObject *dummy;
  PyObject *f;
  PyObject *labels;
  int can_set_name;
};


/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":326
 *         return result
 * 
 * cdef class Slider:             # <<<<<<<<<<<<<<
 *     '''
 *     Only handles contiguous data for now
 */
struct __pyx_obj_6pandas_3lib_Slider {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pandas_3lib_Slider *__pyx_vtab;
  PyArrayObject *values;
  PyArrayObject *buf;
  Py_ssize_t stride;
  Py_ssize_t orig_len;
  char *orig_data;
};


/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":440
 * 
 * 
 * cdef class _NaT(_Timestamp):             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(_NaT self, object other, int op):
 */
struct __pyx_obj_6pandas_3lib__NaT {
  struct __pyx_obj_6pandas_3lib__Timestamp __pyx_base;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":68
 * 
 * 
 * cdef class Int64Vector:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_6pandas_3lib_Int64Vector {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pandas_3lib_Int64Vector *__pyx_vtab;
  kv_int64_t vec;
};


/* "/home/wesm/code/pandas/pandas/src/inference.pyx":532
 *     return result
 * 
 * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times,             # <<<<<<<<<<<<<<
 *                             date_parser=None, time_parser=None,
 *                             dayfirst=False):
 */
struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time {
  PyObject_HEAD
  PyObject *__pyx_v_date;
  PyObject *__pyx_v_dayfirst;
  PyObject *__pyx_v_parse;
  PyObject *__pyx_v_time;
};


/* "/home/wesm/code/pandas/pandas/src/properties.pyx":61
 *         obj._index = self._check_type(value)
 * 
 * cdef class ValuesProperty(object):             # <<<<<<<<<<<<<<
 * 
 *     def __get__(self, obj, type):
 */
struct __pyx_obj_6pandas_3lib_ValuesProperty {
  PyObject_HEAD
};


/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":32
 * # TODO: optimize this, make less messy
 * 
 * cdef class Node:             # <<<<<<<<<<<<<<
 *     cdef public:
 *         double_t value
 */
struct __pyx_obj_6pandas_3lib_Node {
  PyObject_HEAD
  __pyx_t_5numpy_double_t value;
  PyObject *next;
  PyObject *width;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":94
 * 
 * 
 * cdef class StringHashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_str_t *table
 * 
 */
struct __pyx_obj_6pandas_3lib_StringHashTable {
  struct __pyx_obj_6pandas_3lib_HashTable __pyx_base;
  struct __pyx_vtabstruct_6pandas_3lib_StringHashTable *__pyx_vtab;
  kh_str_t *table;
};


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":564
 *     return result_keys, result_counts
 * 
 * cdef class Float64HashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_float64_t *table
 * 
 */
struct __pyx_obj_6pandas_3lib_Float64HashTable {
  struct __pyx_obj_6pandas_3lib_HashTable __pyx_base;
  struct __pyx_vtabstruct_6pandas_3lib_Float64HashTable *__pyx_vtab;
  kh_float64_t *table;
};



/* "/home/wesm/code/pandas/pandas/src/engines.pyx":52
 * 
 * 
 * cdef class IndexEngine:             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly:
 */

struct __pyx_vtabstruct_6pandas_3lib_IndexEngine {
  PyObject *(*get_value)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*set_value)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyArrayObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_loc)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_get_loc_duplicates)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *);
  PyObject *(*_maybe_get_bool_indexer)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *);
  PyObject *(*_do_monotonic_check)(struct __pyx_obj_6pandas_3lib_IndexEngine *);
  PyObject *(*_get_index_values)(struct __pyx_obj_6pandas_3lib_IndexEngine *);
  PyObject *(*_do_unique_check)(struct __pyx_obj_6pandas_3lib_IndexEngine *);
  PyObject *(*_make_hash_table)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *);
  PyObject *(*_check_type)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *);
  PyObject *(*_ensure_mapping_populated)(struct __pyx_obj_6pandas_3lib_IndexEngine *);
  PyObject *(*initialize)(struct __pyx_obj_6pandas_3lib_IndexEngine *);
};
static struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *__pyx_vtabptr_6pandas_3lib_IndexEngine;


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":263
 * 
 * 
 * cdef class Int64Engine(IndexEngine):             # <<<<<<<<<<<<<<
 * 
 *     # cdef Int64HashTable mapping
 */

struct __pyx_vtabstruct_6pandas_3lib_Int64Engine {
  struct __pyx_vtabstruct_6pandas_3lib_IndexEngine __pyx_base;
};
static struct __pyx_vtabstruct_6pandas_3lib_Int64Engine *__pyx_vtabptr_6pandas_3lib_Int64Engine;


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":346
 * }
 * 
 * cdef class ObjectEngine(IndexEngine):             # <<<<<<<<<<<<<<
 * 
 *     # cdef PyObjectHashTable mapping
 */

struct __pyx_vtabstruct_6pandas_3lib_ObjectEngine {
  struct __pyx_vtabstruct_6pandas_3lib_IndexEngine __pyx_base;
};
static struct __pyx_vtabstruct_6pandas_3lib_ObjectEngine *__pyx_vtabptr_6pandas_3lib_ObjectEngine;


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":365
 * 
 * 
 * cdef class DatetimeEngine(Int64Engine):             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, object val):
 */

struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine {
  struct __pyx_vtabstruct_6pandas_3lib_Int64Engine __pyx_base;
  PyObject *(*_date_check_type)(struct __pyx_obj_6pandas_3lib_DatetimeEngine *, PyObject *);
};
static struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *__pyx_vtabptr_6pandas_3lib_DatetimeEngine;


/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":46
 * NIL = Node(np.inf, [], [])
 * 
 * cdef class IndexableSkiplist:             # <<<<<<<<<<<<<<
 *     '''
 *     Sorted collection supporting O(lg n) insertion, removal, and
 */

struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist {
  PyObject *(*get)(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch);
  PyObject *(*insert)(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *, double, int __pyx_skip_dispatch);
  PyObject *(*remove)(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *, double, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *__pyx_vtabptr_6pandas_3lib_IndexableSkiplist;


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":324
 *         return reverse, labels, counts[:count].copy()
 * 
 * cdef class Int64HashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_int64_t *table
 * 
 */

struct __pyx_vtabstruct_6pandas_3lib_Int64HashTable {
  int (*has_key)(struct __pyx_obj_6pandas_3lib_Int64HashTable *, __pyx_t_5numpy_int64_t);
  PyObject *(*get_item)(struct __pyx_obj_6pandas_3lib_Int64HashTable *, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch);
  PyObject *(*set_item)(struct __pyx_obj_6pandas_3lib_Int64HashTable *, __pyx_t_5numpy_int64_t, Py_ssize_t, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_3lib_Int64HashTable *__pyx_vtabptr_6pandas_3lib_Int64HashTable;


/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":326
 *         return result
 * 
 * cdef class Slider:             # <<<<<<<<<<<<<<
 *     '''
 *     Only handles contiguous data for now
 */

struct __pyx_vtabstruct_6pandas_3lib_Slider {
  PyObject *(*advance)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch);
  PyObject *(*set_length)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch);
  PyObject *(*cleanup)(struct __pyx_obj_6pandas_3lib_Slider *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_3lib_Slider *__pyx_vtabptr_6pandas_3lib_Slider;


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":564
 *     return result_keys, result_counts
 * 
 * cdef class Float64HashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_float64_t *table
 * 
 */

struct __pyx_vtabstruct_6pandas_3lib_Float64HashTable {
  PyObject *(*get_labels)(struct __pyx_obj_6pandas_3lib_Float64HashTable *, PyArrayObject *, PyObject *, Py_ssize_t, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_3lib_Float64HashTable *__pyx_vtabptr_6pandas_3lib_Float64HashTable;


/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":365
 * # (see Timestamp class above). This will serve as a C extension type that
 * # shadows the python class, where we do any heavy lifting.
 * cdef class _Timestamp(datetime):             # <<<<<<<<<<<<<<
 *     cdef readonly:
 *         int64_t value, nanosecond
 */

struct __pyx_vtabstruct_6pandas_3lib__Timestamp {
  PyObject *(*_get_field)(struct __pyx_obj_6pandas_3lib__Timestamp *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_3lib__Timestamp *__pyx_vtabptr_6pandas_3lib__Timestamp;


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":94
 * 
 * 
 * cdef class StringHashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_str_t *table
 * 
 */

struct __pyx_vtabstruct_6pandas_3lib_StringHashTable {
  int (*check_type)(struct __pyx_obj_6pandas_3lib_StringHashTable *, PyObject *);
  PyObject *(*get_item)(struct __pyx_obj_6pandas_3lib_StringHashTable *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*set_item)(struct __pyx_obj_6pandas_3lib_StringHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_3lib_StringHashTable *__pyx_vtabptr_6pandas_3lib_StringHashTable;


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":68
 * 
 * 
 * cdef class Int64Vector:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

struct __pyx_vtabstruct_6pandas_3lib_Int64Vector {
  PyObject *(*append)(struct __pyx_obj_6pandas_3lib_Int64Vector *, __pyx_t_5numpy_int64_t);
};
static struct __pyx_vtabstruct_6pandas_3lib_Int64Vector *__pyx_vtabptr_6pandas_3lib_Int64Vector;


/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":440
 * 
 * 
 * cdef class _NaT(_Timestamp):             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(_NaT self, object other, int op):
 */

struct __pyx_vtabstruct_6pandas_3lib__NaT {
  struct __pyx_vtabstruct_6pandas_3lib__Timestamp __pyx_base;
};
static struct __pyx_vtabstruct_6pandas_3lib__NaT *__pyx_vtabptr_6pandas_3lib__NaT;


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":220
 *         return reverse, labels, counts[:count].copy()
 * 
 * cdef class Int32HashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_int32_t *table
 * 
 */

struct __pyx_vtabstruct_6pandas_3lib_Int32HashTable {
  int (*check_type)(struct __pyx_obj_6pandas_3lib_Int32HashTable *, PyObject *);
  PyObject *(*get_item)(struct __pyx_obj_6pandas_3lib_Int32HashTable *, __pyx_t_5numpy_int32_t, int __pyx_skip_dispatch);
  PyObject *(*set_item)(struct __pyx_obj_6pandas_3lib_Int32HashTable *, __pyx_t_5numpy_int32_t, Py_ssize_t, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_3lib_Int32HashTable *__pyx_vtabptr_6pandas_3lib_Int32HashTable;



/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":47
 * 
 * 
 * cdef class ObjectVector:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

struct __pyx_vtabstruct_6pandas_3lib_ObjectVector {
  PyObject *(*append)(struct __pyx_obj_6pandas_3lib_ObjectVector *, PyObject *);
};
static struct __pyx_vtabstruct_6pandas_3lib_ObjectVector *__pyx_vtabptr_6pandas_3lib_ObjectVector;


/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":676
 *         return uniques
 * 
 * cdef class PyObjectHashTable(HashTable):             # <<<<<<<<<<<<<<
 *     cdef kh_pymap_t *table
 * 
 */

struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable {
  PyObject *(*destroy)(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *, int __pyx_skip_dispatch);
  PyObject *(*get_item)(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*set_item)(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch);
  PyObject *(*get_labels)(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *, PyArrayObject *, PyObject *, Py_ssize_t, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable *__pyx_vtabptr_6pandas_3lib_PyObjectHashTable;


/* "/home/wesm/code/pandas/pandas/src/engines.pyx":316
 *         return result
 * 
 * cdef class Float64Engine(IndexEngine):             # <<<<<<<<<<<<<<
 * 
 *     # cdef Float64HashTable mapping
 */

struct __pyx_vtabstruct_6pandas_3lib_Float64Engine {
  struct __pyx_vtabstruct_6pandas_3lib_IndexEngine __pyx_base;
};
static struct __pyx_vtabstruct_6pandas_3lib_Float64Engine *__pyx_vtabptr_6pandas_3lib_Float64Engine;

#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif

#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  #define __Pyx_RefNannySetupContext(name)           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*proto*/

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/


static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}


#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}


#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
    PyObject *r;
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
        r = PySequence_GetItem(o, i);
    }
    else {
        r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
    }
    return r;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

/* Run-time type information about structs used with buffers */
struct __Pyx_StructField_;

typedef struct {
  const char* name; /* for error messages only */
  struct __Pyx_StructField_* fields;
  size_t size;     /* sizeof(type) */
  char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject */
} __Pyx_TypeInfo;

typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;

typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;


static CYTHON_INLINE int  __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);

static void __Pyx_RaiseBufferFallbackError(void); /*proto*/

static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) { 
    return unlikely(b < 0) ? b : !b; 
}
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
    return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
}
static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
#define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);

#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(d == Py_None)) {
        __Pyx_RaiseNoneIndexingError();
        return NULL;
    }
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred())
            PyErr_SetObject(PyExc_KeyError, key);
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))

static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}

static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        Py_INCREF(v);
        Py_DECREF(PyList_GET_ITEM(o, i));
        PyList_SET_ITEM(o, i, v);
        return 1;
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
        return PySequence_SetItem(o, i, v);
    else {
        PyObject *j = PyInt_FromSsize_t(i);
        return __Pyx_SetItemInt_Generic(o, j, v);
    }
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
    const char* function_name, int kw_allowed); /*proto*/

static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* proto */

static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */

static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */

static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */

#define __Pyx_PyObject_AsDouble(obj) \
    ((likely(PyFloat_CheckExact(obj))) ? \
     PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int64(npy_int64);
#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
#define __Pyx_GetBuffer PyObject_GetBuffer
#define __Pyx_ReleaseBuffer PyBuffer_Release
#endif

Py_ssize_t __Pyx_zeros[] = {0, 0};
Py_ssize_t __Pyx_minusones[] = {-1, -1};

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/

static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject *);

static CYTHON_INLINE npy_int64 __Pyx_PyInt_from_py_npy_int64(PyObject *);

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname); /*proto*/

#define __pyx_binding_PyCFunctionType_USED 1

typedef struct {
    PyCFunctionObject func;
} __pyx_binding_PyCFunctionType_object;

static PyTypeObject __pyx_binding_PyCFunctionType_type;
static PyTypeObject *__pyx_binding_PyCFunctionType = NULL;

static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */
#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL)

static int __pyx_binding_PyCFunctionType_init(void); /* proto */

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_uint32(npy_uint32);

static CYTHON_INLINE npy_uint32 __Pyx_PyInt_from_py_npy_uint32(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32);

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/

static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
#if PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/

#include <string.h>

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject*);

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif

#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq(a, b)   ((a)==(b))
    #define __Pyx_c_sum(a, b)  ((a)+(b))
    #define __Pyx_c_diff(a, b) ((a)-(b))
    #define __Pyx_c_prod(a, b) ((a)*(b))
    #define __Pyx_c_quot(a, b) ((a)/(b))
    #define __Pyx_c_neg(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero(z) ((z)==(double)0)
    #define __Pyx_c_conj(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (::std::abs(z))
        #define __Pyx_c_pow(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero(z) ((z)==0)
    #define __Pyx_c_conj(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (cabs(z))
        #define __Pyx_c_pow(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

static CYTHON_INLINE npy_uint8 __Pyx_PyInt_from_py_npy_uint8(PyObject *);

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eqf(a, b)   ((a)==(b))
    #define __Pyx_c_sumf(a, b)  ((a)+(b))
    #define __Pyx_c_difff(a, b) ((a)-(b))
    #define __Pyx_c_prodf(a, b) ((a)*(b))
    #define __Pyx_c_quotf(a, b) ((a)/(b))
    #define __Pyx_c_negf(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zerof(z) ((z)==(float)0)
    #define __Pyx_c_conjf(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_absf(z)     (::std::abs(z))
        #define __Pyx_c_powf(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zerof(z) ((z)==0)
    #define __Pyx_c_conjf(z)    (conjf(z))
    #if 1
        #define __Pyx_c_absf(z)     (cabsf(z))
        #define __Pyx_c_powf(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename); /*proto*/

static int __Pyx_check_binary_version(void);

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
                               int __pyx_lineno, const char *__pyx_filename); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

/* Module declarations from 'cpython.buffer' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from 'cpython.object' */

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/

/* Module declarations from 'cython.cython.view' */

/* Module declarations from 'cython' */

/* Module declarations from 'cpython.version' */

/* Module declarations from 'cpython.exc' */

/* Module declarations from 'cpython.module' */

/* Module declarations from 'cpython.mem' */

/* Module declarations from 'cpython.tuple' */

/* Module declarations from 'cpython.list' */

/* Module declarations from 'cpython.sequence' */

/* Module declarations from 'cpython.mapping' */

/* Module declarations from 'cpython.iterator' */

/* Module declarations from 'cpython.type' */

/* Module declarations from 'cpython.number' */

/* Module declarations from 'cpython.int' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

/* Module declarations from 'cpython.long' */

/* Module declarations from 'cpython.float' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

/* Module declarations from 'cpython.string' */

/* Module declarations from 'cpython.unicode' */

/* Module declarations from 'cpython.dict' */

/* Module declarations from 'cpython.instance' */

/* Module declarations from 'cpython.function' */

/* Module declarations from 'cpython.method' */

/* Module declarations from 'cpython.weakref' */

/* Module declarations from 'cpython.getargs' */

/* Module declarations from 'cpython.pythread' */

/* Module declarations from 'cpython.pystate' */

/* Module declarations from 'cpython.cobject' */

/* Module declarations from 'cpython.oldbuffer' */

/* Module declarations from 'cpython.set' */

/* Module declarations from 'cpython.bytes' */

/* Module declarations from 'cpython.pycapsule' */

/* Module declarations from 'cpython' */

/* Module declarations from 'datetime' */

/* Module declarations from 'datetime' */
static PyTypeObject *__pyx_ptype_8datetime_date = 0;
static PyTypeObject *__pyx_ptype_8datetime_datetime = 0;
static PyTypeObject *__pyx_ptype_8datetime_timedelta = 0;

/* Module declarations from 'khash' */

/* Module declarations from 'util' */
static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *); /*proto*/

/* Module declarations from 'skiplist' */

/* Module declarations from 'libc' */

/* Module declarations from 'pandas.lib' */
static PyTypeObject *__pyx_ptype_6pandas_3lib_ObjectVector = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Int64Vector = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_HashTable = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_StringHashTable = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Int32HashTable = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Int64HashTable = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Float64HashTable = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_PyObjectHashTable = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Factorizer = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Int64Factorizer = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_DictFactorizer = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib__Timestamp = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib__NaT = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib__TSObject = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Node = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_IndexableSkiplist = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib__PandasNull = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Reducer = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_SeriesBinGrouper = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_SeriesGrouper = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Slider = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_cache_readonly = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_AxisProperty = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_SeriesIndex = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_ValuesProperty = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_IndexEngine = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Int64Engine = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_Float64Engine = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_ObjectEngine = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib_DatetimeEngine = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct__try_parse_dates = 0;
static PyTypeObject *__pyx_ptype_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time = 0;
static __pyx_t_5numpy_int32_t __pyx_v_6pandas_3lib_MINint32;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_3lib_MINint64;
static __pyx_t_5numpy_float32_t __pyx_v_6pandas_3lib_MINfloat32;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_3lib_MINfloat64;
static __pyx_t_5numpy_int32_t __pyx_v_6pandas_3lib_MAXint32;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_3lib_MAXint64;
static __pyx_t_5numpy_float32_t __pyx_v_6pandas_3lib_MAXfloat32;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_3lib_MAXfloat64;
static double __pyx_v_6pandas_3lib_NaN;
static double __pyx_v_6pandas_3lib_nan;
static double __pyx_v_6pandas_3lib_NAN;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_3lib_NPY_NAT;
static int __pyx_v_6pandas_3lib__EPOCH_ORD;
static double __pyx_v_6pandas_3lib_INF;
static double __pyx_v_6pandas_3lib_NEGINF;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_3lib__NS_LOWER_BOUND;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_3lib__NS_UPPER_BOUND;
static __pyx_t_5numpy_int64_t __pyx_v_6pandas_3lib_DAY_NS;
static __pyx_t_5numpy_float64_t __pyx_v_6pandas_3lib_FP_ERR;
static int __pyx_v_6pandas_3lib_TIEBREAK_AVERAGE;
static int __pyx_v_6pandas_3lib_TIEBREAK_MIN;
static int __pyx_v_6pandas_3lib_TIEBREAK_MAX;
static int __pyx_v_6pandas_3lib_TIEBREAK_FIRST;
static int __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING;
static int __pyx_v_6pandas_3lib__SIZE_CUTOFF;
static CYTHON_INLINE int __pyx_f_6pandas_3lib_int_max(int, int); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_3lib_int_min(int, int); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_map_indices_list(PyObject *, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_gmtime(PyObject *); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_to_datetime(__pyx_t_5numpy_int64_t, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_to_timestamp(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_checknull(PyObject *, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_timestamp(PyObject *); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_get_value_box(PyArrayObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_3lib__is_multiple(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_convert_to_tsobject(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_convert_to_tsobject *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__check_dts_bounds(__pyx_t_5numpy_int64_t, pandas_datetimestruct *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__datetime64_to_datetime(__pyx_t_5numpy_int64_t); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__dts_to_pydatetime(pandas_datetimestruct *); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib__pydatetime_to_dts(PyObject *, pandas_datetimestruct *); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib__dtlike_to_datetime64(PyObject *, pandas_datetimestruct *); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib__date_to_datetime64(PyObject *, pandas_datetimestruct *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__string_to_dts(PyObject *, pandas_datetimestruct *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__get_datetime64_nanos(PyObject *); /*proto*/
static double __pyx_f_6pandas_3lib_total_seconds(PyObject *); /*proto*/
static PyArrayObject *__pyx_f_6pandas_3lib__unbox_utcoffsets(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6pandas_3lib__ensure_int64(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_bisect_right_i8(__pyx_t_5numpy_int64_t *, __pyx_t_5numpy_int64_t, Py_ssize_t); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_3lib_m8_weekday(__pyx_t_5numpy_int64_t); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_ts_dayofweek(struct __pyx_obj_6pandas_3lib__TSObject *); /*proto*/
static double __pyx_f_6pandas_3lib_Log2(double); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_groupby_indices_naive(PyArrayObject *, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_3lib__median_linear(__pyx_t_5numpy_float64_t *, int); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_kth_smallest_c(__pyx_t_5numpy_float64_t *, Py_ssize_t, Py_ssize_t); /*proto*/
static PyObject *__pyx_f_6pandas_3lib__roll_skiplist_op(PyArrayObject *, int, int, __pyx_t_6pandas_3lib_skiplist_f); /*proto*/
static __pyx_t_5numpy_double_t __pyx_f_6pandas_3lib__get_median(PyObject *, int, int); /*proto*/
static __pyx_t_5numpy_double_t __pyx_f_6pandas_3lib__get_max(PyObject *, int, int); /*proto*/
static __pyx_t_5numpy_double_t __pyx_f_6pandas_3lib__get_min(PyObject *, int, int); /*proto*/
static PyObject *__pyx_f_6pandas_3lib__take_2d_float64(PyArrayObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_6pandas_3lib__take_2d_int64(PyArrayObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_6pandas_3lib__take_2d_object(PyArrayObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_are_diff(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_datetime(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_date(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_time(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_is_definitely_invalid_key(PyObject *); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_convert_scalar(PyArrayObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__to_i8(PyObject *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), 'U' };
static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), 'O' };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), 'I' };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), 'R' };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), 'R' };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), 'I' };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t = { "int8_t", NULL, sizeof(__pyx_t_5numpy_int8_t), 'I' };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), 'R' };
static __Pyx_TypeInfo __Pyx_TypeInfo_Py_ssize_t = { "Py_ssize_t", NULL, sizeof(Py_ssize_t), 'I' };
static __Pyx_TypeInfo __Pyx_TypeInfo___pyx_t_double_complex = { "double complex", NULL, sizeof(__pyx_t_double_complex), 'C' };
#define __Pyx_MODULE_NAME "pandas.lib"
int __pyx_module_is_main_pandas__lib = 0;

/* Implementation of 'pandas.lib' */
static PyObject *__pyx_builtin_NameError;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_RuntimeError;
static char __pyx_k_1[] = "all arrays must be same length";
static char __pyx_k_5[] = "Unrecognized operator";
static char __pyx_k_7[] = "Arrays were different lengths: %d vs %d";
static char __pyx_k_10[] = "list_to_object_array";
static char __pyx_k_13[] = "Cannot convert a float to datetime";
static char __pyx_k_15[] = "%z";
static char __pyx_k_17[] = " %%Z, tz=%s";
static char __pyx_k_19[] = "<Timestamp: %s>";
static char __pyx_k_20[] = "%d-%.2d-%.2d %.2d:%.2d:%.2d";
static char __pyx_k_21[] = ".%.9d";
static char __pyx_k_22[] = ".%.6d";
static char __pyx_k_23[] = "pandas.tseries.period";
static char __pyx_k_26[] = "M8[ns]";
static char __pyx_k_28[] = "Cannot localize tz-aware Timestamp, use tz_convert for conversions";
static char __pyx_k_30[] = "Cannot convert tz-naive Timestamp, use tz_localize to localize";
static char __pyx_k_33[] = "Warning: discarding nonzero nanoseconds";
static char __pyx_k_34[] = "index out of bounds";
static char __pyx_k_37[] = "Cannot compare Timestamp with %s";
static char __pyx_k_38[] = "Cannot compare tz-naive and tz-aware timestamps";
static char __pyx_k_41[] = "Cannot add integral value to Timestamp without offset.";
static char __pyx_k_42[] = "_delta_to_nanoseconds";
static char __pyx_k_43[] = "Could not construct Timestamp from argument %s";
static char __pyx_k_44[] = "Out of bounds nanosecond timestamp: %s";
static char __pyx_k_45[] = "Unable to parse %s";
static char __pyx_k_48[] = "dateutil.parser";
static char __pyx_k_50[] = "Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True";
static char __pyx_k_52[] = "NumPy 1.6.1 business freq not supported";
static char __pyx_k_55[] = "First time before start of DST info";
static char __pyx_k_60[] = "_utc_transition_times";
static char __pyx_k_62[] = "Could not find pytz module";
static char __pyx_k_64[] = "Cannot localize, ambiguous time %s found";
static char __pyx_k_66[] = "NonExistentTimeError";
static char __pyx_k_74[] = "Field %s not supported";
static char __pyx_k_75[] = "bad month number 0; must be 1-12";
static char __pyx_k_77[] = "Not Found";
static char __pyx_k_79[] = "pandas._algos";
static char __pyx_k_80[] = "take_2d_axis1_float64";
static char __pyx_k_81[] = "Invalid length for values or for binner";
static char __pyx_k_83[] = "Values falls before first bin";
static char __pyx_k_85[] = "Values falls after last bin";
static char __pyx_k_87[] = "Output array must have 4 columns";
static char __pyx_k_89[] = "maybe_convert_objects";
static char __pyx_k_96[] = "min_periods must be >= 0";
static char __pyx_k_98[] = "Invalid window size %d for len %d array";
static char __pyx_k__B[] = "B";
static char __pyx_k__C[] = "C";
static char __pyx_k__D[] = "D";
static char __pyx_k__F[] = "F";
static char __pyx_k__H[] = "H";
static char __pyx_k__I[] = "I";
static char __pyx_k__L[] = "L";
static char __pyx_k__M[] = "M";
static char __pyx_k__N[] = "N";
static char __pyx_k__O[] = "O";
static char __pyx_k__Q[] = "Q";
static char __pyx_k__T[] = "T";
static char __pyx_k__Y[] = "Y";
static char __pyx_k__a[] = "a";
static char __pyx_k__b[] = "b";
static char __pyx_k__d[] = "d";
static char __pyx_k__f[] = "f";
static char __pyx_k__g[] = "g";
static char __pyx_k__h[] = "h";
static char __pyx_k__i[] = "i";
static char __pyx_k__k[] = "k";
static char __pyx_k__l[] = "l";
static char __pyx_k__m[] = "m";
static char __pyx_k__n[] = "n";
static char __pyx_k__q[] = "q";
static char __pyx_k__s[] = "s";
static char __pyx_k__u[] = "u";
static char __pyx_k_103[] = "Dummy array must be same dtype";
static char __pyx_k_105[] = "Dummy array must be length %d";
static char __pyx_k_106[] = "function does not reduce";
static char __pyx_k_116[] = "_has_complex_internals";
static char __pyx_k_117[] = "Cannot use shortcut";
static char __pyx_k_141[] = "first not supported for non-numeric data";
static char __pyx_k_151[] = "pandas.core.index";
static char __pyx_k_152[] = "Index length did not match values";
static char __pyx_k_155[] = "mixed-integer";
static char __pyx_k_156[] = "%s is wrong freq";
static char __pyx_k_158[] = "Empty string encountered";
static char __pyx_k_160[] = ".";
static char __pyx_k_161[] = "%m/%d/%Y";
static char __pyx_k_163[] = "pandas.lib";
static char __pyx_k_164[] = "%H:%M:%S";
static char __pyx_k_166[] = "Length of dates and times must be equal";
static char __pyx_k_168[] = "Length of years/months/days must all be equal";
static char __pyx_k_170[] = "Length of all datetime components must be equal";
static char __pyx_k_173[] = "";
static char __pyx_k_179[] = "is_monotonic_float64";
static char __pyx_k_187[] = "Cannot assign nan to integer series";
static char __pyx_k_189[] = "ndarray is not C contiguous";
static char __pyx_k_191[] = "ndarray is not Fortran contiguous";
static char __pyx_k_193[] = "Non-native byte order not supported";
static char __pyx_k_195[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_196[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_199[] = "Format string allocated too short.";
static char __pyx_k_203[] = "fast_unique_multiple";
static char __pyx_k_204[] = "fast_unique_multiple_list";
static char __pyx_k_205[] = "fast_unique_multiple_list_gen";
static char __pyx_k_206[] = "maybe_indices_to_slice";
static char __pyx_k_207[] = "maybe_booleans_to_slice";
static char __pyx_k_208[] = "func_groupby_indices";
static char __pyx_k_209[] = "take_join_contiguous";
static char __pyx_k_210[] = "maybe_convert_numeric";
static char __pyx_k_211[] = "try_parse_date_and_time";
static char __pyx_k_212[] = "try_parse_year_month_day";
static char __pyx_k_213[] = "try_parse_datetime_components";
static char __pyx_k_214[] = "tuples_to_object_array";
static char __pyx_k_215[] = "to_object_array_tuples";
static char __pyx_k__Zd[] = "Zd";
static char __pyx_k__Zf[] = "Zf";
static char __pyx_k__Zg[] = "Zg";
static char __pyx_k__eq[] = "eq";
static char __pyx_k__f8[] = "f8";
static char __pyx_k__ge[] = "ge";
static char __pyx_k__gt[] = "gt";
static char __pyx_k__i4[] = "i4";
static char __pyx_k__i8[] = "i8";
static char __pyx_k__le[] = "le";
static char __pyx_k__lt[] = "lt";
static char __pyx_k__ne[] = "ne";
static char __pyx_k__np[] = "np";
static char __pyx_k__ns[] = "ns";
static char __pyx_k__op[] = "op";
static char __pyx_k__ts[] = "ts";
static char __pyx_k__tz[] = "tz";
static char __pyx_k__us[] = "us";
static char __pyx_k__NIL[] = "NIL";
static char __pyx_k__NaN[] = "NaN";
static char __pyx_k__NaT[] = "NaT";
static char __pyx_k__UTC[] = "UTC";
static char __pyx_k__arg[] = "arg";
static char __pyx_k__arr[] = "arr";
static char __pyx_k__buf[] = "buf";
static char __pyx_k__c16[] = "c16";
static char __pyx_k__cls[] = "cls";
static char __pyx_k__com[] = "com";
static char __pyx_k__cov[] = "cov";
static char __pyx_k__day[] = "day";
static char __pyx_k__dow[] = "dow";
static char __pyx_k__doy[] = "doy";
static char __pyx_k__get[] = "get";
static char __pyx_k__inf[] = "inf";
static char __pyx_k__key[] = "key";
static char __pyx_k__loc[] = "loc";
static char __pyx_k__mat[] = "mat";
static char __pyx_k__max[] = "max";
static char __pyx_k__min[] = "min";
static char __pyx_k__nan[] = "nan";
static char __pyx_k__out[] = "out";
static char __pyx_k__put[] = "put";
static char __pyx_k__sum[] = "sum";
static char __pyx_k__tz1[] = "tz1";
static char __pyx_k__tz2[] = "tz2";
static char __pyx_k__utc[] = "utc";
static char __pyx_k__val[] = "val";
static char __pyx_k__win[] = "win";
static char __pyx_k__woy[] = "woy";
static char __pyx_k__NINF[] = "NINF";
static char __pyx_k__ONAN[] = "ONAN";
static char __pyx_k__True[] = "True";
static char __pyx_k__args[] = "args";
static char __pyx_k__asm8[] = "asm8";
static char __pyx_k__axes[] = "axes";
static char __pyx_k__axis[] = "axis";
static char __pyx_k__bins[] = "bins";
static char __pyx_k__copy[] = "copy";
static char __pyx_k__date[] = "date";
static char __pyx_k__days[] = "days";
static char __pyx_k__ddof[] = "ddof";
static char __pyx_k__ewma[] = "ewma";
static char __pyx_k__fget[] = "fget";
static char __pyx_k__fill[] = "fill";
static char __pyx_k__flat[] = "flat";
static char __pyx_k__freq[] = "freq";
static char __pyx_k__func[] = "func";
static char __pyx_k__hour[] = "hour";
static char __pyx_k__iNaT[] = "iNaT";
static char __pyx_k__int8[] = "int8";
static char __pyx_k__int_[] = "int_";
static char __pyx_k__item[] = "item";
static char __pyx_k__keys[] = "keys";
static char __pyx_k__kind[] = "kind";
static char __pyx_k__left[] = "left";
static char __pyx_k__mask[] = "mask";
static char __pyx_k__minp[] = "minp";
static char __pyx_k__name[] = "name";
static char __pyx_k__ndim[] = "ndim";
static char __pyx_k__next[] = "next";
static char __pyx_k__ones[] = "ones";
static char __pyx_k__prop[] = "prop";
static char __pyx_k__pytz[] = "pytz";
static char __pyx_k__rank[] = "rank";
static char __pyx_k__safe[] = "safe";
static char __pyx_k__self[] = "self";
static char __pyx_k__side[] = "side";
static char __pyx_k__size[] = "size";
static char __pyx_k__sort[] = "sort";
static char __pyx_k__take[] = "take";
static char __pyx_k__time[] = "time";
static char __pyx_k__type[] = "type";
static char __pyx_k__vals[] = "vals";
static char __pyx_k__view[] = "view";
static char __pyx_k__warn[] = "warn";
static char __pyx_k__week[] = "week";
static char __pyx_k__year[] = "year";
static char __pyx_k__zone[] = "zone";
static char __pyx_k__False[] = "False";
static char __pyx_k___data[] = "_data";
static char __pyx_k__apply[] = "apply";
static char __pyx_k__array[] = "array";
static char __pyx_k__bool_[] = "bool_";
static char __pyx_k__dates[] = "dates";
static char __pyx_k__delta[] = "delta";
static char __pyx_k__dicts[] = "dicts";
static char __pyx_k__dtype[] = "dtype";
static char __pyx_k__dummy[] = "dummy";
static char __pyx_k__empty[] = "empty";
static char __pyx_k__field[] = "field";
static char __pyx_k__first[] = "first";
static char __pyx_k__flags[] = "flags";
static char __pyx_k__hours[] = "hours";
static char __pyx_k__idMap[] = "idMap";
static char __pyx_k__iinfo[] = "iinfo";
static char __pyx_k__index[] = "index";
static char __pyx_k__input[] = "input";
static char __pyx_k__int16[] = "int16";
static char __pyx_k__int32[] = "int32";
static char __pyx_k__int64[] = "int64";
static char __pyx_k__isnan[] = "isnan";
static char __pyx_k__limit[] = "limit";
static char __pyx_k__mixed[] = "mixed";
static char __pyx_k__month[] = "month";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__other[] = "other";
static char __pyx_k__parse[] = "parse";
static char __pyx_k__range[] = "range";
static char __pyx_k__ravel[] = "ravel";
static char __pyx_k__retry[] = "retry";
static char __pyx_k__right[] = "right";
static char __pyx_k__shape[] = "shape";
static char __pyx_k__state[] = "state";
static char __pyx_k__table[] = "table";
static char __pyx_k__times[] = "times";
static char __pyx_k__uint8[] = "uint8";
static char __pyx_k__value[] = "value";
static char __pyx_k__width[] = "width";
static char __pyx_k__years[] = "years";
static char __pyx_k__zeros[] = "zeros";
static char __pyx_k__Period[] = "Period";
static char __pyx_k____eq__[] = "__eq__";
static char __pyx_k____ge__[] = "__ge__";
static char __pyx_k____gt__[] = "__gt__";
static char __pyx_k____le__[] = "__le__";
static char __pyx_k____lt__[] = "__lt__";
static char __pyx_k____ne__[] = "__ne__";
static char __pyx_k___algos[] = "_algos";
static char __pyx_k___cache[] = "_cache";
static char __pyx_k___index[] = "_index";
static char __pyx_k__adjust[] = "adjust";
static char __pyx_k__arange[] = "arange";
static char __pyx_k__arrmap[] = "arrmap";
static char __pyx_k__astype[] = "astype";
static char __pyx_k__binner[] = "binner";
static char __pyx_k__closed[] = "closed";
static char __pyx_k__counts[] = "counts";
static char __pyx_k__fields[] = "fields";
static char __pyx_k__format[] = "format";
static char __pyx_k__in_arr[] = "in_arr";
static char __pyx_k__insert[] = "insert";
static char __pyx_k__labels[] = "labels";
static char __pyx_k__length[] = "length";
static char __pyx_k__lookup[] = "lookup";
static char __pyx_k__mapper[] = "mapper";
static char __pyx_k__median[] = "median";
static char __pyx_k__minute[] = "minute";
static char __pyx_k__months[] = "months";
static char __pyx_k__object[] = "object";
static char __pyx_k__offset[] = "offset";
static char __pyx_k__pandas[] = "pandas";
static char __pyx_k__parser[] = "parser";
static char __pyx_k__pydate[] = "pydate";
static char __pyx_k__raise_[] = "raise_";
static char __pyx_k__random[] = "random";
static char __pyx_k__reduce[] = "reduce";
static char __pyx_k__remove[] = "remove";
static char __pyx_k__repeat[] = "repeat";
static char __pyx_k__second[] = "second";
static char __pyx_k__series[] = "series";
static char __pyx_k__sorter[] = "sorter";
static char __pyx_k__string[] = "string";
static char __pyx_k__tzinfo[] = "tzinfo";
static char __pyx_k__uint16[] = "uint16";
static char __pyx_k__uint32[] = "uint32";
static char __pyx_k__uint64[] = "uint64";
static char __pyx_k__unique[] = "unique";
static char __pyx_k__values[] = "values";
static char __pyx_k__window[] = "window";
static char __pyx_k__NaTType[] = "NaTType";
static char __pyx_k____add__[] = "__add__";
static char __pyx_k____cmp__[] = "__cmp__";
static char __pyx_k____mul__[] = "__mul__";
static char __pyx_k____new__[] = "__new__";
static char __pyx_k____sub__[] = "__sub__";
static char __pyx_k___engine[] = "_engine";
static char __pyx_k__advance[] = "advance";
static char __pyx_k__argsort[] = "argsort";
static char __pyx_k__asarray[] = "asarray";
static char __pyx_k__average[] = "average";
static char __pyx_k__boolean[] = "boolean";
static char __pyx_k__cleanup[] = "cleanup";
static char __pyx_k__columns[] = "columns";
static char __pyx_k__complex[] = "complex";
static char __pyx_k__convert[] = "convert";
static char __pyx_k__default[] = "default";
static char __pyx_k__destroy[] = "destroy";
static char __pyx_k__dtindex[] = "dtindex";
static char __pyx_k__float16[] = "float16";
static char __pyx_k__float32[] = "float32";
static char __pyx_k__float64[] = "float64";
static char __pyx_k__freqstr[] = "freqstr";
static char __pyx_k__get_loc[] = "get_loc";
static char __pyx_k__indexer[] = "indexer";
static char __pyx_k__integer[] = "integer";
static char __pyx_k__lookup2[] = "lookup2";
static char __pyx_k__lvalues[] = "lvalues";
static char __pyx_k__mapping[] = "mapping";
static char __pyx_k__max_bin[] = "max_bin";
static char __pyx_k__maximum[] = "maximum";
static char __pyx_k__minutes[] = "minutes";
static char __pyx_k__nancorr[] = "nancorr";
static char __pyx_k__ngroups[] = "ngroups";
static char __pyx_k__nonzero[] = "nonzero";
static char __pyx_k__object_[] = "object_";
static char __pyx_k__objects[] = "objects";
static char __pyx_k__ordinal[] = "ordinal";
static char __pyx_k__putmask[] = "putmask";
static char __pyx_k__quarter[] = "quarter";
static char __pyx_k__replace[] = "replace";
static char __pyx_k__rvalues[] = "rvalues";
static char __pyx_k__seconds[] = "seconds";
static char __pyx_k__string_[] = "string_";
static char __pyx_k__unicode[] = "unicode";
static char __pyx_k__uniques[] = "uniques";
static char __pyx_k__vgetter[] = "vgetter";
static char __pyx_k__weekday[] = "weekday";
static char __pyx_k__Infinity[] = "Infinity";
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k____hash__[] = "__hash__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____name__[] = "__name__";
static char __pyx_k____repr__[] = "__repr__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k___tzinfos[] = "_tzinfos";
static char __pyx_k__datetime[] = "datetime";
static char __pyx_k__dayfirst[] = "dayfirst";
static char __pyx_k__fast_zip[] = "fast_zip";
static char __pyx_k__float128[] = "float128";
static char __pyx_k__floating[] = "floating";
static char __pyx_k__get_item[] = "get_item";
static char __pyx_k__isfinite[] = "isfinite";
static char __pyx_k__ismember[] = "ismember";
static char __pyx_k__isscalar[] = "isscalar";
static char __pyx_k__itemsize[] = "itemsize";
static char __pyx_k__lindexer[] = "lindexer";
static char __pyx_k__localize[] = "localize";
static char __pyx_k__ndarrays[] = "ndarrays";
static char __pyx_k__operator[] = "operator";
static char __pyx_k__property[] = "property";
static char __pyx_k__quantile[] = "quantile";
static char __pyx_k__rindexer[] = "rindexer";
static char __pyx_k__roll_max[] = "roll_max";
static char __pyx_k__roll_min[] = "roll_min";
static char __pyx_k__roll_sum[] = "roll_sum";
static char __pyx_k__roll_var[] = "roll_var";
static char __pyx_k__set_item[] = "set_item";
static char __pyx_k__strftime[] = "strftime";
static char __pyx_k__strptime[] = "strptime";
static char __pyx_k__timezone[] = "timezone";
static char __pyx_k__ts_input[] = "ts_input";
static char __pyx_k__unicode_[] = "unicode_";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__NameError[] = "NameError";
static char __pyx_k__Timestamp[] = "Timestamp";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k___TYPE_MAP[] = "_TYPE_MAP";
static char __pyx_k___set_axis[] = "_set_axis";
static char __pyx_k__ascending[] = "ascending";
static char __pyx_k__dayofweek[] = "dayofweek";
static char __pyx_k__dayofyear[] = "dayofyear";
static char __pyx_k__get_value[] = "get_value";
static char __pyx_k__group_add[] = "group_add";
static char __pyx_k__group_ids[] = "group_ids";
static char __pyx_k__group_max[] = "group_max";
static char __pyx_k__group_min[] = "group_min";
static char __pyx_k__group_nth[] = "group_nth";
static char __pyx_k__group_var[] = "group_var";
static char __pyx_k__have_pytz[] = "have_pytz";
static char __pyx_k__is_unique[] = "is_unique";
static char __pyx_k__isnullobj[] = "isnullobj";
static char __pyx_k__map_infer[] = "map_infer";
static char __pyx_k__max_group[] = "max_group";
static char __pyx_k__mergesort[] = "mergesort";
static char __pyx_k__na_values[] = "na_values";
static char __pyx_k__normalize[] = "normalize";
static char __pyx_k__ones_like[] = "ones_like";
static char __pyx_k__pad_int64[] = "pad_int64";
static char __pyx_k__roll_kurt[] = "roll_kurt";
static char __pyx_k__roll_max2[] = "roll_max2";
static char __pyx_k__roll_mean[] = "roll_mean";
static char __pyx_k__roll_min2[] = "roll_min2";
static char __pyx_k__roll_skew[] = "roll_skew";
static char __pyx_k__set_value[] = "set_value";
static char __pyx_k__size_hint[] = "size_hint";
static char __pyx_k__take_last[] = "take_last";
static char __pyx_k__timedelta[] = "timedelta";
static char __pyx_k__to_period[] = "to_period";
static char __pyx_k__toordinal[] = "toordinal";
static char __pyx_k__try_float[] = "try_float";
static char __pyx_k__vec_binop[] = "vec_binop";
static char __pyx_k__IndexError[] = "IndexError";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k____reduce__[] = "__reduce__";
static char __pyx_k___get_field[] = "_get_field";
static char __pyx_k___repr_base[] = "_repr_base";
static char __pyx_k___utcoffset[] = "_utcoffset";
static char __pyx_k__basestring[] = "basestring";
static char __pyx_k__complex128[] = "complex128";
static char __pyx_k__complex256[] = "complex256";
static char __pyx_k__contiguous[] = "contiguous";
static char __pyx_k__datetime64[] = "datetime64";
static char __pyx_k__duplicated[] = "duplicated";
static char __pyx_k__empty_like[] = "empty_like";
static char __pyx_k__fill_value[] = "fill_value";
static char __pyx_k__get_labels[] = "get_labels";
static char __pyx_k__get_result[] = "get_result";
static char __pyx_k__group_last[] = "group_last";
static char __pyx_k__group_mean[] = "group_mean";
static char __pyx_k__group_ohlc[] = "group_ohlc";
static char __pyx_k__group_prod[] = "group_prod";
static char __pyx_k__i8_to_pydt[] = "i8_to_pydt";
static char __pyx_k__inner_join[] = "inner_join";
static char __pyx_k__is_integer[] = "is_integer";
static char __pyx_k__isleapyear[] = "isleapyear";
static char __pyx_k__iterations[] = "iterations";
static char __pyx_k__max_groups[] = "max_groups";
static char __pyx_k__max_subseq[] = "max_subseq";
static char __pyx_k__min_subseq[] = "min_subseq";
static char __pyx_k__monthrange[] = "monthrange";
static char __pyx_k__nanosecond[] = "nanosecond";
static char __pyx_k__pad_object[] = "pad_object";
static char __pyx_k__parse_date[] = "parse_date";
static char __pyx_k__pydatetime[] = "pydatetime";
static char __pyx_k__pydt_to_i8[] = "pydt_to_i8";
static char __pyx_k__set_length[] = "set_length";
static char __pyx_k__tz_convert[] = "tz_convert";
static char __pyx_k__weekofyear[] = "weekofyear";
static char __pyx_k__zeros_like[] = "zeros_like";
static char __pyx_k__ImportError[] = "ImportError";
static char __pyx_k__NegInfinity[] = "NegInfinity";
static char __pyx_k___check_minp[] = "_check_minp";
static char __pyx_k___get_deltas[] = "_get_deltas";
static char __pyx_k__count_prior[] = "count_prior";
static char __pyx_k__date_parser[] = "date_parser";
static char __pyx_k__fast_unique[] = "fast_unique";
static char __pyx_k__group_count[] = "group_count";
static char __pyx_k__has_infs_f4[] = "has_infs_f4";
static char __pyx_k__has_infs_f8[] = "has_infs_f8";
static char __pyx_k__infer_dtype[] = "infer_dtype";
static char __pyx_k__isnullobj2d[] = "isnullobj2d";
static char __pyx_k__join_sorter[] = "join_sorter";
static char __pyx_k__microsecond[] = "microsecond";
static char __pyx_k__na_sentinel[] = "na_sentinel";
static char __pyx_k__pad_float64[] = "pad_float64";
static char __pyx_k__pandas_null[] = "pandas_null";
static char __pyx_k__tiebreakers[] = "tiebreakers";
static char __pyx_k__ties_method[] = "ties_method";
static char __pyx_k__time_parser[] = "time_parser";
static char __pyx_k__trans_cache[] = "trans_cache";
static char __pyx_k__tz_localize[] = "tz_localize";
static char __pyx_k__vec_compare[] = "vec_compare";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k____setstate__[] = "__setstate__";
static char __pyx_k___check_dummy[] = "_check_dummy";
static char __pyx_k___return_true[] = "_return_true";
static char __pyx_k__apply_offset[] = "apply_offset";
static char __pyx_k__c_contiguous[] = "c_contiguous";
static char __pyx_k__f_contiguous[] = "f_contiguous";
static char __pyx_k__get_value_at[] = "get_value_at";
static char __pyx_k__group_labels[] = "group_labels";
static char __pyx_k__group_median[] = "group_median";
static char __pyx_k__groupby_func[] = "groupby_func";
static char __pyx_k__indices_fast[] = "indices_fast";
static char __pyx_k__is_lexsorted[] = "is_lexsorted";
static char __pyx_k__is_monotonic[] = "is_monotonic";
static char __pyx_k__kth_smallest[] = "kth_smallest";
static char __pyx_k__left_join_1d[] = "left_join_1d";
static char __pyx_k__left_join_2d[] = "left_join_2d";
static char __pyx_k__microseconds[] = "microseconds";
static char __pyx_k__roll_generic[] = "roll_generic";
static char __pyx_k__scalar_binop[] = "scalar_binop";
static char __pyx_k__searchsorted[] = "searchsorted";
static char __pyx_k__set_value_at[] = "set_value_at";
static char __pyx_k___ensure_index[] = "_ensure_index";
static char __pyx_k___return_false[] = "_return_false";
static char __pyx_k__clear_mapping[] = "clear_mapping";
static char __pyx_k__convert_empty[] = "convert_empty";
static char __pyx_k__expected_size[] = "expected_size";
static char __pyx_k__fast_multiget[] = "fast_multiget";
static char __pyx_k__ffill_indexer[] = "ffill_indexer";
static char __pyx_k__fromtimestamp[] = "fromtimestamp";
static char __pyx_k__group_add_bin[] = "group_add_bin";
static char __pyx_k__group_max_bin[] = "group_max_bin";
static char __pyx_k__group_min_bin[] = "group_min_bin";
static char __pyx_k__group_nth_bin[] = "group_nth_bin";
static char __pyx_k__group_var_bin[] = "group_var_bin";
static char __pyx_k__is_bool_array[] = "is_bool_array";
static char __pyx_k__is_date_array[] = "is_date_array";
static char __pyx_k__is_time_array[] = "is_time_array";
static char __pyx_k__lookup_values[] = "lookup_values";
static char __pyx_k__map_locations[] = "map_locations";
static char __pyx_k__rank_1d_int64[] = "rank_1d_int64";
static char __pyx_k__rank_2d_int64[] = "rank_2d_int64";
static char __pyx_k__roll_median_c[] = "roll_median_c";
static char __pyx_k__roll_quantile[] = "roll_quantile";
static char __pyx_k__sorted_labels[] = "sorted_labels";
static char __pyx_k__to_pydatetime[] = "to_pydatetime";
static char __pyx_k__unique_deltas[] = "unique_deltas";
static char __pyx_k__AssertionError[] = "AssertionError";
static char __pyx_k__AttributeError[] = "AttributeError";
static char __pyx_k___pad_functions[] = "_pad_functions";
static char __pyx_k__backfill_int64[] = "backfill_int64";
static char __pyx_k__count_level_1d[] = "count_level_1d";
static char __pyx_k__count_level_2d[] = "count_level_2d";
static char __pyx_k__date_normalize[] = "date_normalize";
static char __pyx_k__dicts_to_array[] = "dicts_to_array";
static char __pyx_k__ffill_by_group[] = "ffill_by_group";
static char __pyx_k__get_date_field[] = "get_date_field";
static char __pyx_k__group_last_bin[] = "group_last_bin";
static char __pyx_k__group_mean_bin[] = "group_mean_bin";
static char __pyx_k__group_prod_bin[] = "group_prod_bin";
static char __pyx_k__groupby_arrays[] = "groupby_arrays";
static char __pyx_k__is_float_array[] = "is_float_array";
static char __pyx_k__scalar_compare[] = "scalar_compare";
static char __pyx_k___call_monotonic[] = "_call_monotonic";
static char __pyx_k__backfill_object[] = "backfill_object";
static char __pyx_k__fast_zip_fillna[] = "fast_zip_fillna";
static char __pyx_k__full_outer_join[] = "full_outer_join";
static char __pyx_k__generate_slices[] = "generate_slices";
static char __pyx_k__get_time_micros[] = "get_time_micros";
static char __pyx_k__groupby_indices[] = "groupby_indices";
static char __pyx_k__is_period_array[] = "is_period_array";
static char __pyx_k__is_string_array[] = "is_string_array";
static char __pyx_k__left_outer_join[] = "left_outer_join";
static char __pyx_k__rank_1d_float64[] = "rank_1d_float64";
static char __pyx_k__rank_1d_generic[] = "rank_1d_generic";
static char __pyx_k__rank_2d_float64[] = "rank_2d_float64";
static char __pyx_k__rank_2d_generic[] = "rank_2d_generic";
static char __pyx_k__row_bool_subset[] = "row_bool_subset";
static char __pyx_k__to_object_array[] = "to_object_array";
static char __pyx_k__try_parse_dates[] = "try_parse_dates";
static char __pyx_k___big_join_sorter[] = "_big_join_sorter";
static char __pyx_k___get_transitions[] = "_get_transitions";
static char __pyx_k___transition_info[] = "_transition_info";
static char __pyx_k__backfill_float64[] = "backfill_float64";
static char __pyx_k__convert_datetime[] = "convert_datetime";
static char __pyx_k__dates_normalized[] = "dates_normalized";
static char __pyx_k__extract_ordinals[] = "extract_ordinals";
static char __pyx_k__infer_dtype_list[] = "infer_dtype_list";
static char __pyx_k__is_integer_array[] = "is_integer_array";
static char __pyx_k__is_unicode_array[] = "is_unicode_array";
static char __pyx_k__sanitize_objects[] = "sanitize_objects";
static char __pyx_k__utc_offset_cache[] = "utc_offset_cache";
static char __pyx_k__utcfromtimestamp[] = "utcfromtimestamp";
static char __pyx_k___get_result_array[] = "_get_result_array";
static char __pyx_k__array_to_datetime[] = "array_to_datetime";
static char __pyx_k__get_unique_labels[] = "get_unique_labels";
static char __pyx_k__groupsort_indexer[] = "groupsort_indexer";
static char __pyx_k__is_datetime_array[] = "is_datetime_array";
static char __pyx_k__ordered_left_join[] = "ordered_left_join";
static char __pyx_k__tz_convert_single[] = "tz_convert_single";
static char __pyx_k__tz_localize_check[] = "tz_localize_check";
static char __pyx_k__value_count_int64[] = "value_count_int64";
static char __pyx_k__AmbiguousTimeError[] = "AmbiguousTimeError";
static char __pyx_k__array_to_timestamp[] = "array_to_timestamp";
static char __pyx_k__build_field_sarray[] = "build_field_sarray";
static char __pyx_k__convert_sql_column[] = "convert_sql_column";
static char __pyx_k__convert_timestamps[] = "convert_timestamps";
static char __pyx_k__generate_bins_dt64[] = "generate_bins_dt64";
static char __pyx_k__ints_to_pydatetime[] = "ints_to_pydatetime";
static char __pyx_k__is_monotonic_int64[] = "is_monotonic_int64";
static char __pyx_k__is_timestamp_array[] = "is_timestamp_array";
static char __pyx_k__maybe_convert_bool[] = "maybe_convert_bool";
static char __pyx_k__roll_median_cython[] = "roll_median_cython";
static char __pyx_k__time64_to_datetime[] = "time64_to_datetime";
static char __pyx_k__tz_localize_to_utc[] = "tz_localize_to_utc";
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
static char __pyx_k___backfill_functions[] = "_backfill_functions";
static char __pyx_k___get_result_indexer[] = "_get_result_indexer";
static char __pyx_k__cast_to_nanoseconds[] = "cast_to_nanoseconds";
static char __pyx_k__get_reverse_indexer[] = "get_reverse_indexer";
static char __pyx_k__is_datetime64_array[] = "is_datetime64_array";
static char __pyx_k__is_monotonic_object[] = "is_monotonic_object";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_n_s_10;
static PyObject *__pyx_kp_s_103;
static PyObject *__pyx_kp_s_105;
static PyObject *__pyx_kp_s_106;
static PyObject *__pyx_n_s_116;
static PyObject *__pyx_kp_s_117;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_141;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_n_s_151;
static PyObject *__pyx_kp_s_152;
static PyObject *__pyx_kp_s_155;
static PyObject *__pyx_kp_s_156;
static PyObject *__pyx_kp_s_158;
static PyObject *__pyx_kp_s_160;
static PyObject *__pyx_kp_s_161;
static PyObject *__pyx_n_s_163;
static PyObject *__pyx_kp_s_164;
static PyObject *__pyx_kp_s_166;
static PyObject *__pyx_kp_s_168;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_kp_s_170;
static PyObject *__pyx_kp_s_173;
static PyObject *__pyx_n_s_179;
static PyObject *__pyx_kp_s_187;
static PyObject *__pyx_kp_u_189;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_u_191;
static PyObject *__pyx_kp_u_193;
static PyObject *__pyx_kp_u_195;
static PyObject *__pyx_kp_u_196;
static PyObject *__pyx_kp_u_199;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_n_s_203;
static PyObject *__pyx_n_s_204;
static PyObject *__pyx_n_s_205;
static PyObject *__pyx_n_s_206;
static PyObject *__pyx_n_s_207;
static PyObject *__pyx_n_s_208;
static PyObject *__pyx_n_s_209;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_n_s_210;
static PyObject *__pyx_n_s_211;
static PyObject *__pyx_n_s_212;
static PyObject *__pyx_n_s_213;
static PyObject *__pyx_n_s_214;
static PyObject *__pyx_n_s_215;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_n_s_23;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_kp_s_38;
static PyObject *__pyx_kp_s_41;
static PyObject *__pyx_n_s_42;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_n_s_48;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_50;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_kp_s_55;
static PyObject *__pyx_n_s_60;
static PyObject *__pyx_kp_s_62;
static PyObject *__pyx_kp_s_64;
static PyObject *__pyx_n_s_66;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_74;
static PyObject *__pyx_kp_s_75;
static PyObject *__pyx_kp_s_77;
static PyObject *__pyx_n_s_79;
static PyObject *__pyx_n_s_80;
static PyObject *__pyx_kp_s_81;
static PyObject *__pyx_kp_s_83;
static PyObject *__pyx_kp_s_85;
static PyObject *__pyx_kp_s_87;
static PyObject *__pyx_n_s_89;
static PyObject *__pyx_kp_s_96;
static PyObject *__pyx_kp_s_98;
static PyObject *__pyx_n_s__AmbiguousTimeError;
static PyObject *__pyx_n_s__AssertionError;
static PyObject *__pyx_n_s__AttributeError;
static PyObject *__pyx_n_s__C;
static PyObject *__pyx_n_s__D;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__F;
static PyObject *__pyx_n_s__False;
static PyObject *__pyx_n_s__ImportError;
static PyObject *__pyx_n_s__IndexError;
static PyObject *__pyx_n_s__Infinity;
static PyObject *__pyx_n_s__KeyError;
static PyObject *__pyx_n_s__M;
static PyObject *__pyx_n_s__N;
static PyObject *__pyx_n_s__NIL;
static PyObject *__pyx_n_s__NINF;
static PyObject *__pyx_n_s__NaN;
static PyObject *__pyx_n_s__NaT;
static PyObject *__pyx_n_s__NaTType;
static PyObject *__pyx_n_s__NameError;
static PyObject *__pyx_n_s__NegInfinity;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_s__O;
static PyObject *__pyx_n_s__ONAN;
static PyObject *__pyx_n_s__Period;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__T;
static PyObject *__pyx_n_s__Timestamp;
static PyObject *__pyx_n_s__True;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__UTC;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s__Y;
static PyObject *__pyx_n_s___TYPE_MAP;
static PyObject *__pyx_n_s____add__;
static PyObject *__pyx_n_s____cmp__;
static PyObject *__pyx_n_s____eq__;
static PyObject *__pyx_n_s____ge__;
static PyObject *__pyx_n_s____gt__;
static PyObject *__pyx_n_s____hash__;
static PyObject *__pyx_n_s____le__;
static PyObject *__pyx_n_s____lt__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____mul__;
static PyObject *__pyx_n_s____name__;
static PyObject *__pyx_n_s____ne__;
static PyObject *__pyx_n_s____new__;
static PyObject *__pyx_n_s____reduce__;
static PyObject *__pyx_n_s____repr__;
static PyObject *__pyx_n_s____setstate__;
static PyObject *__pyx_n_s____sub__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___algos;
static PyObject *__pyx_n_s___backfill_functions;
static PyObject *__pyx_n_s___big_join_sorter;
static PyObject *__pyx_n_s___cache;
static PyObject *__pyx_n_s___call_monotonic;
static PyObject *__pyx_n_s___check_dummy;
static PyObject *__pyx_n_s___check_minp;
static PyObject *__pyx_n_s___data;
static PyObject *__pyx_n_s___engine;
static PyObject *__pyx_n_s___ensure_index;
static PyObject *__pyx_n_s___get_deltas;
static PyObject *__pyx_n_s___get_field;
static PyObject *__pyx_n_s___get_result_array;
static PyObject *__pyx_n_s___get_result_indexer;
static PyObject *__pyx_n_s___get_transitions;
static PyObject *__pyx_n_s___index;
static PyObject *__pyx_n_s___pad_functions;
static PyObject *__pyx_n_s___repr_base;
static PyObject *__pyx_n_s___return_false;
static PyObject *__pyx_n_s___return_true;
static PyObject *__pyx_n_s___set_axis;
static PyObject *__pyx_n_s___transition_info;
static PyObject *__pyx_n_s___tzinfos;
static PyObject *__pyx_n_s___utcoffset;
static PyObject *__pyx_n_s__a;
static PyObject *__pyx_n_s__adjust;
static PyObject *__pyx_n_s__advance;
static PyObject *__pyx_n_s__apply;
static PyObject *__pyx_n_s__apply_offset;
static PyObject *__pyx_n_s__arange;
static PyObject *__pyx_n_s__arg;
static PyObject *__pyx_n_s__args;
static PyObject *__pyx_n_s__argsort;
static PyObject *__pyx_n_s__arr;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__array_to_datetime;
static PyObject *__pyx_n_s__array_to_timestamp;
static PyObject *__pyx_n_s__arrmap;
static PyObject *__pyx_n_s__asarray;
static PyObject *__pyx_n_s__ascending;
static PyObject *__pyx_n_s__asm8;
static PyObject *__pyx_n_s__astype;
static PyObject *__pyx_n_s__average;
static PyObject *__pyx_n_s__axes;
static PyObject *__pyx_n_s__axis;
static PyObject *__pyx_n_s__backfill_float64;
static PyObject *__pyx_n_s__backfill_int64;
static PyObject *__pyx_n_s__backfill_object;
static PyObject *__pyx_n_s__basestring;
static PyObject *__pyx_n_s__binner;
static PyObject *__pyx_n_s__bins;
static PyObject *__pyx_n_s__bool_;
static PyObject *__pyx_n_s__boolean;
static PyObject *__pyx_n_s__buf;
static PyObject *__pyx_n_s__build_field_sarray;
static PyObject *__pyx_n_s__c16;
static PyObject *__pyx_n_s__c_contiguous;
static PyObject *__pyx_n_s__cast_to_nanoseconds;
static PyObject *__pyx_n_s__cleanup;
static PyObject *__pyx_n_s__clear_mapping;
static PyObject *__pyx_n_s__closed;
static PyObject *__pyx_n_s__cls;
static PyObject *__pyx_n_s__columns;
static PyObject *__pyx_n_s__com;
static PyObject *__pyx_n_s__complex;
static PyObject *__pyx_n_s__complex128;
static PyObject *__pyx_n_s__complex256;
static PyObject *__pyx_n_s__contiguous;
static PyObject *__pyx_n_s__convert;
static PyObject *__pyx_n_s__convert_datetime;
static PyObject *__pyx_n_s__convert_empty;
static PyObject *__pyx_n_s__convert_sql_column;
static PyObject *__pyx_n_s__convert_timestamps;
static PyObject *__pyx_n_s__copy;
static PyObject *__pyx_n_s__count_level_1d;
static PyObject *__pyx_n_s__count_level_2d;
static PyObject *__pyx_n_s__count_prior;
static PyObject *__pyx_n_s__counts;
static PyObject *__pyx_n_s__cov;
static PyObject *__pyx_n_s__date;
static PyObject *__pyx_n_s__date_normalize;
static PyObject *__pyx_n_s__date_parser;
static PyObject *__pyx_n_s__dates;
static PyObject *__pyx_n_s__dates_normalized;
static PyObject *__pyx_n_s__datetime;
static PyObject *__pyx_n_s__datetime64;
static PyObject *__pyx_n_s__day;
static PyObject *__pyx_n_s__dayfirst;
static PyObject *__pyx_n_s__dayofweek;
static PyObject *__pyx_n_s__dayofyear;
static PyObject *__pyx_n_s__days;
static PyObject *__pyx_n_s__ddof;
static PyObject *__pyx_n_s__default;
static PyObject *__pyx_n_s__delta;
static PyObject *__pyx_n_s__destroy;
static PyObject *__pyx_n_s__dicts;
static PyObject *__pyx_n_s__dicts_to_array;
static PyObject *__pyx_n_s__dow;
static PyObject *__pyx_n_s__doy;
static PyObject *__pyx_n_s__dtindex;
static PyObject *__pyx_n_s__dtype;
static PyObject *__pyx_n_s__dummy;
static PyObject *__pyx_n_s__duplicated;
static PyObject *__pyx_n_s__empty;
static PyObject *__pyx_n_s__empty_like;
static PyObject *__pyx_n_s__eq;
static PyObject *__pyx_n_s__ewma;
static PyObject *__pyx_n_s__expected_size;
static PyObject *__pyx_n_s__extract_ordinals;
static PyObject *__pyx_n_s__f;
static PyObject *__pyx_n_s__f8;
static PyObject *__pyx_n_s__f_contiguous;
static PyObject *__pyx_n_s__fast_multiget;
static PyObject *__pyx_n_s__fast_unique;
static PyObject *__pyx_n_s__fast_zip;
static PyObject *__pyx_n_s__fast_zip_fillna;
static PyObject *__pyx_n_s__ffill_by_group;
static PyObject *__pyx_n_s__ffill_indexer;
static PyObject *__pyx_n_s__fget;
static PyObject *__pyx_n_s__field;
static PyObject *__pyx_n_s__fields;
static PyObject *__pyx_n_s__fill;
static PyObject *__pyx_n_s__fill_value;
static PyObject *__pyx_n_s__first;
static PyObject *__pyx_n_s__flags;
static PyObject *__pyx_n_s__flat;
static PyObject *__pyx_n_s__float128;
static PyObject *__pyx_n_s__float16;
static PyObject *__pyx_n_s__float32;
static PyObject *__pyx_n_s__float64;
static PyObject *__pyx_n_s__floating;
static PyObject *__pyx_n_s__format;
static PyObject *__pyx_n_s__freq;
static PyObject *__pyx_n_s__freqstr;
static PyObject *__pyx_n_s__fromtimestamp;
static PyObject *__pyx_n_s__full_outer_join;
static PyObject *__pyx_n_s__func;
static PyObject *__pyx_n_s__ge;
static PyObject *__pyx_n_s__generate_bins_dt64;
static PyObject *__pyx_n_s__generate_slices;
static PyObject *__pyx_n_s__get;
static PyObject *__pyx_n_s__get_date_field;
static PyObject *__pyx_n_s__get_item;
static PyObject *__pyx_n_s__get_labels;
static PyObject *__pyx_n_s__get_loc;
static PyObject *__pyx_n_s__get_result;
static PyObject *__pyx_n_s__get_reverse_indexer;
static PyObject *__pyx_n_s__get_time_micros;
static PyObject *__pyx_n_s__get_unique_labels;
static PyObject *__pyx_n_s__get_value;
static PyObject *__pyx_n_s__get_value_at;
static PyObject *__pyx_n_s__group_add;
static PyObject *__pyx_n_s__group_add_bin;
static PyObject *__pyx_n_s__group_count;
static PyObject *__pyx_n_s__group_ids;
static PyObject *__pyx_n_s__group_labels;
static PyObject *__pyx_n_s__group_last;
static PyObject *__pyx_n_s__group_last_bin;
static PyObject *__pyx_n_s__group_max;
static PyObject *__pyx_n_s__group_max_bin;
static PyObject *__pyx_n_s__group_mean;
static PyObject *__pyx_n_s__group_mean_bin;
static PyObject *__pyx_n_s__group_median;
static PyObject *__pyx_n_s__group_min;
static PyObject *__pyx_n_s__group_min_bin;
static PyObject *__pyx_n_s__group_nth;
static PyObject *__pyx_n_s__group_nth_bin;
static PyObject *__pyx_n_s__group_ohlc;
static PyObject *__pyx_n_s__group_prod;
static PyObject *__pyx_n_s__group_prod_bin;
static PyObject *__pyx_n_s__group_var;
static PyObject *__pyx_n_s__group_var_bin;
static PyObject *__pyx_n_s__groupby_arrays;
static PyObject *__pyx_n_s__groupby_func;
static PyObject *__pyx_n_s__groupby_indices;
static PyObject *__pyx_n_s__groupsort_indexer;
static PyObject *__pyx_n_s__gt;
static PyObject *__pyx_n_s__h;
static PyObject *__pyx_n_s__has_infs_f4;
static PyObject *__pyx_n_s__has_infs_f8;
static PyObject *__pyx_n_s__have_pytz;
static PyObject *__pyx_n_s__hour;
static PyObject *__pyx_n_s__hours;
static PyObject *__pyx_n_s__i4;
static PyObject *__pyx_n_s__i8;
static PyObject *__pyx_n_s__i8_to_pydt;
static PyObject *__pyx_n_s__iNaT;
static PyObject *__pyx_n_s__idMap;
static PyObject *__pyx_n_s__iinfo;
static PyObject *__pyx_n_s__in_arr;
static PyObject *__pyx_n_s__index;
static PyObject *__pyx_n_s__indexer;
static PyObject *__pyx_n_s__indices_fast;
static PyObject *__pyx_n_s__inf;
static PyObject *__pyx_n_s__infer_dtype;
static PyObject *__pyx_n_s__infer_dtype_list;
static PyObject *__pyx_n_s__inner_join;
static PyObject *__pyx_n_s__input;
static PyObject *__pyx_n_s__insert;
static PyObject *__pyx_n_s__int16;
static PyObject *__pyx_n_s__int32;
static PyObject *__pyx_n_s__int64;
static PyObject *__pyx_n_s__int8;
static PyObject *__pyx_n_s__int_;
static PyObject *__pyx_n_s__integer;
static PyObject *__pyx_n_s__ints_to_pydatetime;
static PyObject *__pyx_n_s__is_bool_array;
static PyObject *__pyx_n_s__is_date_array;
static PyObject *__pyx_n_s__is_datetime64_array;
static PyObject *__pyx_n_s__is_datetime_array;
static PyObject *__pyx_n_s__is_float_array;
static PyObject *__pyx_n_s__is_integer;
static PyObject *__pyx_n_s__is_integer_array;
static PyObject *__pyx_n_s__is_lexsorted;
static PyObject *__pyx_n_s__is_monotonic;
static PyObject *__pyx_n_s__is_monotonic_int64;
static PyObject *__pyx_n_s__is_monotonic_object;
static PyObject *__pyx_n_s__is_period_array;
static PyObject *__pyx_n_s__is_string_array;
static PyObject *__pyx_n_s__is_time_array;
static PyObject *__pyx_n_s__is_timestamp_array;
static PyObject *__pyx_n_s__is_unicode_array;
static PyObject *__pyx_n_s__is_unique;
static PyObject *__pyx_n_s__isfinite;
static PyObject *__pyx_n_s__isleapyear;
static PyObject *__pyx_n_s__ismember;
static PyObject *__pyx_n_s__isnan;
static PyObject *__pyx_n_s__isnullobj;
static PyObject *__pyx_n_s__isnullobj2d;
static PyObject *__pyx_n_s__isscalar;
static PyObject *__pyx_n_s__item;
static PyObject *__pyx_n_s__itemsize;
static PyObject *__pyx_n_s__iterations;
static PyObject *__pyx_n_s__join_sorter;
static PyObject *__pyx_n_s__k;
static PyObject *__pyx_n_s__key;
static PyObject *__pyx_n_s__keys;
static PyObject *__pyx_n_s__kind;
static PyObject *__pyx_n_s__kth_smallest;
static PyObject *__pyx_n_s__labels;
static PyObject *__pyx_n_s__le;
static PyObject *__pyx_n_s__left;
static PyObject *__pyx_n_s__left_join_1d;
static PyObject *__pyx_n_s__left_join_2d;
static PyObject *__pyx_n_s__left_outer_join;
static PyObject *__pyx_n_s__length;
static PyObject *__pyx_n_s__limit;
static PyObject *__pyx_n_s__lindexer;
static PyObject *__pyx_n_s__loc;
static PyObject *__pyx_n_s__localize;
static PyObject *__pyx_n_s__lookup;
static PyObject *__pyx_n_s__lookup2;
static PyObject *__pyx_n_s__lookup_values;
static PyObject *__pyx_n_s__lt;
static PyObject *__pyx_n_s__lvalues;
static PyObject *__pyx_n_s__m;
static PyObject *__pyx_n_s__map_infer;
static PyObject *__pyx_n_s__map_locations;
static PyObject *__pyx_n_s__mapper;
static PyObject *__pyx_n_s__mapping;
static PyObject *__pyx_n_s__mask;
static PyObject *__pyx_n_s__mat;
static PyObject *__pyx_n_s__max;
static PyObject *__pyx_n_s__max_bin;
static PyObject *__pyx_n_s__max_group;
static PyObject *__pyx_n_s__max_groups;
static PyObject *__pyx_n_s__max_subseq;
static PyObject *__pyx_n_s__maximum;
static PyObject *__pyx_n_s__maybe_convert_bool;
static PyObject *__pyx_n_s__median;
static PyObject *__pyx_n_s__mergesort;
static PyObject *__pyx_n_s__microsecond;
static PyObject *__pyx_n_s__microseconds;
static PyObject *__pyx_n_s__min;
static PyObject *__pyx_n_s__min_subseq;
static PyObject *__pyx_n_s__minp;
static PyObject *__pyx_n_s__minute;
static PyObject *__pyx_n_s__minutes;
static PyObject *__pyx_n_s__mixed;
static PyObject *__pyx_n_s__month;
static PyObject *__pyx_n_s__monthrange;
static PyObject *__pyx_n_s__months;
static PyObject *__pyx_n_s__n;
static PyObject *__pyx_n_s__na_sentinel;
static PyObject *__pyx_n_s__na_values;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__nan;
static PyObject *__pyx_n_s__nancorr;
static PyObject *__pyx_n_s__nanosecond;
static PyObject *__pyx_n_s__ndarrays;
static PyObject *__pyx_n_s__ndim;
static PyObject *__pyx_n_s__ne;
static PyObject *__pyx_n_s__next;
static PyObject *__pyx_n_s__ngroups;
static PyObject *__pyx_n_s__nonzero;
static PyObject *__pyx_n_s__normalize;
static PyObject *__pyx_n_s__np;
static PyObject *__pyx_n_s__ns;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__object;
static PyObject *__pyx_n_s__object_;
static PyObject *__pyx_n_s__objects;
static PyObject *__pyx_n_s__offset;
static PyObject *__pyx_n_s__ones;
static PyObject *__pyx_n_s__ones_like;
static PyObject *__pyx_n_s__op;
static PyObject *__pyx_n_s__operator;
static PyObject *__pyx_n_s__ordered_left_join;
static PyObject *__pyx_n_s__ordinal;
static PyObject *__pyx_n_s__other;
static PyObject *__pyx_n_s__out;
static PyObject *__pyx_n_s__pad_float64;
static PyObject *__pyx_n_s__pad_int64;
static PyObject *__pyx_n_s__pad_object;
static PyObject *__pyx_n_s__pandas;
static PyObject *__pyx_n_s__pandas_null;
static PyObject *__pyx_n_s__parse;
static PyObject *__pyx_n_s__parse_date;
static PyObject *__pyx_n_s__parser;
static PyObject *__pyx_n_s__prop;
static PyObject *__pyx_n_s__property;
static PyObject *__pyx_n_s__put;
static PyObject *__pyx_n_s__putmask;
static PyObject *__pyx_n_s__pydate;
static PyObject *__pyx_n_s__pydatetime;
static PyObject *__pyx_n_s__pydt_to_i8;
static PyObject *__pyx_n_s__pytz;
static PyObject *__pyx_n_s__q;
static PyObject *__pyx_n_s__quantile;
static PyObject *__pyx_n_s__quarter;
static PyObject *__pyx_n_s__raise_;
static PyObject *__pyx_n_s__random;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__rank;
static PyObject *__pyx_n_s__rank_1d_float64;
static PyObject *__pyx_n_s__rank_1d_generic;
static PyObject *__pyx_n_s__rank_1d_int64;
static PyObject *__pyx_n_s__rank_2d_float64;
static PyObject *__pyx_n_s__rank_2d_generic;
static PyObject *__pyx_n_s__rank_2d_int64;
static PyObject *__pyx_n_s__ravel;
static PyObject *__pyx_n_s__reduce;
static PyObject *__pyx_n_s__remove;
static PyObject *__pyx_n_s__repeat;
static PyObject *__pyx_n_s__replace;
static PyObject *__pyx_n_s__retry;
static PyObject *__pyx_n_s__right;
static PyObject *__pyx_n_s__rindexer;
static PyObject *__pyx_n_s__roll_generic;
static PyObject *__pyx_n_s__roll_kurt;
static PyObject *__pyx_n_s__roll_max;
static PyObject *__pyx_n_s__roll_max2;
static PyObject *__pyx_n_s__roll_mean;
static PyObject *__pyx_n_s__roll_median_c;
static PyObject *__pyx_n_s__roll_median_cython;
static PyObject *__pyx_n_s__roll_min;
static PyObject *__pyx_n_s__roll_min2;
static PyObject *__pyx_n_s__roll_quantile;
static PyObject *__pyx_n_s__roll_skew;
static PyObject *__pyx_n_s__roll_sum;
static PyObject *__pyx_n_s__roll_var;
static PyObject *__pyx_n_s__row_bool_subset;
static PyObject *__pyx_n_s__rvalues;
static PyObject *__pyx_n_s__s;
static PyObject *__pyx_n_s__safe;
static PyObject *__pyx_n_s__sanitize_objects;
static PyObject *__pyx_n_s__scalar_binop;
static PyObject *__pyx_n_s__scalar_compare;
static PyObject *__pyx_n_s__searchsorted;
static PyObject *__pyx_n_s__second;
static PyObject *__pyx_n_s__seconds;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__series;
static PyObject *__pyx_n_s__set_item;
static PyObject *__pyx_n_s__set_length;
static PyObject *__pyx_n_s__set_value;
static PyObject *__pyx_n_s__set_value_at;
static PyObject *__pyx_n_s__shape;
static PyObject *__pyx_n_s__side;
static PyObject *__pyx_n_s__size;
static PyObject *__pyx_n_s__size_hint;
static PyObject *__pyx_n_s__sort;
static PyObject *__pyx_n_s__sorted_labels;
static PyObject *__pyx_n_s__sorter;
static PyObject *__pyx_n_s__state;
static PyObject *__pyx_n_s__strftime;
static PyObject *__pyx_n_s__string;
static PyObject *__pyx_n_s__string_;
static PyObject *__pyx_n_s__strptime;
static PyObject *__pyx_n_s__sum;
static PyObject *__pyx_n_s__table;
static PyObject *__pyx_n_s__take;
static PyObject *__pyx_n_s__take_last;
static PyObject *__pyx_n_s__tiebreakers;
static PyObject *__pyx_n_s__ties_method;
static PyObject *__pyx_n_s__time;
static PyObject *__pyx_n_s__time64_to_datetime;
static PyObject *__pyx_n_s__time_parser;
static PyObject *__pyx_n_s__timedelta;
static PyObject *__pyx_n_s__times;
static PyObject *__pyx_n_s__timezone;
static PyObject *__pyx_n_s__to_object_array;
static PyObject *__pyx_n_s__to_period;
static PyObject *__pyx_n_s__to_pydatetime;
static PyObject *__pyx_n_s__toordinal;
static PyObject *__pyx_n_s__trans_cache;
static PyObject *__pyx_n_s__try_float;
static PyObject *__pyx_n_s__try_parse_dates;
static PyObject *__pyx_n_s__ts;
static PyObject *__pyx_n_s__ts_input;
static PyObject *__pyx_n_s__type;
static PyObject *__pyx_n_s__tz;
static PyObject *__pyx_n_s__tz1;
static PyObject *__pyx_n_s__tz2;
static PyObject *__pyx_n_s__tz_convert;
static PyObject *__pyx_n_s__tz_convert_single;
static PyObject *__pyx_n_s__tz_localize;
static PyObject *__pyx_n_s__tz_localize_check;
static PyObject *__pyx_n_s__tz_localize_to_utc;
static PyObject *__pyx_n_s__tzinfo;
static PyObject *__pyx_n_s__u;
static PyObject *__pyx_n_s__uint16;
static PyObject *__pyx_n_s__uint32;
static PyObject *__pyx_n_s__uint64;
static PyObject *__pyx_n_s__uint8;
static PyObject *__pyx_n_s__unicode;
static PyObject *__pyx_n_s__unicode_;
static PyObject *__pyx_n_s__unique;
static PyObject *__pyx_n_s__unique_deltas;
static PyObject *__pyx_n_s__uniques;
static PyObject *__pyx_n_s__us;
static PyObject *__pyx_n_s__utc;
static PyObject *__pyx_n_s__utc_offset_cache;
static PyObject *__pyx_n_s__utcfromtimestamp;
static PyObject *__pyx_n_s__val;
static PyObject *__pyx_n_s__vals;
static PyObject *__pyx_n_s__value;
static PyObject *__pyx_n_s__value_count_int64;
static PyObject *__pyx_n_s__values;
static PyObject *__pyx_n_s__vec_binop;
static PyObject *__pyx_n_s__vec_compare;
static PyObject *__pyx_n_s__vgetter;
static PyObject *__pyx_n_s__view;
static PyObject *__pyx_n_s__warn;
static PyObject *__pyx_n_s__week;
static PyObject *__pyx_n_s__weekday;
static PyObject *__pyx_n_s__weekofyear;
static PyObject *__pyx_n_s__width;
static PyObject *__pyx_n_s__win;
static PyObject *__pyx_n_s__window;
static PyObject *__pyx_n_s__woy;
static PyObject *__pyx_n_s__year;
static PyObject *__pyx_n_s__years;
static PyObject *__pyx_n_s__zeros;
static PyObject *__pyx_n_s__zeros_like;
static PyObject *__pyx_n_s__zone;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_15;
static PyObject *__pyx_int_24;
static PyObject *__pyx_int_31;
static PyObject *__pyx_int_59;
static PyObject *__pyx_int_60;
static PyObject *__pyx_int_90;
static PyObject *__pyx_int_91;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_120;
static PyObject *__pyx_int_121;
static PyObject *__pyx_int_151;
static PyObject *__pyx_int_152;
static PyObject *__pyx_int_181;
static PyObject *__pyx_int_182;
static PyObject *__pyx_int_212;
static PyObject *__pyx_int_213;
static PyObject *__pyx_int_243;
static PyObject *__pyx_int_244;
static PyObject *__pyx_int_273;
static PyObject *__pyx_int_274;
static PyObject *__pyx_int_304;
static PyObject *__pyx_int_305;
static PyObject *__pyx_int_334;
static PyObject *__pyx_int_335;
static PyObject *__pyx_int_365;
static PyObject *__pyx_int_366;
static PyObject *__pyx_int_1000;
static PyObject *__pyx_int_2000;
static PyObject *__pyx_int_3600;
static PyObject *__pyx_int_1000000;
static PyObject *__pyx_int_1000000000;
static PyObject *__pyx_k_9;
static PyObject *__pyx_k_11;
static PyObject *__pyx_k_12;
static PyObject *__pyx_k_32;
static PyObject *__pyx_k_46;
static PyObject *__pyx_k_47;
static PyObject *__pyx_k_90;
static PyObject *__pyx_k_92;
static PyObject *__pyx_k_93;
static PyObject *__pyx_k_95;
static PyObject *__pyx_k_119;
static PyObject *__pyx_k_122;
static PyObject *__pyx_k_125;
static PyObject *__pyx_k_131;
static PyObject *__pyx_k_137;
static PyObject *__pyx_k_143;
static PyObject *__pyx_k_157;
static PyObject *__pyx_k_162;
static PyObject *__pyx_k_165;
static PyObject *__pyx_k_172;
static PyObject *__pyx_k_174;
static PyObject *__pyx_k_176;
static PyObject *__pyx_k_tuple_2;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_tuple_4;
static PyObject *__pyx_k_tuple_6;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_14;
static PyObject *__pyx_k_tuple_16;
static PyObject *__pyx_k_tuple_18;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_25;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_29;
static PyObject *__pyx_k_tuple_31;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_36;
static PyObject *__pyx_k_tuple_39;
static PyObject *__pyx_k_tuple_40;
static PyObject *__pyx_k_tuple_49;
static PyObject *__pyx_k_tuple_51;
static PyObject *__pyx_k_tuple_53;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_57;
static PyObject *__pyx_k_tuple_58;
static PyObject *__pyx_k_tuple_59;
static PyObject *__pyx_k_tuple_61;
static PyObject *__pyx_k_tuple_63;
static PyObject *__pyx_k_tuple_65;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_68;
static PyObject *__pyx_k_tuple_69;
static PyObject *__pyx_k_tuple_70;
static PyObject *__pyx_k_tuple_71;
static PyObject *__pyx_k_tuple_72;
static PyObject *__pyx_k_tuple_73;
static PyObject *__pyx_k_tuple_76;
static PyObject *__pyx_k_tuple_78;
static PyObject *__pyx_k_tuple_82;
static PyObject *__pyx_k_tuple_84;
static PyObject *__pyx_k_tuple_86;
static PyObject *__pyx_k_tuple_88;
static PyObject *__pyx_k_tuple_91;
static PyObject *__pyx_k_tuple_94;
static PyObject *__pyx_k_tuple_97;
static PyObject *__pyx_k_tuple_99;
static PyObject *__pyx_k_slice_120;
static PyObject *__pyx_k_slice_123;
static PyObject *__pyx_k_slice_127;
static PyObject *__pyx_k_slice_128;
static PyObject *__pyx_k_slice_133;
static PyObject *__pyx_k_slice_134;
static PyObject *__pyx_k_slice_139;
static PyObject *__pyx_k_slice_146;
static PyObject *__pyx_k_slice_147;
static PyObject *__pyx_k_tuple_100;
static PyObject *__pyx_k_tuple_101;
static PyObject *__pyx_k_tuple_102;
static PyObject *__pyx_k_tuple_104;
static PyObject *__pyx_k_tuple_107;
static PyObject *__pyx_k_tuple_108;
static PyObject *__pyx_k_tuple_109;
static PyObject *__pyx_k_tuple_110;
static PyObject *__pyx_k_tuple_111;
static PyObject *__pyx_k_tuple_112;
static PyObject *__pyx_k_tuple_113;
static PyObject *__pyx_k_tuple_114;
static PyObject *__pyx_k_tuple_115;
static PyObject *__pyx_k_tuple_118;
static PyObject *__pyx_k_tuple_121;
static PyObject *__pyx_k_tuple_124;
static PyObject *__pyx_k_tuple_126;
static PyObject *__pyx_k_tuple_129;
static PyObject *__pyx_k_tuple_130;
static PyObject *__pyx_k_tuple_132;
static PyObject *__pyx_k_tuple_135;
static PyObject *__pyx_k_tuple_136;
static PyObject *__pyx_k_tuple_138;
static PyObject *__pyx_k_tuple_140;
static PyObject *__pyx_k_tuple_142;
static PyObject *__pyx_k_tuple_144;
static PyObject *__pyx_k_tuple_145;
static PyObject *__pyx_k_tuple_148;
static PyObject *__pyx_k_tuple_149;
static PyObject *__pyx_k_tuple_150;
static PyObject *__pyx_k_tuple_153;
static PyObject *__pyx_k_tuple_154;
static PyObject *__pyx_k_tuple_159;
static PyObject *__pyx_k_tuple_167;
static PyObject *__pyx_k_tuple_169;
static PyObject *__pyx_k_tuple_171;
static PyObject *__pyx_k_tuple_175;
static PyObject *__pyx_k_tuple_177;
static PyObject *__pyx_k_tuple_178;
static PyObject *__pyx_k_tuple_180;
static PyObject *__pyx_k_tuple_181;
static PyObject *__pyx_k_tuple_182;
static PyObject *__pyx_k_tuple_183;
static PyObject *__pyx_k_tuple_184;
static PyObject *__pyx_k_tuple_185;
static PyObject *__pyx_k_tuple_186;
static PyObject *__pyx_k_tuple_188;
static PyObject *__pyx_k_tuple_190;
static PyObject *__pyx_k_tuple_192;
static PyObject *__pyx_k_tuple_194;
static PyObject *__pyx_k_tuple_197;
static PyObject *__pyx_k_tuple_198;
static PyObject *__pyx_k_tuple_200;
static PyObject *__pyx_k_tuple_201;
static PyObject *__pyx_k_tuple_202;

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":275
 *           'week', 'dayofyear']
 * for field in fields:
 *     prop = property(fget=lambda self: -1)             # <<<<<<<<<<<<<<
 *     setattr(NaTType, field, prop)
 * 
 */

static PyObject *__pyx_lambda_funcdef_6pandas_3lib_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_lambda_methdef_6pandas_3lib_lambda1 = {__Pyx_NAMESTR("lambda1"), (PyCFunction)__pyx_lambda_funcdef_6pandas_3lib_lambda1, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_lambda_funcdef_6pandas_3lib_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1");
  __pyx_self = __pyx_self;
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_neg_1);
  __pyx_r = __pyx_int_neg_1;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":429
 *         return left != right
 * 
 * _return_false = lambda self, other: False             # <<<<<<<<<<<<<<
 * _return_true = lambda self, other: True
 * 
 */

static PyObject *__pyx_lambda_funcdef_6pandas_3lib_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_lambda_methdef_6pandas_3lib_lambda2 = {__Pyx_NAMESTR("lambda2"), (PyCFunction)__pyx_lambda_funcdef_6pandas_3lib_lambda2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_lambda_funcdef_6pandas_3lib_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__other,0};
  __Pyx_RefNannySetupContext("lambda2");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("<lambda>", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "<lambda>") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("<lambda>", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":430
 * 
 * _return_false = lambda self, other: False
 * _return_true = lambda self, other: True             # <<<<<<<<<<<<<<
 * 
 * class Infinity(object):
 */

static PyObject *__pyx_lambda_funcdef_6pandas_3lib_lambda3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_lambda_methdef_6pandas_3lib_lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_lambda_funcdef_6pandas_3lib_lambda3, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_lambda_funcdef_6pandas_3lib_lambda3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__other,0};
  __Pyx_RefNannySetupContext("lambda3");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("<lambda>", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "<lambda>") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("<lambda>", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":53
 * from khash cimport *
 * 
 * cdef inline int int_max(int a, int b): return a if a >= b else b             # <<<<<<<<<<<<<<
 * cdef inline int int_min(int a, int b): return a if a <= b else b
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_int_max(int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("int_max");
  if ((__pyx_v_a >= __pyx_v_b)) {
    __pyx_t_1 = __pyx_v_a;
  } else {
    __pyx_t_1 = __pyx_v_b;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":54
 * 
 * cdef inline int int_max(int a, int b): return a if a >= b else b
 * cdef inline int int_min(int a, int b): return a if a <= b else b             # <<<<<<<<<<<<<<
 * 
 * ctypedef unsigned char UChar
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_int_min(int __pyx_v_a, int __pyx_v_b) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("int_min");
  if ((__pyx_v_a <= __pyx_v_b)) {
    __pyx_t_1 = __pyx_v_a;
  } else {
    __pyx_t_1 = __pyx_v_b;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":72
 * import_ufunc()
 * 
 * cpdef map_indices_list(list index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

static PyObject *__pyx_pf_6pandas_3lib_map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_map_indices_list(PyObject *__pyx_v_index, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_indices_list");

  /* "pandas/src/tseries.pyx":83
 *     '''
 *     cdef Py_ssize_t i, length
 *     cdef dict result = {}             # <<<<<<<<<<<<<<
 * 
 *     length = len(index)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":85
 *     cdef dict result = {}
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < length:
 */
  if (unlikely(((PyObject *)__pyx_v_index) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_index)); 
  __pyx_v_length = __pyx_t_2;

  /* "pandas/src/tseries.pyx":87
 *     length = len(index)
 * 
 *     for i from 0 <= i < length:             # <<<<<<<<<<<<<<
 *         result[index[i]] = i
 * 
 */
  __pyx_t_2 = __pyx_v_length;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":88
 * 
 *     for i from 0 <= i < length:
 *         result[index[i]] = i             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_index), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pandas/src/tseries.pyx":90
 *         result[index[i]] = i
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.map_indices_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":72
 * import_ufunc()
 * 
 * cpdef map_indices_list(list index):             # <<<<<<<<<<<<<<
 *     '''
 *     Produce a dict mapping the values of the input array to their respective
 */

static PyObject *__pyx_pf_6pandas_3lib_map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static char __pyx_doc_6pandas_3lib_map_indices_list[] = "\n    Produce a dict mapping the values of the input array to their respective\n    locations.\n\n    Example:\n        array(['hi', 'there']) --> {'hi' : 0 , 'there' : 1}\n\n    Better to do this with Cython because of the enormous speed boost.\n    ";
static PyObject *__pyx_pf_6pandas_3lib_map_indices_list(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_indices_list");
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyList_Type), 1, "index", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib_map_indices_list(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.map_indices_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":95
 * from libc.stdlib cimport malloc, free
 * 
 * def ismember(ndarray arr, set values):             # <<<<<<<<<<<<<<
 *     '''
 *     Checks whether
 */

static PyObject *__pyx_pf_6pandas_3lib_1ismember(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_1ismember[] = "\n    Checks whether\n\n    Parameters\n    ----------\n    arr : ndarray\n    values : set\n\n    Returns\n    -------\n    ismember : ndarray (boolean dtype)\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_1ismember = {__Pyx_NAMESTR("ismember"), (PyCFunction)__pyx_pf_6pandas_3lib_1ismember, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_1ismember)};
static PyObject *__pyx_pf_6pandas_3lib_1ismember(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_values = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayIterObject *__pyx_v_it = 0;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_val = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__values,0};
  __Pyx_RefNannySetupContext("ismember");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ismember", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "ismember") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_values = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ismember", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.ismember", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PySet_Type), 1, "values", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/tseries.pyx":114
 *         object val
 * 
 *     it = <flatiter> PyArray_IterNew(arr)             # <<<<<<<<<<<<<<
 *     n = len(arr)
 *     result = np.empty(n, dtype=np.uint8)
 */
  __pyx_t_1 = PyArray_IterNew(((PyObject *)__pyx_v_arr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_t_1)));
  __pyx_v_it = ((PyArrayIterObject *)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":115
 * 
 *     it = <flatiter> PyArray_IterNew(arr)
 *     n = len(arr)             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype=np.uint8)
 *     for i in range(n):
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/tseries.pyx":116
 *     it = <flatiter> PyArray_IterNew(arr)
 *     n = len(arr)
 *     result = np.empty(n, dtype=np.uint8)             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/tseries.pyx":117
 *     n = len(arr)
 *     result = np.empty(n, dtype=np.uint8)
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *         if val in values:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/tseries.pyx":118
 *     result = np.empty(n, dtype=np.uint8)
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))             # <<<<<<<<<<<<<<
 *         if val in values:
 *             result[i] = 1
 */
    __pyx_t_6 = PyArray_GETITEM(__pyx_v_arr, PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "pandas/src/tseries.pyx":119
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *         if val in values:             # <<<<<<<<<<<<<<
 *             result[i] = 1
 *         else:
 */
    __pyx_t_13 = ((PySequence_Contains(((PyObject *)__pyx_v_values), __pyx_v_val))); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "pandas/src/tseries.pyx":120
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *         if val in values:
 *             result[i] = 1             # <<<<<<<<<<<<<<
 *         else:
 *             result[i] = 0
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_14, __pyx_bstride_0_result) = 1;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/tseries.pyx":122
 *             result[i] = 1
 *         else:
 *             result[i] = 0             # <<<<<<<<<<<<<<
 *         PyArray_ITER_NEXT(it)
 * 
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_15, __pyx_bstride_0_result) = 0;
    }
    __pyx_L8:;

    /* "pandas/src/tseries.pyx":123
 *         else:
 *             result[i] = 0
 *         PyArray_ITER_NEXT(it)             # <<<<<<<<<<<<<<
 * 
 *     return result.view(np.bool_)
 */
    PyArray_ITER_NEXT(__pyx_v_it);
  }

  /* "pandas/src/tseries.pyx":125
 *         PyArray_ITER_NEXT(it)
 * 
 *     return result.view(np.bool_)             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__bool_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.ismember", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_it);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":134
 * from datetime import date as pydate
 * 
 * cdef inline int64_t gmtime(object date):             # <<<<<<<<<<<<<<
 *     cdef int y, m, d, h, mn, s, days
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_gmtime(PyObject *__pyx_v_date) {
  int __pyx_v_y;
  int __pyx_v_m;
  int __pyx_v_d;
  int __pyx_v_h;
  int __pyx_v_mn;
  int __pyx_v_s;
  int __pyx_v_days;
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gmtime");

  /* "pandas/src/tseries.pyx":137
 *     cdef int y, m, d, h, mn, s, days
 * 
 *     y = PyDateTime_GET_YEAR(date)             # <<<<<<<<<<<<<<
 *     m = PyDateTime_GET_MONTH(date)
 *     d = PyDateTime_GET_DAY(date)
 */
  if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_date;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_y = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":138
 * 
 *     y = PyDateTime_GET_YEAR(date)
 *     m = PyDateTime_GET_MONTH(date)             # <<<<<<<<<<<<<<
 *     d = PyDateTime_GET_DAY(date)
 *     h = PyDateTime_DATE_GET_HOUR(date)
 */
  if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_date;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_m = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":139
 *     y = PyDateTime_GET_YEAR(date)
 *     m = PyDateTime_GET_MONTH(date)
 *     d = PyDateTime_GET_DAY(date)             # <<<<<<<<<<<<<<
 *     h = PyDateTime_DATE_GET_HOUR(date)
 *     mn = PyDateTime_DATE_GET_MINUTE(date)
 */
  if (!(likely(((__pyx_v_date) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_date, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_date;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_d = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":140
 *     m = PyDateTime_GET_MONTH(date)
 *     d = PyDateTime_GET_DAY(date)
 *     h = PyDateTime_DATE_GET_HOUR(date)             # <<<<<<<<<<<<<<
 *     mn = PyDateTime_DATE_GET_MINUTE(date)
 *     s = PyDateTime_DATE_GET_SECOND(date)
 */
  __pyx_v_h = PyDateTime_DATE_GET_HOUR(__pyx_v_date);

  /* "pandas/src/tseries.pyx":141
 *     d = PyDateTime_GET_DAY(date)
 *     h = PyDateTime_DATE_GET_HOUR(date)
 *     mn = PyDateTime_DATE_GET_MINUTE(date)             # <<<<<<<<<<<<<<
 *     s = PyDateTime_DATE_GET_SECOND(date)
 * 
 */
  __pyx_v_mn = PyDateTime_DATE_GET_MINUTE(__pyx_v_date);

  /* "pandas/src/tseries.pyx":142
 *     h = PyDateTime_DATE_GET_HOUR(date)
 *     mn = PyDateTime_DATE_GET_MINUTE(date)
 *     s = PyDateTime_DATE_GET_SECOND(date)             # <<<<<<<<<<<<<<
 * 
 *     days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1
 */
  __pyx_v_s = PyDateTime_DATE_GET_SECOND(__pyx_v_date);

  /* "pandas/src/tseries.pyx":144
 *     s = PyDateTime_DATE_GET_SECOND(date)
 * 
 *     days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1             # <<<<<<<<<<<<<<
 *     return ((<int64_t> (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pydate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__toordinal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromLong(__pyx_v_6pandas_3lib__EPOCH_ORD); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_days = __pyx_t_5;

  /* "pandas/src/tseries.pyx":145
 * 
 *     days = pydate(y, m, 1).toordinal() - _EPOCH_ORD + d - 1
 *     return ((<int64_t> (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000             # <<<<<<<<<<<<<<
 * 
 * cpdef object to_datetime(int64_t timestamp):
 */
  __pyx_r = (((((__pyx_t_5numpy_int64_t)((((__pyx_v_days * 24) + __pyx_v_h) * 60) + __pyx_v_mn)) * 60) + __pyx_v_s) * 1000);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pandas.lib.gmtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":147
 *     return ((<int64_t> (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000
 * 
 * cpdef object to_datetime(int64_t timestamp):             # <<<<<<<<<<<<<<
 *     return pydatetime.utcfromtimestamp(timestamp / 1000.0)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_2to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_timestamp, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_datetime");

  /* "pandas/src/tseries.pyx":148
 * 
 * cpdef object to_datetime(int64_t timestamp):
 *     return pydatetime.utcfromtimestamp(timestamp / 1000.0)             # <<<<<<<<<<<<<<
 * 
 * cpdef object to_timestamp(object dt):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__pydatetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__utcfromtimestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_timestamp / 1000.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":147
 *     return ((<int64_t> (((days * 24 + h) * 60 + mn))) * 60 + s) * 1000
 * 
 * cpdef object to_datetime(int64_t timestamp):             # <<<<<<<<<<<<<<
 *     return pydatetime.utcfromtimestamp(timestamp / 1000.0)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_2to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_2to_datetime(PyObject *__pyx_self, PyObject *__pyx_arg_timestamp) {
  __pyx_t_5numpy_int64_t __pyx_v_timestamp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_datetime");
  __pyx_self = __pyx_self;
  assert(__pyx_arg_timestamp); {
    __pyx_v_timestamp = __Pyx_PyInt_from_py_npy_int64(__pyx_arg_timestamp); if (unlikely((__pyx_v_timestamp == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib_to_datetime(__pyx_v_timestamp, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":150
 *     return pydatetime.utcfromtimestamp(timestamp / 1000.0)
 * 
 * cpdef object to_timestamp(object dt):             # <<<<<<<<<<<<<<
 *     return gmtime(dt)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_3to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_to_timestamp(PyObject *__pyx_v_dt, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_timestamp");

  /* "pandas/src/tseries.pyx":151
 * 
 * cpdef object to_timestamp(object dt):
 *     return gmtime(dt)             # <<<<<<<<<<<<<<
 * 
 * def array_to_timestamp(ndarray[object, ndim=1] arr):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(__pyx_f_6pandas_3lib_gmtime(__pyx_v_dt)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":150
 *     return pydatetime.utcfromtimestamp(timestamp / 1000.0)
 * 
 * cpdef object to_timestamp(object dt):             # <<<<<<<<<<<<<<
 *     return gmtime(dt)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_3to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_3to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_dt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_timestamp");
  __pyx_self = __pyx_self;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib_to_timestamp(__pyx_v_dt, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":153
 *     return gmtime(dt)
 * 
 * def array_to_timestamp(ndarray[object, ndim=1] arr):             # <<<<<<<<<<<<<<
 *     cdef int i, n
 *     cdef ndarray[int64_t, ndim=1] result
 */

static PyObject *__pyx_pf_6pandas_3lib_4array_to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_4array_to_timestamp = {__Pyx_NAMESTR("array_to_timestamp"), (PyCFunction)__pyx_pf_6pandas_3lib_4array_to_timestamp, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_4array_to_timestamp(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  int __pyx_v_i;
  int __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_to_timestamp");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "pandas/src/tseries.pyx":157
 *     cdef ndarray[int64_t, ndim=1] result
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype=np.int64)
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":158
 * 
 *     n = len(arr)
 *     result = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/tseries.pyx":160
 *     result = np.empty(n, dtype=np.int64)
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         result[i] = gmtime(arr[i])
 * 
 */
  __pyx_t_8 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":161
 * 
 *     for i from 0 <= i < n:
 *         result[i] = gmtime(arr[i])             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_arr)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_arr.buf, __pyx_t_12, __pyx_bstride_0_arr);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_14 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_result)) __pyx_t_14 = 0;
    if (unlikely(__pyx_t_14 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_14);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_13, __pyx_bstride_0_result) = __pyx_f_6pandas_3lib_gmtime(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pandas/src/tseries.pyx":163
 *         result[i] = gmtime(arr[i])
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def time64_to_datetime(ndarray[int64_t, ndim=1] arr):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.array_to_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":165
 *     return result
 * 
 * def time64_to_datetime(ndarray[int64_t, ndim=1] arr):             # <<<<<<<<<<<<<<
 *     cdef int i, n
 *     cdef ndarray[object, ndim=1] result
 */

static PyObject *__pyx_pf_6pandas_3lib_5time64_to_datetime(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_5time64_to_datetime = {__Pyx_NAMESTR("time64_to_datetime"), (PyCFunction)__pyx_pf_6pandas_3lib_5time64_to_datetime, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_5time64_to_datetime(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  int __pyx_v_i;
  int __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  PyObject **__pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time64_to_datetime");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "pandas/src/tseries.pyx":169
 *     cdef ndarray[object, ndim=1] result
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype=object)
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":170
 * 
 *     n = len(arr)
 *     result = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/tseries.pyx":172
 *     result = np.empty(n, dtype=object)
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         result[i] = to_datetime(arr[i])
 * 
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":173
 * 
 *     for i from 0 <= i < n:
 *         result[i] = to_datetime(arr[i])             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_12 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_arr)) __pyx_t_12 = 0;
    if (unlikely(__pyx_t_12 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_12);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __pyx_f_6pandas_3lib_to_datetime((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_arr.buf, __pyx_t_11, __pyx_bstride_0_arr)), 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_result)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_12, __pyx_bstride_0_result);
    __Pyx_GOTREF(*__pyx_t_14);
    __Pyx_DECREF(*__pyx_t_14); __Pyx_INCREF(__pyx_t_5);
    *__pyx_t_14 = __pyx_t_5;
    __Pyx_GIVEREF(*__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "pandas/src/tseries.pyx":175
 *         result[i] = to_datetime(arr[i])
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.time64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":183
 * cdef double NEGINF = -INF
 * 
 * cpdef checknull(object val):             # <<<<<<<<<<<<<<
 *     if util.is_float_object(val) or util.is_complex_object(val):
 *         return val != val or val == INF or val == NEGINF
 */

static PyObject *__pyx_pf_6pandas_3lib_6checknull(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_checknull(PyObject *__pyx_v_val, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("checknull");

  /* "pandas/src/tseries.pyx":184
 * 
 * cpdef checknull(object val):
 *     if util.is_float_object(val) or util.is_complex_object(val):             # <<<<<<<<<<<<<<
 *         return val != val or val == INF or val == NEGINF
 *     elif util.is_datetime64_object(val):
 */
  __pyx_t_1 = is_float_object(__pyx_v_val);
  if (!__pyx_t_1) {
    __pyx_t_2 = is_complex_object(__pyx_v_val);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":185
 * cpdef checknull(object val):
 *     if util.is_float_object(val) or util.is_complex_object(val):
 *         return val != val or val == INF or val == NEGINF             # <<<<<<<<<<<<<<
 *     elif util.is_datetime64_object(val):
 *         return get_datetime64_value(val) == NPY_NAT
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_3) {
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_6pandas_3lib_INF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_val, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_3) {
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_5 = PyFloat_FromDouble(__pyx_v_6pandas_3lib_NEGINF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyObject_RichCompare(__pyx_v_val, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __pyx_t_7;
        __pyx_t_7 = 0;
      } else {
        __pyx_t_5 = __pyx_t_6;
        __pyx_t_6 = 0;
      }
      __pyx_t_6 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {
      __pyx_t_6 = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pandas/src/tseries.pyx":186
 *     if util.is_float_object(val) or util.is_complex_object(val):
 *         return val != val or val == INF or val == NEGINF
 *     elif util.is_datetime64_object(val):             # <<<<<<<<<<<<<<
 *         return get_datetime64_value(val) == NPY_NAT
 *     elif isinstance(val, _NaT):
 */
  __pyx_t_1 = is_datetime64_object(__pyx_v_val);
  if (__pyx_t_1) {

    /* "pandas/src/tseries.pyx":187
 *         return val != val or val == INF or val == NEGINF
 *     elif util.is_datetime64_object(val):
 *         return get_datetime64_value(val) == NPY_NAT             # <<<<<<<<<<<<<<
 *     elif isinstance(val, _NaT):
 *         return True
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyBool_FromLong((get_datetime64_value(__pyx_v_val) == __pyx_v_6pandas_3lib_NPY_NAT)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pandas/src/tseries.pyx":188
 *     elif util.is_datetime64_object(val):
 *         return get_datetime64_value(val) == NPY_NAT
 *     elif isinstance(val, _NaT):             # <<<<<<<<<<<<<<
 *         return True
 *     elif is_array(val):
 */
  __pyx_t_6 = ((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__NaT));
  __Pyx_INCREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_val, __pyx_t_6); 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":189
 *         return get_datetime64_value(val) == NPY_NAT
 *     elif isinstance(val, _NaT):
 *         return True             # <<<<<<<<<<<<<<
 *     elif is_array(val):
 *         return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "pandas/src/tseries.pyx":190
 *     elif isinstance(val, _NaT):
 *         return True
 *     elif is_array(val):             # <<<<<<<<<<<<<<
 *         return False
 *     else:
 */
  __pyx_t_6 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":191
 *         return True
 *     elif is_array(val):
 *         return False             # <<<<<<<<<<<<<<
 *     else:
 *         return util._checknull(val)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "pandas/src/tseries.pyx":193
 *         return False
 *     else:
 *         return util._checknull(val)             # <<<<<<<<<<<<<<
 * 
 * def isscalar(object val):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_f_4util__checknull(__pyx_v_val)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pandas.lib.checknull", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":183
 * cdef double NEGINF = -INF
 * 
 * cpdef checknull(object val):             # <<<<<<<<<<<<<<
 *     if util.is_float_object(val) or util.is_complex_object(val):
 *         return val != val or val == INF or val == NEGINF
 */

static PyObject *__pyx_pf_6pandas_3lib_6checknull(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_6checknull(PyObject *__pyx_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("checknull");
  __pyx_self = __pyx_self;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib_checknull(__pyx_v_val, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.checknull", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":195
 *         return util._checknull(val)
 * 
 * def isscalar(object val):             # <<<<<<<<<<<<<<
 *     return np.isscalar(val) or val is None or isinstance(val, _Timestamp)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_7isscalar(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_7isscalar = {__Pyx_NAMESTR("isscalar"), (PyCFunction)__pyx_pf_6pandas_3lib_7isscalar, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_7isscalar(PyObject *__pyx_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isscalar");
  __pyx_self = __pyx_self;

  /* "pandas/src/tseries.pyx":196
 * 
 * def isscalar(object val):
 *     return np.isscalar(val) or val is None or isinstance(val, _Timestamp)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__isscalar); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_val);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val);
  __Pyx_GIVEREF(__pyx_v_val);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = (__pyx_v_val == Py_None);
    if (!__pyx_t_4) {
      __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__Timestamp));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_val, __pyx_t_1); 
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
  } else {
    __pyx_t_2 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.isscalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":201
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def isnullobj(ndarray[object] arr):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, n
 *     cdef object val
 */

static PyObject *__pyx_pf_6pandas_3lib_8isnullobj(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_8isnullobj = {__Pyx_NAMESTR("isnullobj"), (PyCFunction)__pyx_pf_6pandas_3lib_8isnullobj, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_8isnullobj(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isnullobj");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "pandas/src/tseries.pyx":206
 *     cdef ndarray[uint8_t] result
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 *     result = np.zeros(n, dtype=np.uint8)
 *     for i from 0 <= i < n:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":207
 * 
 *     n = len(arr)
 *     result = np.zeros(n, dtype=np.uint8)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         result[i] = util._checknull(arr[i])
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/tseries.pyx":208
 *     n = len(arr)
 *     result = np.zeros(n, dtype=np.uint8)
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         result[i] = util._checknull(arr[i])
 *     return result.view(np.bool_)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":209
 *     result = np.zeros(n, dtype=np.uint8)
 *     for i from 0 <= i < n:
 *         result[i] = util._checknull(arr[i])             # <<<<<<<<<<<<<<
 *     return result.view(np.bool_)
 * 
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_arr.buf, __pyx_t_12, __pyx_bstride_0_arr);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __pyx_t_13 = __pyx_v_i;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_13, __pyx_bstride_0_result) = __pyx_f_4util__checknull(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pandas/src/tseries.pyx":210
 *     for i from 0 <= i < n:
 *         result[i] = util._checknull(arr[i])
 *     return result.view(np.bool_)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__bool_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.isnullobj", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":215
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def isnullobj2d(ndarray[object, ndim=2] arr):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, n, m
 *     cdef object val
 */

static PyObject *__pyx_pf_6pandas_3lib_9isnullobj2d(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9isnullobj2d = {__Pyx_NAMESTR("isnullobj2d"), (PyCFunction)__pyx_pf_6pandas_3lib_9isnullobj2d, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9isnullobj2d(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_m;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bstride_1_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  Py_ssize_t __pyx_bshape_1_arr = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isnullobj2d");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0]; __pyx_bstride_1_arr = __pyx_bstruct_arr.strides[1];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0]; __pyx_bshape_1_arr = __pyx_bstruct_arr.shape[1];

  /* "pandas/src/tseries.pyx":220
 *     cdef ndarray[uint8_t, ndim=2] result
 * 
 *     n, m = (<object> arr).shape             # <<<<<<<<<<<<<<
 *     result = np.zeros((n, m), dtype=np.uint8)
 *     for i from 0 <= i < n:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_n = __pyx_t_6;
  __pyx_v_m = __pyx_t_7;

  /* "pandas/src/tseries.pyx":221
 * 
 *     n, m = (<object> arr).shape
 *     result = np.zeros((n, m), dtype=np.uint8)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < m:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uint8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "pandas/src/tseries.pyx":222
 *     n, m = (<object> arr).shape
 *     result = np.zeros((n, m), dtype=np.uint8)
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < m:
 *             val = arr[i, j]
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":223
 *     result = np.zeros((n, m), dtype=np.uint8)
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < m:             # <<<<<<<<<<<<<<
 *             val = arr[i, j]
 *             if checknull(val):
 */
    __pyx_t_6 = __pyx_v_m;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

      /* "pandas/src/tseries.pyx":224
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < m:
 *             val = arr[i, j]             # <<<<<<<<<<<<<<
 *             if checknull(val):
 *                 result[i, j] = 1
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = __pyx_v_j;
      __pyx_t_8 = *__Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_arr.buf, __pyx_t_14, __pyx_bstride_0_arr, __pyx_t_15, __pyx_bstride_1_arr);
      __Pyx_INCREF((PyObject*)__pyx_t_8);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "pandas/src/tseries.pyx":225
 *         for j from 0 <= j < m:
 *             val = arr[i, j]
 *             if checknull(val):             # <<<<<<<<<<<<<<
 *                 result[i, j] = 1
 *     return result.view(np.bool_)
 */
      __pyx_t_8 = __pyx_f_6pandas_3lib_checknull(__pyx_v_val, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_16) {

        /* "pandas/src/tseries.pyx":226
 *             val = arr[i, j]
 *             if checknull(val):
 *                 result[i, j] = 1             # <<<<<<<<<<<<<<
 *     return result.view(np.bool_)
 * 
 */
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_18 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result, __pyx_t_18, __pyx_bstride_1_result) = 1;
        goto __pyx_L11;
      }
      __pyx_L11:;
    }
  }

  /* "pandas/src/tseries.pyx":227
 *             if checknull(val):
 *                 result[i, j] = 1
 *     return result.view(np.bool_)             # <<<<<<<<<<<<<<
 * 
 * def list_to_object_array(list obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__bool_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.isnullobj2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":229
 *     return result.view(np.bool_)
 * 
 * def list_to_object_array(list obj):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert list to object ndarray. Seriously can't believe I had to write this
 */

static PyObject *__pyx_pf_6pandas_3lib_10list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_6pandas_3lib_10list_to_object_array[] = "\n    Convert list to object ndarray. Seriously can't believe I had to write this\n    function\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_10list_to_object_array = {__Pyx_NAMESTR("list_to_object_array"), (PyCFunction)__pyx_pf_6pandas_3lib_10list_to_object_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_10list_to_object_array)};
static PyObject *__pyx_pf_6pandas_3lib_10list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_arr = 0;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject **__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_to_object_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/tseries.pyx":238
 *         ndarray[object] arr
 * 
 *     n = len(obj)             # <<<<<<<<<<<<<<
 *     arr = np.empty(n, dtype=object)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_obj) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_obj)); 
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":239
 * 
 *     n = len(obj)
 *     arr = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
    __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/tseries.pyx":241
 *     arr = np.empty(n, dtype=object)
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         arr[i] = obj[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":242
 * 
 *     for i from 0 <= i < n:
 *         arr[i] = obj[i]             # <<<<<<<<<<<<<<
 * 
 *     return arr
 */
    __pyx_t_5 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_obj), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_arr)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_arr.buf, __pyx_t_11, __pyx_bstride_0_arr);
    __Pyx_GOTREF(*__pyx_t_12);
    __Pyx_DECREF(*__pyx_t_12); __Pyx_INCREF(__pyx_t_5);
    *__pyx_t_12 = __pyx_t_5;
    __Pyx_GIVEREF(*__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "pandas/src/tseries.pyx":244
 *         arr[i] = obj[i]
 * 
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyObject *)__pyx_v_arr);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.list_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":249
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def fast_unique(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_11fast_unique(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_11fast_unique = {__Pyx_NAMESTR("fast_unique"), (PyCFunction)__pyx_pf_6pandas_3lib_11fast_unique, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_11fast_unique(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_uniques = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_stub = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fast_unique");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "pandas/src/tseries.pyx":251
 * def fast_unique(ndarray[object] values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         list uniques = []
 *         dict table = {}
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":252
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 *         list uniques = []             # <<<<<<<<<<<<<<
 *         dict table = {}
 *         object val, stub = 0
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":253
 *         Py_ssize_t i, n = len(values)
 *         list uniques = []
 *         dict table = {}             # <<<<<<<<<<<<<<
 *         object val, stub = 0
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_table = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":254
 *         list uniques = []
 *         dict table = {}
 *         object val, stub = 0             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_stub = __pyx_int_0;

  /* "pandas/src/tseries.pyx":256
 *         object val, stub = 0
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         val = values[i]
 *         if val not in table:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":257
 * 
 *     for i from 0 <= i < n:
 *         val = values[i]             # <<<<<<<<<<<<<<
 *         if val not in table:
 *             table[val] = stub
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_3, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":258
 *     for i from 0 <= i < n:
 *         val = values[i]
 *         if val not in table:             # <<<<<<<<<<<<<<
 *             table[val] = stub
 *             uniques.append(val)
 */
    if (unlikely(((PyObject *)__pyx_v_table) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_4 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)__pyx_v_table), __pyx_v_val))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

      /* "pandas/src/tseries.pyx":259
 *         val = values[i]
 *         if val not in table:
 *             table[val] = stub             # <<<<<<<<<<<<<<
 *             uniques.append(val)
 *     try:
 */
      if (PyDict_SetItem(((PyObject *)__pyx_v_table), __pyx_v_val, __pyx_v_stub) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "pandas/src/tseries.pyx":260
 *         if val not in table:
 *             table[val] = stub
 *             uniques.append(val)             # <<<<<<<<<<<<<<
 *     try:
 *         uniques.sort()
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_5 = PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "pandas/src/tseries.pyx":261
 *             table[val] = stub
 *             uniques.append(val)
 *     try:             # <<<<<<<<<<<<<<
 *         uniques.sort()
 *     except Exception:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "pandas/src/tseries.pyx":262
 *             uniques.append(val)
 *     try:
 *         uniques.sort()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         pass
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "sort"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L8_error;} 
      }
      __pyx_t_5 = PyList_Sort(((PyObject *)__pyx_v_uniques)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L15_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":263
 *     try:
 *         uniques.sort()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_9) {
      PyErr_Restore(0,0,0);
      goto __pyx_L9_exception_handled;
    }
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L9_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L15_try_end:;
  }

  /* "pandas/src/tseries.pyx":266
 *         pass
 * 
 *     return uniques             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  __pyx_r = ((PyObject *)__pyx_v_uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.fast_unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_stub);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":270
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def fast_unique_multiple(list arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ndarray[object] buf
 */

static PyObject *__pyx_pf_6pandas_3lib_12fast_unique_multiple(PyObject *__pyx_self, PyObject *__pyx_v_arrays); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_12fast_unique_multiple = {__Pyx_NAMESTR("fast_unique_multiple"), (PyCFunction)__pyx_pf_6pandas_3lib_12fast_unique_multiple, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_12fast_unique_multiple(PyObject *__pyx_self, PyObject *__pyx_v_arrays) {
  PyArrayObject *__pyx_v_buf = 0;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_uniques = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_stub = 0;
  Py_buffer __pyx_bstruct_buf;
  Py_ssize_t __pyx_bstride_0_buf = 0;
  Py_ssize_t __pyx_bshape_0_buf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fast_unique_multiple");
  __pyx_self = __pyx_self;
  __pyx_bstruct_buf.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arrays), (&PyList_Type), 1, "arrays", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/tseries.pyx":273
 *     cdef:
 *         ndarray[object] buf
 *         Py_ssize_t k = len(arrays)             # <<<<<<<<<<<<<<
 *         Py_ssize_t i, j, n
 *         list uniques = []
 */
  if (unlikely(((PyObject *)__pyx_v_arrays) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_arrays)); 
  __pyx_v_k = __pyx_t_1;

  /* "pandas/src/tseries.pyx":275
 *         Py_ssize_t k = len(arrays)
 *         Py_ssize_t i, j, n
 *         list uniques = []             # <<<<<<<<<<<<<<
 *         dict table = {}
 *         object val, stub = 0
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":276
 *         Py_ssize_t i, j, n
 *         list uniques = []
 *         dict table = {}             # <<<<<<<<<<<<<<
 *         object val, stub = 0
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_table = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":277
 *         list uniques = []
 *         dict table = {}
 *         object val, stub = 0             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < k:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_stub = __pyx_int_0;

  /* "pandas/src/tseries.pyx":279
 *         object val, stub = 0
 * 
 *     for i from 0 <= i < k:             # <<<<<<<<<<<<<<
 *         buf = arrays[i]
 *         n = len(buf)
 */
  __pyx_t_1 = __pyx_v_k;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":280
 * 
 *     for i from 0 <= i < k:
 *         buf = arrays[i]             # <<<<<<<<<<<<<<
 *         n = len(buf)
 *         for j from 0 <= j < n:
 */
    if (!(likely(((PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = ((PyArrayObject *)PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i));
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_buf);
      __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_buf, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_4 < 0)) {
        PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_buf, (PyObject*)__pyx_v_buf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        }
      }
      __pyx_bstride_0_buf = __pyx_bstruct_buf.strides[0];
      __pyx_bshape_0_buf = __pyx_bstruct_buf.shape[0];
      if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = 0;
    __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i));
    __Pyx_XDECREF(((PyObject *)__pyx_v_buf));
    __pyx_v_buf = ((PyArrayObject *)PyList_GET_ITEM(__pyx_v_arrays, __pyx_v_i));

    /* "pandas/src/tseries.pyx":281
 *     for i from 0 <= i < k:
 *         buf = arrays[i]
 *         n = len(buf)             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < n:
 *             val = buf[j]
 */
    __pyx_t_8 = PyObject_Length(((PyObject *)__pyx_v_buf)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_n = __pyx_t_8;

    /* "pandas/src/tseries.pyx":282
 *         buf = arrays[i]
 *         n = len(buf)
 *         for j from 0 <= j < n:             # <<<<<<<<<<<<<<
 *             val = buf[j]
 *             if val not in table:
 */
    __pyx_t_8 = __pyx_v_n;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_8; __pyx_v_j++) {

      /* "pandas/src/tseries.pyx":283
 *         n = len(buf)
 *         for j from 0 <= j < n:
 *             val = buf[j]             # <<<<<<<<<<<<<<
 *             if val not in table:
 *                 table[val] = stub
 */
      __pyx_t_9 = __pyx_v_j;
      __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_buf.buf, __pyx_t_9, __pyx_bstride_0_buf);
      __Pyx_INCREF((PyObject*)__pyx_t_2);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pandas/src/tseries.pyx":284
 *         for j from 0 <= j < n:
 *             val = buf[j]
 *             if val not in table:             # <<<<<<<<<<<<<<
 *                 table[val] = stub
 *                 uniques.append(val)
 */
      if (unlikely(((PyObject *)__pyx_v_table) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_10 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)__pyx_v_table), __pyx_v_val))); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_10) {

        /* "pandas/src/tseries.pyx":285
 *             val = buf[j]
 *             if val not in table:
 *                 table[val] = stub             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 *     try:
 */
        if (PyDict_SetItem(((PyObject *)__pyx_v_table), __pyx_v_val, __pyx_v_stub) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/src/tseries.pyx":286
 *             if val not in table:
 *                 table[val] = stub
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 *     try:
 *         uniques.sort()
 */
        if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
        }
        __pyx_t_11 = PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
  }

  /* "pandas/src/tseries.pyx":287
 *                 table[val] = stub
 *                 uniques.append(val)
 *     try:             # <<<<<<<<<<<<<<
 *         uniques.sort()
 *     except Exception:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "pandas/src/tseries.pyx":288
 *                 uniques.append(val)
 *     try:
 *         uniques.sort()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         pass
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "sort"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L10_error;} 
      }
      __pyx_t_11 = PyList_Sort(((PyObject *)__pyx_v_uniques)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L17_try_end;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":289
 *     try:
 *         uniques.sort()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_4) {
      PyErr_Restore(0,0,0);
      goto __pyx_L11_exception_handled;
    }
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L11_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
    __pyx_L17_try_end:;
  }

  /* "pandas/src/tseries.pyx":292
 *         pass
 * 
 *     return uniques             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  __pyx_r = ((PyObject *)__pyx_v_uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_buf);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.fast_unique_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_buf);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_stub);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":296
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def fast_unique_multiple_list(list lists):             # <<<<<<<<<<<<<<
 *     cdef:
 *         list buf
 */

static PyObject *__pyx_pf_6pandas_3lib_13fast_unique_multiple_list(PyObject *__pyx_self, PyObject *__pyx_v_lists); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_13fast_unique_multiple_list = {__Pyx_NAMESTR("fast_unique_multiple_list"), (PyCFunction)__pyx_pf_6pandas_3lib_13fast_unique_multiple_list, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_13fast_unique_multiple_list(PyObject *__pyx_self, PyObject *__pyx_v_lists) {
  PyObject *__pyx_v_buf = 0;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_uniques = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_stub = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fast_unique_multiple_list");
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lists), (&PyList_Type), 1, "lists", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/tseries.pyx":299
 *     cdef:
 *         list buf
 *         Py_ssize_t k = len(lists)             # <<<<<<<<<<<<<<
 *         Py_ssize_t i, j, n
 *         list uniques = []
 */
  if (unlikely(((PyObject *)__pyx_v_lists) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_lists)); 
  __pyx_v_k = __pyx_t_1;

  /* "pandas/src/tseries.pyx":301
 *         Py_ssize_t k = len(lists)
 *         Py_ssize_t i, j, n
 *         list uniques = []             # <<<<<<<<<<<<<<
 *         dict table = {}
 *         object val, stub = 0
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":302
 *         Py_ssize_t i, j, n
 *         list uniques = []
 *         dict table = {}             # <<<<<<<<<<<<<<
 *         object val, stub = 0
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_table = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":303
 *         list uniques = []
 *         dict table = {}
 *         object val, stub = 0             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < k:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_stub = __pyx_int_0;

  /* "pandas/src/tseries.pyx":305
 *         object val, stub = 0
 * 
 *     for i from 0 <= i < k:             # <<<<<<<<<<<<<<
 *         buf = lists[i]
 *         n = len(buf)
 */
  __pyx_t_1 = __pyx_v_k;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "pandas/src/tseries.pyx":306
 * 
 *     for i from 0 <= i < k:
 *         buf = lists[i]             # <<<<<<<<<<<<<<
 *         n = len(buf)
 *         for j from 0 <= j < n:
 */
    if (!(likely(PyList_CheckExact(PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i)))||((PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i))->tp_name), 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i));
    __Pyx_XDECREF(((PyObject *)__pyx_v_buf));
    __pyx_v_buf = ((PyObject*)PyList_GET_ITEM(__pyx_v_lists, __pyx_v_i));

    /* "pandas/src/tseries.pyx":307
 *     for i from 0 <= i < k:
 *         buf = lists[i]
 *         n = len(buf)             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < n:
 *             val = buf[j]
 */
    if (unlikely(((PyObject *)__pyx_v_buf) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_buf)); 
    __pyx_v_n = __pyx_t_3;

    /* "pandas/src/tseries.pyx":308
 *         buf = lists[i]
 *         n = len(buf)
 *         for j from 0 <= j < n:             # <<<<<<<<<<<<<<
 *             val = buf[j]
 *             if val not in table:
 */
    __pyx_t_3 = __pyx_v_n;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {

      /* "pandas/src/tseries.pyx":309
 *         n = len(buf)
 *         for j from 0 <= j < n:
 *             val = buf[j]             # <<<<<<<<<<<<<<
 *             if val not in table:
 *                 table[val] = stub
 */
      __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_buf, __pyx_v_j));
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = PyList_GET_ITEM(__pyx_v_buf, __pyx_v_j);

      /* "pandas/src/tseries.pyx":310
 *         for j from 0 <= j < n:
 *             val = buf[j]
 *             if val not in table:             # <<<<<<<<<<<<<<
 *                 table[val] = stub
 *                 uniques.append(val)
 */
      if (unlikely(((PyObject *)__pyx_v_table) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_4 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)__pyx_v_table), __pyx_v_val))); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_4) {

        /* "pandas/src/tseries.pyx":311
 *             val = buf[j]
 *             if val not in table:
 *                 table[val] = stub             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 *     try:
 */
        if (PyDict_SetItem(((PyObject *)__pyx_v_table), __pyx_v_val, __pyx_v_stub) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/src/tseries.pyx":312
 *             if val not in table:
 *                 table[val] = stub
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 *     try:
 *         uniques.sort()
 */
        if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
        }
        __pyx_t_5 = PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
  }

  /* "pandas/src/tseries.pyx":313
 *                 table[val] = stub
 *                 uniques.append(val)
 *     try:             # <<<<<<<<<<<<<<
 *         uniques.sort()
 *     except Exception:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "pandas/src/tseries.pyx":314
 *                 uniques.append(val)
 *     try:
 *         uniques.sort()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         pass
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "sort"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L10_error;} 
      }
      __pyx_t_5 = PyList_Sort(((PyObject *)__pyx_v_uniques)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L17_try_end;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":315
 *     try:
 *         uniques.sort()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_9) {
      PyErr_Restore(0,0,0);
      goto __pyx_L11_exception_handled;
    }
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L11_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L17_try_end:;
  }

  /* "pandas/src/tseries.pyx":318
 *         pass
 * 
 *     return uniques             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  __pyx_r = ((PyObject *)__pyx_v_uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.fast_unique_multiple_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_stub);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":322
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def fast_unique_multiple_list_gen(object gen):             # <<<<<<<<<<<<<<
 *     cdef:
 *         list buf
 */

static PyObject *__pyx_pf_6pandas_3lib_14fast_unique_multiple_list_gen(PyObject *__pyx_self, PyObject *__pyx_v_gen); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_14fast_unique_multiple_list_gen = {__Pyx_NAMESTR("fast_unique_multiple_list_gen"), (PyCFunction)__pyx_pf_6pandas_3lib_14fast_unique_multiple_list_gen, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_14fast_unique_multiple_list_gen(PyObject *__pyx_self, PyObject *__pyx_v_gen) {
  PyObject *__pyx_v_buf = 0;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_uniques = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_stub = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fast_unique_multiple_list_gen");
  __pyx_self = __pyx_self;

  /* "pandas/src/tseries.pyx":326
 *         list buf
 *         Py_ssize_t j, n
 *         list uniques = []             # <<<<<<<<<<<<<<
 *         dict table = {}
 *         object val, stub = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_uniques = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":327
 *         Py_ssize_t j, n
 *         list uniques = []
 *         dict table = {}             # <<<<<<<<<<<<<<
 *         object val, stub = 0
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_table = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":328
 *         list uniques = []
 *         dict table = {}
 *         object val, stub = 0             # <<<<<<<<<<<<<<
 * 
 *     for buf in gen:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_stub = __pyx_int_0;

  /* "pandas/src/tseries.pyx":330
 *         object val, stub = 0
 * 
 *     for buf in gen:             # <<<<<<<<<<<<<<
 *         n = len(buf)
 *         for j from 0 <= j < n:
 */
  if (PyList_CheckExact(__pyx_v_gen) || PyTuple_CheckExact(__pyx_v_gen)) {
    __pyx_t_1 = __pyx_v_gen; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_gen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
    } else if (PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[3]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_buf));
    __pyx_v_buf = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pandas/src/tseries.pyx":331
 * 
 *     for buf in gen:
 *         n = len(buf)             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < n:
 *             val = buf[j]
 */
    if (unlikely(((PyObject *)__pyx_v_buf) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_buf)); 
    __pyx_v_n = __pyx_t_5;

    /* "pandas/src/tseries.pyx":332
 *     for buf in gen:
 *         n = len(buf)
 *         for j from 0 <= j < n:             # <<<<<<<<<<<<<<
 *             val = buf[j]
 *             if val not in table:
 */
    __pyx_t_5 = __pyx_v_n;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {

      /* "pandas/src/tseries.pyx":333
 *         n = len(buf)
 *         for j from 0 <= j < n:
 *             val = buf[j]             # <<<<<<<<<<<<<<
 *             if val not in table:
 *                 table[val] = stub
 */
      __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_buf, __pyx_v_j));
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = PyList_GET_ITEM(__pyx_v_buf, __pyx_v_j);

      /* "pandas/src/tseries.pyx":334
 *         for j from 0 <= j < n:
 *             val = buf[j]
 *             if val not in table:             # <<<<<<<<<<<<<<
 *                 table[val] = stub
 *                 uniques.append(val)
 */
      if (unlikely(((PyObject *)__pyx_v_table) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_6 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)__pyx_v_table), __pyx_v_val))); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_6) {

        /* "pandas/src/tseries.pyx":335
 *             val = buf[j]
 *             if val not in table:
 *                 table[val] = stub             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 * 
 */
        if (PyDict_SetItem(((PyObject *)__pyx_v_table), __pyx_v_val, __pyx_v_stub) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "pandas/src/tseries.pyx":336
 *             if val not in table:
 *                 table[val] = stub
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
        if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
        }
        __pyx_t_7 = PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":338
 *                 uniques.append(val)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         uniques.sort()
 *     except Exception:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "pandas/src/tseries.pyx":339
 * 
 *     try:
 *         uniques.sort()             # <<<<<<<<<<<<<<
 *     except Exception:
 *         pass
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "sort"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L10_error;} 
      }
      __pyx_t_7 = PyList_Sort(((PyObject *)__pyx_v_uniques)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L17_try_end;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pandas/src/tseries.pyx":340
 *     try:
 *         uniques.sort()
 *     except Exception:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_11) {
      PyErr_Restore(0,0,0);
      goto __pyx_L11_exception_handled;
    }
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L11_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L17_try_end:;
  }

  /* "pandas/src/tseries.pyx":343
 *         pass
 * 
 *     return uniques             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  __pyx_r = ((PyObject *)__pyx_v_uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.fast_unique_multiple_list_gen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XDECREF(__pyx_v_table);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_stub);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":347
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def dicts_to_array(list dicts, list columns):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n
 */

static PyObject *__pyx_pf_6pandas_3lib_15dicts_to_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_15dicts_to_array = {__Pyx_NAMESTR("dicts_to_array"), (PyCFunction)__pyx_pf_6pandas_3lib_15dicts_to_array, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_15dicts_to_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dicts = 0;
  PyObject *__pyx_v_columns = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_v_col = 0;
  PyObject *__pyx_v_onan = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject **__pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dicts,&__pyx_n_s__columns,0};
  __Pyx_RefNannySetupContext("dicts_to_array");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dicts);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__columns);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dicts_to_array", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dicts_to_array") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_dicts = ((PyObject*)values[0]);
    __pyx_v_columns = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dicts_to_array", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.dicts_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dicts), (&PyList_Type), 1, "dicts", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_columns), (&PyList_Type), 1, "columns", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/tseries.pyx":352
 *         ndarray[object, ndim=2] result
 *         dict row
 *         object col, onan = np.nan             # <<<<<<<<<<<<<<
 * 
 *     k = len(columns)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_onan = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":354
 *         object col, onan = np.nan
 * 
 *     k = len(columns)             # <<<<<<<<<<<<<<
 *     n = len(dicts)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_columns) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_columns)); 
  __pyx_v_k = __pyx_t_3;

  /* "pandas/src/tseries.pyx":355
 * 
 *     k = len(columns)
 *     n = len(dicts)             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty((n, k), dtype='O')
 */
  if (unlikely(((PyObject *)__pyx_v_dicts) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_dicts)); 
  __pyx_v_n = __pyx_t_3;

  /* "pandas/src/tseries.pyx":357
 *     n = len(dicts)
 * 
 *     result = np.empty((n, k), dtype='O')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":359
 *     result = np.empty((n, k), dtype='O')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         row = dicts[i]
 *         for j in range(k):
 */
  __pyx_t_3 = __pyx_v_n;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_3; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pandas/src/tseries.pyx":360
 * 
 *     for i in range(n):
 *         row = dicts[i]             # <<<<<<<<<<<<<<
 *         for j in range(k):
 *             col = columns[j]
 */
    if (!(likely(PyDict_CheckExact(PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i)))||((PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i))->tp_name), 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i));
    __Pyx_XDECREF(((PyObject *)__pyx_v_row));
    __pyx_v_row = ((PyObject*)PyList_GET_ITEM(__pyx_v_dicts, __pyx_v_i));

    /* "pandas/src/tseries.pyx":361
 *     for i in range(n):
 *         row = dicts[i]
 *         for j in range(k):             # <<<<<<<<<<<<<<
 *             col = columns[j]
 *             if col in row:
 */
    __pyx_t_12 = __pyx_v_k;
    for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
      __pyx_v_j = __pyx_t_13;

      /* "pandas/src/tseries.pyx":362
 *         row = dicts[i]
 *         for j in range(k):
 *             col = columns[j]             # <<<<<<<<<<<<<<
 *             if col in row:
 *                 result[i, j] = row[col]
 */
      __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_columns, __pyx_v_j));
      __Pyx_XDECREF(__pyx_v_col);
      __pyx_v_col = PyList_GET_ITEM(__pyx_v_columns, __pyx_v_j);

      /* "pandas/src/tseries.pyx":363
 *         for j in range(k):
 *             col = columns[j]
 *             if col in row:             # <<<<<<<<<<<<<<
 *                 result[i, j] = row[col]
 *             else:
 */
      if (unlikely(((PyObject *)__pyx_v_row) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_14 = ((PyDict_Contains(((PyObject *)__pyx_v_row), __pyx_v_col))); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_14) {

        /* "pandas/src/tseries.pyx":364
 *             col = columns[j]
 *             if col in row:
 *                 result[i, j] = row[col]             # <<<<<<<<<<<<<<
 *             else:
 *                 result[i, j] = onan
 */
        __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_row), __pyx_v_col); if (!__pyx_t_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __pyx_v_j;
        __pyx_t_17 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_15, __pyx_bstride_0_result, __pyx_t_16, __pyx_bstride_1_result);
        __Pyx_GOTREF(*__pyx_t_17);
        __Pyx_DECREF(*__pyx_t_17); __Pyx_INCREF(__pyx_t_2);
        *__pyx_t_17 = __pyx_t_2;
        __Pyx_GIVEREF(*__pyx_t_17);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/tseries.pyx":366
 *                 result[i, j] = row[col]
 *             else:
 *                 result[i, j] = onan             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_17 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_18, __pyx_bstride_0_result, __pyx_t_19, __pyx_bstride_1_result);
        __Pyx_GOTREF(*__pyx_t_17);
        __Pyx_DECREF(*__pyx_t_17); __Pyx_INCREF(__pyx_v_onan);
        *__pyx_t_17 = __pyx_v_onan;
        __Pyx_GIVEREF(*__pyx_t_17);
      }
      __pyx_L10:;
    }
  }

  /* "pandas/src/tseries.pyx":368
 *                 result[i, j] = onan
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.dicts_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_onan);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":371
 * 
 * 
 * def fast_zip(list ndarrays):             # <<<<<<<<<<<<<<
 *     '''
 *     For zipping multiple ndarrays into an ndarray of tuples
 */

static PyObject *__pyx_pf_6pandas_3lib_16fast_zip(PyObject *__pyx_self, PyObject *__pyx_v_ndarrays); /*proto*/
static char __pyx_doc_6pandas_3lib_16fast_zip[] = "\n    For zipping multiple ndarrays into an ndarray of tuples\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_16fast_zip = {__Pyx_NAMESTR("fast_zip"), (PyCFunction)__pyx_pf_6pandas_3lib_16fast_zip, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_16fast_zip)};
static PyObject *__pyx_pf_6pandas_3lib_16fast_zip(PyObject *__pyx_self, PyObject *__pyx_v_ndarrays) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyArrayIterObject *__pyx_v_it = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_tup = 0;
  PyObject *__pyx_v_arr = NULL;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject **__pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fast_zip");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ndarrays), (&PyList_Type), 1, "ndarrays", 1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/tseries.pyx":381
 *         object val, tup
 * 
 *     k = len(ndarrays)             # <<<<<<<<<<<<<<
 *     n = len(ndarrays[0])
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ndarrays) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_ndarrays)); 
  __pyx_v_k = __pyx_t_1;

  /* "pandas/src/tseries.pyx":382
 * 
 *     k = len(ndarrays)
 *     n = len(ndarrays[0])             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype=object)
 */
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ndarrays), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":384
 *     n = len(ndarrays[0])
 * 
 *     result = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     # initialize tuples on first pass
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/tseries.pyx":387
 * 
 *     # initialize tuples on first pass
 *     arr = ndarrays[0]             # <<<<<<<<<<<<<<
 *     it = <flatiter> PyArray_IterNew(arr)
 *     for i in range(n):
 */
  __pyx_t_5 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ndarrays), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_arr = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "pandas/src/tseries.pyx":388
 *     # initialize tuples on first pass
 *     arr = ndarrays[0]
 *     it = <flatiter> PyArray_IterNew(arr)             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 */
  __pyx_t_5 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_t_5)));
  __pyx_v_it = ((PyArrayIterObject *)__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pandas/src/tseries.pyx":389
 *     arr = ndarrays[0]
 *     it = <flatiter> PyArray_IterNew(arr)
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *         tup = PyTuple_New(k)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pandas/src/tseries.pyx":390
 *     it = <flatiter> PyArray_IterNew(arr)
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))             # <<<<<<<<<<<<<<
 *         tup = PyTuple_New(k)
 * 
 */
    if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __pyx_v_arr;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_2 = PyArray_GETITEM(((PyArrayObject *)__pyx_t_5), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":391
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *         tup = PyTuple_New(k)             # <<<<<<<<<<<<<<
 * 
 *         PyTuple_SET_ITEM(tup, 0, val)
 */
    __pyx_t_2 = ((PyObject *)PyTuple_New(__pyx_v_k)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_tup);
    __pyx_v_tup = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":393
 *         tup = PyTuple_New(k)
 * 
 *         PyTuple_SET_ITEM(tup, 0, val)             # <<<<<<<<<<<<<<
 *         Py_INCREF(val)
 *         result[i] = tup
 */
    PyTuple_SET_ITEM(__pyx_v_tup, 0, __pyx_v_val);

    /* "pandas/src/tseries.pyx":394
 * 
 *         PyTuple_SET_ITEM(tup, 0, val)
 *         Py_INCREF(val)             # <<<<<<<<<<<<<<
 *         result[i] = tup
 *         PyArray_ITER_NEXT(it)
 */
    Py_INCREF(__pyx_v_val);

    /* "pandas/src/tseries.pyx":395
 *         PyTuple_SET_ITEM(tup, 0, val)
 *         Py_INCREF(val)
 *         result[i] = tup             # <<<<<<<<<<<<<<
 *         PyArray_ITER_NEXT(it)
 * 
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_result)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_13 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_12, __pyx_bstride_0_result);
    __Pyx_GOTREF(*__pyx_t_13);
    __Pyx_DECREF(*__pyx_t_13); __Pyx_INCREF(__pyx_v_tup);
    *__pyx_t_13 = __pyx_v_tup;
    __Pyx_GIVEREF(*__pyx_t_13);

    /* "pandas/src/tseries.pyx":396
 *         Py_INCREF(val)
 *         result[i] = tup
 *         PyArray_ITER_NEXT(it)             # <<<<<<<<<<<<<<
 * 
 *     for j in range(1, k):
 */
    PyArray_ITER_NEXT(__pyx_v_it);
  }

  /* "pandas/src/tseries.pyx":398
 *         PyArray_ITER_NEXT(it)
 * 
 *     for j in range(1, k):             # <<<<<<<<<<<<<<
 *         arr = ndarrays[j]
 *         it = <flatiter> PyArray_IterNew(arr)
 */
  __pyx_t_1 = __pyx_v_k;
  for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
    __pyx_v_j = __pyx_t_11;

    /* "pandas/src/tseries.pyx":399
 * 
 *     for j in range(1, k):
 *         arr = ndarrays[j]             # <<<<<<<<<<<<<<
 *         it = <flatiter> PyArray_IterNew(arr)
 *         if len(arr) != n:
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ndarrays), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_arr);
    __pyx_v_arr = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":400
 *     for j in range(1, k):
 *         arr = ndarrays[j]
 *         it = <flatiter> PyArray_IterNew(arr)             # <<<<<<<<<<<<<<
 *         if len(arr) != n:
 *             raise ValueError('all arrays must be same length')
 */
    __pyx_t_2 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_t_2)));
    __Pyx_DECREF(((PyObject *)__pyx_v_it));
    __pyx_v_it = ((PyArrayIterObject *)__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":401
 *         arr = ndarrays[j]
 *         it = <flatiter> PyArray_IterNew(arr)
 *         if len(arr) != n:             # <<<<<<<<<<<<<<
 *             raise ValueError('all arrays must be same length')
 * 
 */
    __pyx_t_14 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = (__pyx_t_14 != __pyx_v_n);
    if (__pyx_t_15) {

      /* "pandas/src/tseries.pyx":402
 *         it = <flatiter> PyArray_IterNew(arr)
 *         if len(arr) != n:
 *             raise ValueError('all arrays must be same length')             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "pandas/src/tseries.pyx":404
 *             raise ValueError('all arrays must be same length')
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *             PyTuple_SET_ITEM(result[i], j, val)
 */
    __pyx_t_14 = __pyx_v_n;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_14; __pyx_t_16+=1) {
      __pyx_v_i = __pyx_t_16;

      /* "pandas/src/tseries.pyx":405
 * 
 *         for i in range(n):
 *             val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))             # <<<<<<<<<<<<<<
 *             PyTuple_SET_ITEM(result[i], j, val)
 *             Py_INCREF(val)
 */
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __pyx_v_arr;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = PyArray_GETITEM(((PyArrayObject *)__pyx_t_2), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pandas/src/tseries.pyx":406
 *         for i in range(n):
 *             val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *             PyTuple_SET_ITEM(result[i], j, val)             # <<<<<<<<<<<<<<
 *             Py_INCREF(val)
 *             PyArray_ITER_NEXT(it)
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_result)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result);
      __Pyx_INCREF((PyObject*)__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, __pyx_v_j, __pyx_v_val);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pandas/src/tseries.pyx":407
 *             val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *             PyTuple_SET_ITEM(result[i], j, val)
 *             Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             PyArray_ITER_NEXT(it)
 * 
 */
      Py_INCREF(__pyx_v_val);

      /* "pandas/src/tseries.pyx":408
 *             PyTuple_SET_ITEM(result[i], j, val)
 *             Py_INCREF(val)
 *             PyArray_ITER_NEXT(it)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      PyArray_ITER_NEXT(__pyx_v_it);
    }
  }

  /* "pandas/src/tseries.pyx":410
 *             PyArray_ITER_NEXT(it)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.fast_zip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":412
 *     return result
 * 
 * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */

static PyObject *__pyx_pf_6pandas_3lib_17get_reverse_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_17get_reverse_indexer = {__Pyx_NAMESTR("get_reverse_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_17get_reverse_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_17get_reverse_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_indexer = 0;
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_rev_indexer = 0;
  __pyx_t_5numpy_int64_t __pyx_v_idx;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_buffer __pyx_bstruct_rev_indexer;
  Py_ssize_t __pyx_bstride_0_rev_indexer = 0;
  Py_ssize_t __pyx_bshape_0_rev_indexer = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  __pyx_t_5numpy_int64_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__indexer,&__pyx_n_s__length,0};
  __Pyx_RefNannySetupContext("get_reverse_indexer");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__indexer);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__length);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_reverse_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_reverse_indexer") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_indexer = ((PyArrayObject *)values[0]);
    __pyx_v_length = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_reverse_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.get_reverse_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_rev_indexer.buf = NULL;
  __pyx_bstruct_indexer.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0];
  __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0];

  /* "pandas/src/tseries.pyx":414
 * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length):
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] rev_indexer
 *         int64_t idx
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":418
 *         int64_t idx
 * 
 *     rev_indexer = np.empty(length, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     rev_indexer.fill(-1)
 *     for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rev_indexer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_rev_indexer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rev_indexer, (PyObject*)__pyx_v_rev_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_rev_indexer = __pyx_bstruct_rev_indexer.strides[0];
    __pyx_bshape_0_rev_indexer = __pyx_bstruct_rev_indexer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_rev_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/tseries.pyx":419
 * 
 *     rev_indexer = np.empty(length, dtype=np.int64)
 *     rev_indexer.fill(-1)             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         idx = indexer[i]
 */
  __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_rev_indexer), __pyx_n_s__fill); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":420
 *     rev_indexer = np.empty(length, dtype=np.int64)
 *     rev_indexer.fill(-1)
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         idx = indexer[i]
 *         if idx != -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/tseries.pyx":421
 *     rev_indexer.fill(-1)
 *     for i in range(n):
 *         idx = indexer[i]             # <<<<<<<<<<<<<<
 *         if idx != -1:
 *             rev_indexer[idx] = i
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_indexer;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_indexer)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_idx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_indexer.buf, __pyx_t_13, __pyx_bstride_0_indexer));

    /* "pandas/src/tseries.pyx":422
 *     for i in range(n):
 *         idx = indexer[i]
 *         if idx != -1:             # <<<<<<<<<<<<<<
 *             rev_indexer[idx] = i
 * 
 */
    __pyx_t_14 = (__pyx_v_idx != -1);
    if (__pyx_t_14) {

      /* "pandas/src/tseries.pyx":423
 *         idx = indexer[i]
 *         if idx != -1:
 *             rev_indexer[idx] = i             # <<<<<<<<<<<<<<
 * 
 *     return rev_indexer
 */
      __pyx_t_15 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_rev_indexer;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_rev_indexer)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_rev_indexer.buf, __pyx_t_15, __pyx_bstride_0_rev_indexer) = __pyx_v_i;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "pandas/src/tseries.pyx":425
 *             rev_indexer[idx] = i
 * 
 *     return rev_indexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_rev_indexer));
  __pyx_r = ((PyObject *)__pyx_v_rev_indexer);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rev_indexer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.get_reverse_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rev_indexer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rev_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":428
 * 
 * 
 * def has_infs_f4(ndarray[float32_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(arr)
 */

static PyObject *__pyx_pf_6pandas_3lib_18has_infs_f4(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_18has_infs_f4 = {__Pyx_NAMESTR("has_infs_f4"), (PyCFunction)__pyx_pf_6pandas_3lib_18has_infs_f4, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_18has_infs_f4(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_float32_t __pyx_v_inf;
  __pyx_t_5numpy_float32_t __pyx_v_neginf;
  __pyx_t_5numpy_float32_t __pyx_v_val;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_float32_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_infs_f4");
  __pyx_self = __pyx_self;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "pandas/src/tseries.pyx":430
 * def has_infs_f4(ndarray[float32_t] arr):
 *     cdef:
 *         Py_ssize_t i, n = len(arr)             # <<<<<<<<<<<<<<
 *         float32_t inf, neginf, val
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":433
 *         float32_t inf, neginf, val
 * 
 *     inf = np.inf             # <<<<<<<<<<<<<<
 *     neginf = -inf
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_inf = __pyx_t_4;

  /* "pandas/src/tseries.pyx":434
 * 
 *     inf = np.inf
 *     neginf = -inf             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_v_neginf = (-__pyx_v_inf);

  /* "pandas/src/tseries.pyx":436
 *     neginf = -inf
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = arr[i]
 *         if val == inf or val == neginf:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pandas/src/tseries.pyx":437
 * 
 *     for i in range(n):
 *         val = arr[i]             # <<<<<<<<<<<<<<
 *         if val == inf or val == neginf:
 *             return True
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_arr)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float32_t *, __pyx_bstruct_arr.buf, __pyx_t_6, __pyx_bstride_0_arr));

    /* "pandas/src/tseries.pyx":438
 *     for i in range(n):
 *         val = arr[i]
 *         if val == inf or val == neginf:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    __pyx_t_8 = (__pyx_v_val == __pyx_v_inf);
    if (!__pyx_t_8) {
      __pyx_t_9 = (__pyx_v_val == __pyx_v_neginf);
      __pyx_t_10 = __pyx_t_9;
    } else {
      __pyx_t_10 = __pyx_t_8;
    }
    if (__pyx_t_10) {

      /* "pandas/src/tseries.pyx":439
 *         val = arr[i]
 *         if val == inf or val == neginf:
 *             return True             # <<<<<<<<<<<<<<
 *     return False
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "pandas/src/tseries.pyx":440
 *         if val == inf or val == neginf:
 *             return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * def has_infs_f8(ndarray[float64_t] arr):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.has_infs_f4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":442
 *     return False
 * 
 * def has_infs_f8(ndarray[float64_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(arr)
 */

static PyObject *__pyx_pf_6pandas_3lib_19has_infs_f8(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_19has_infs_f8 = {__Pyx_NAMESTR("has_infs_f8"), (PyCFunction)__pyx_pf_6pandas_3lib_19has_infs_f8, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_19has_infs_f8(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_float64_t __pyx_v_inf;
  __pyx_t_5numpy_float64_t __pyx_v_neginf;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_float64_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_infs_f8");
  __pyx_self = __pyx_self;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "pandas/src/tseries.pyx":444
 * def has_infs_f8(ndarray[float64_t] arr):
 *     cdef:
 *         Py_ssize_t i, n = len(arr)             # <<<<<<<<<<<<<<
 *         float64_t inf, neginf, val
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":447
 *         float64_t inf, neginf, val
 * 
 *     inf = np.inf             # <<<<<<<<<<<<<<
 *     neginf = -inf
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_inf = __pyx_t_4;

  /* "pandas/src/tseries.pyx":448
 * 
 *     inf = np.inf
 *     neginf = -inf             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_v_neginf = (-__pyx_v_inf);

  /* "pandas/src/tseries.pyx":450
 *     neginf = -inf
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = arr[i]
 *         if val == inf or val == neginf:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pandas/src/tseries.pyx":451
 * 
 *     for i in range(n):
 *         val = arr[i]             # <<<<<<<<<<<<<<
 *         if val == inf or val == neginf:
 *             return True
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_arr)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_arr.buf, __pyx_t_6, __pyx_bstride_0_arr));

    /* "pandas/src/tseries.pyx":452
 *     for i in range(n):
 *         val = arr[i]
 *         if val == inf or val == neginf:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
 */
    __pyx_t_8 = (__pyx_v_val == __pyx_v_inf);
    if (!__pyx_t_8) {
      __pyx_t_9 = (__pyx_v_val == __pyx_v_neginf);
      __pyx_t_10 = __pyx_t_9;
    } else {
      __pyx_t_10 = __pyx_t_8;
    }
    if (__pyx_t_10) {

      /* "pandas/src/tseries.pyx":453
 *         val = arr[i]
 *         if val == inf or val == neginf:
 *             return True             # <<<<<<<<<<<<<<
 *     return False
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "pandas/src/tseries.pyx":454
 *         if val == inf or val == neginf:
 *             return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * def convert_timestamps(ndarray values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.has_infs_f8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":456
 *     return False
 * 
 * def convert_timestamps(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object val, f, result
 */

static PyObject *__pyx_pf_6pandas_3lib_20convert_timestamps(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_20convert_timestamps = {__Pyx_NAMESTR("convert_timestamps"), (PyCFunction)__pyx_pf_6pandas_3lib_20convert_timestamps, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_20convert_timestamps(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_cache = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_out = 0;
  PyObject *__pyx_v_datetime = NULL;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject **__pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_timestamps");
  __pyx_self = __pyx_self;
  __pyx_bstruct_out.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pandas/src/tseries.pyx":459
 *     cdef:
 *         object val, f, result
 *         dict cache = {}             # <<<<<<<<<<<<<<
 *         Py_ssize_t i, n = len(values)
 *         ndarray[object] out
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_cache = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":460
 *         object val, f, result
 *         dict cache = {}
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[object] out
 * 
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/tseries.pyx":465
 *     # for HDFStore, a bit temporary but...
 * 
 *     from datetime import datetime             # <<<<<<<<<<<<<<
 *     f = datetime.fromtimestamp
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__datetime));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pandas/src/tseries.pyx":466
 * 
 *     from datetime import datetime
 *     f = datetime.fromtimestamp             # <<<<<<<<<<<<<<
 * 
 *     out = np.empty(n, dtype='O')
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_datetime, __pyx_n_s__fromtimestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_f = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pandas/src/tseries.pyx":468
 *     f = datetime.fromtimestamp
 * 
 *     out = np.empty(n, dtype='O')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_out = __pyx_bstruct_out.strides[0];
    __pyx_bshape_0_out = __pyx_bstruct_out.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_out = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/tseries.pyx":470
 *     out = np.empty(n, dtype='O')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = util.get_value_1d(values, i)
 *         if val in cache:
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_2; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pandas/src/tseries.pyx":471
 * 
 *     for i in range(n):
 *         val = util.get_value_1d(values, i)             # <<<<<<<<<<<<<<
 *         if val in cache:
 *             out[i] = cache[val]
 */
    __pyx_t_5 = get_value_1d(((PyArrayObject *)__pyx_v_values), __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pandas/src/tseries.pyx":472
 *     for i in range(n):
 *         val = util.get_value_1d(values, i)
 *         if val in cache:             # <<<<<<<<<<<<<<
 *             out[i] = cache[val]
 *         else:
 */
    if (unlikely(((PyObject *)__pyx_v_cache) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_12 = ((PyDict_Contains(((PyObject *)__pyx_v_cache), __pyx_v_val))); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_12) {

      /* "pandas/src/tseries.pyx":473
 *         val = util.get_value_1d(values, i)
 *         if val in cache:
 *             out[i] = cache[val]             # <<<<<<<<<<<<<<
 *         else:
 *             cache[val] = out[i] = f(val)
 */
      __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_cache), __pyx_v_val); if (!__pyx_t_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_out;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_out.buf, __pyx_t_13, __pyx_bstride_0_out);
      __Pyx_GOTREF(*__pyx_t_14);
      __Pyx_DECREF(*__pyx_t_14); __Pyx_INCREF(__pyx_t_5);
      *__pyx_t_14 = __pyx_t_5;
      __Pyx_GIVEREF(*__pyx_t_14);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/tseries.pyx":475
 *             out[i] = cache[val]
 *         else:
 *             cache[val] = out[i] = f(val)             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_3 = PyObject_Call(__pyx_v_f, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      if (PyDict_SetItem(((PyObject *)__pyx_v_cache), __pyx_v_val, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_out;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[3]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_out.buf, __pyx_t_15, __pyx_bstride_0_out);
      __Pyx_GOTREF(*__pyx_t_14);
      __Pyx_DECREF(*__pyx_t_14); __Pyx_INCREF(__pyx_t_3);
      *__pyx_t_14 = __pyx_t_3;
      __Pyx_GIVEREF(*__pyx_t_14);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L7:;
  }

  /* "pandas/src/tseries.pyx":477
 *             cache[val] = out[i] = f(val)
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * def maybe_indices_to_slice(ndarray[int64_t] indices):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.convert_timestamps", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_cache);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":479
 *     return out
 * 
 * def maybe_indices_to_slice(ndarray[int64_t] indices):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indices)
 */

static PyObject *__pyx_pf_6pandas_3lib_21maybe_indices_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_indices); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_21maybe_indices_to_slice = {__Pyx_NAMESTR("maybe_indices_to_slice"), (PyCFunction)__pyx_pf_6pandas_3lib_21maybe_indices_to_slice, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_21maybe_indices_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_indices) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_buffer __pyx_bstruct_indices;
  Py_ssize_t __pyx_bstride_0_indices = 0;
  Py_ssize_t __pyx_bshape_0_indices = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  long __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("maybe_indices_to_slice");
  __pyx_self = __pyx_self;
  __pyx_bstruct_indices.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indices, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_indices = __pyx_bstruct_indices.strides[0];
  __pyx_bshape_0_indices = __pyx_bstruct_indices.shape[0];

  /* "pandas/src/tseries.pyx":481
 * def maybe_indices_to_slice(ndarray[int64_t] indices):
 *     cdef:
 *         Py_ssize_t i, n = len(indices)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_indices); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":483
 *         Py_ssize_t i, n = len(indices)
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return indices
 * 
 */
  __pyx_t_2 = (__pyx_v_n == 0);
  if (__pyx_t_2) {

    /* "pandas/src/tseries.pyx":484
 * 
 *     if n == 0:
 *         return indices             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, n):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_indices);
    __pyx_r = __pyx_v_indices;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "pandas/src/tseries.pyx":486
 *         return indices
 * 
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         if indices[i] - indices[i - 1] != 1:
 *             return indices
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_3 = 1; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pandas/src/tseries.pyx":487
 * 
 *     for i in range(1, n):
 *         if indices[i] - indices[i - 1] != 1:             # <<<<<<<<<<<<<<
 *             return indices
 *     return slice(indices[0], indices[n - 1] + 1)
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_indices;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_indices)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = (__pyx_v_i - 1);
    __pyx_t_5 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_bshape_0_indices;
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_indices)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_indices.buf, __pyx_t_4, __pyx_bstride_0_indices)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_indices.buf, __pyx_t_6, __pyx_bstride_0_indices))) != 1);
    if (__pyx_t_2) {

      /* "pandas/src/tseries.pyx":488
 *     for i in range(1, n):
 *         if indices[i] - indices[i - 1] != 1:
 *             return indices             # <<<<<<<<<<<<<<
 *     return slice(indices[0], indices[n - 1] + 1)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_indices);
      __pyx_r = __pyx_v_indices;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "pandas/src/tseries.pyx":489
 *         if indices[i] - indices[i - 1] != 1:
 *             return indices
 *     return slice(indices[0], indices[n - 1] + 1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_7 < 0) {
    __pyx_t_7 += __pyx_bshape_0_indices;
    if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_indices)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_indices.buf, __pyx_t_7, __pyx_bstride_0_indices))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = (__pyx_v_n - 1);
  __pyx_t_5 = -1;
  if (__pyx_t_1 < 0) {
    __pyx_t_1 += __pyx_bshape_0_indices;
    if (unlikely(__pyx_t_1 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_indices)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = __Pyx_PyInt_to_py_npy_int64(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_indices.buf, __pyx_t_1, __pyx_bstride_0_indices)) + 1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indices);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.maybe_indices_to_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indices);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":492
 * 
 * 
 * def maybe_booleans_to_slice(ndarray[uint8_t] mask):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(mask)
 */

static PyObject *__pyx_pf_6pandas_3lib_22maybe_booleans_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_mask); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_22maybe_booleans_to_slice = {__Pyx_NAMESTR("maybe_booleans_to_slice"), (PyCFunction)__pyx_pf_6pandas_3lib_22maybe_booleans_to_slice, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_22maybe_booleans_to_slice(PyObject *__pyx_self, PyObject *__pyx_v_mask) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_end;
  int __pyx_v_started;
  int __pyx_v_finished;
  Py_buffer __pyx_bstruct_mask;
  Py_ssize_t __pyx_bstride_0_mask = 0;
  Py_ssize_t __pyx_bshape_0_mask = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  __pyx_t_5numpy_uint8_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("maybe_booleans_to_slice");
  __pyx_self = __pyx_self;
  __pyx_bstruct_mask.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_mask = __pyx_bstruct_mask.strides[0];
  __pyx_bshape_0_mask = __pyx_bstruct_mask.shape[0];

  /* "pandas/src/tseries.pyx":494
 * def maybe_booleans_to_slice(ndarray[uint8_t] mask):
 *     cdef:
 *         Py_ssize_t i, n = len(mask)             # <<<<<<<<<<<<<<
 *         Py_ssize_t start, end
 *         bint started = 0, finished = 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_mask); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":496
 *         Py_ssize_t i, n = len(mask)
 *         Py_ssize_t start, end
 *         bint started = 0, finished = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_v_started = 0;
  __pyx_v_finished = 0;

  /* "pandas/src/tseries.pyx":498
 *         bint started = 0, finished = 0
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             if finished:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "pandas/src/tseries.pyx":499
 * 
 *     for i in range(n):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             if finished:
 *                 return mask.view(np.bool_)
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_bshape_0_mask;
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_mask)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_3, __pyx_bstride_0_mask));
    if (__pyx_t_5) {

      /* "pandas/src/tseries.pyx":500
 *     for i in range(n):
 *         if mask[i]:
 *             if finished:             # <<<<<<<<<<<<<<
 *                 return mask.view(np.bool_)
 *             if not started:
 */
      if (__pyx_v_finished) {

        /* "pandas/src/tseries.pyx":501
 *         if mask[i]:
 *             if finished:
 *                 return mask.view(np.bool_)             # <<<<<<<<<<<<<<
 *             if not started:
 *                 started = 1
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_mask, __pyx_n_s__view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__bool_); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_7));
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "pandas/src/tseries.pyx":502
 *             if finished:
 *                 return mask.view(np.bool_)
 *             if not started:             # <<<<<<<<<<<<<<
 *                 started = 1
 *                 start = i
 */
      __pyx_t_9 = (!__pyx_v_started);
      if (__pyx_t_9) {

        /* "pandas/src/tseries.pyx":503
 *                 return mask.view(np.bool_)
 *             if not started:
 *                 started = 1             # <<<<<<<<<<<<<<
 *                 start = i
 *         else:
 */
        __pyx_v_started = 1;

        /* "pandas/src/tseries.pyx":504
 *             if not started:
 *                 started = 1
 *                 start = i             # <<<<<<<<<<<<<<
 *         else:
 *             if finished:
 */
        __pyx_v_start = __pyx_v_i;
        goto __pyx_L9;
      }
      __pyx_L9:;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/tseries.pyx":506
 *                 start = i
 *         else:
 *             if finished:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      if (__pyx_v_finished) {

        /* "pandas/src/tseries.pyx":507
 *         else:
 *             if finished:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if started:
 */
        goto __pyx_L5_continue;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "pandas/src/tseries.pyx":509
 *                 continue
 * 
 *             if started:             # <<<<<<<<<<<<<<
 *                 end = i
 *                 finished = 1
 */
      if (__pyx_v_started) {

        /* "pandas/src/tseries.pyx":510
 * 
 *             if started:
 *                 end = i             # <<<<<<<<<<<<<<
 *                 finished = 1
 * 
 */
        __pyx_v_end = __pyx_v_i;

        /* "pandas/src/tseries.pyx":511
 *             if started:
 *                 end = i
 *                 finished = 1             # <<<<<<<<<<<<<<
 * 
 *     if not started:
 */
        __pyx_v_finished = 1;
        goto __pyx_L11;
      }
      __pyx_L11:;
    }
    __pyx_L7:;
    __pyx_L5_continue:;
  }

  /* "pandas/src/tseries.pyx":513
 *                 finished = 1
 * 
 *     if not started:             # <<<<<<<<<<<<<<
 *         return slice(0, 0)
 *     if not finished:
 */
  __pyx_t_9 = (!__pyx_v_started);
  if (__pyx_t_9) {

    /* "pandas/src/tseries.pyx":514
 * 
 *     if not started:
 *         return slice(0, 0)             # <<<<<<<<<<<<<<
 *     if not finished:
 *         return slice(start, None)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "pandas/src/tseries.pyx":515
 *     if not started:
 *         return slice(0, 0)
 *     if not finished:             # <<<<<<<<<<<<<<
 *         return slice(start, None)
 *     else:
 */
  __pyx_t_9 = (!__pyx_v_finished);
  if (__pyx_t_9) {

    /* "pandas/src/tseries.pyx":516
 *         return slice(0, 0)
 *     if not finished:
 *         return slice(start, None)             # <<<<<<<<<<<<<<
 *     else:
 *         return slice(start, end)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __Pyx_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_7, 1, Py_None);
    __Pyx_GIVEREF(Py_None);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;
    goto __pyx_L13;
  }
  /*else*/ {

    /* "pandas/src/tseries.pyx":518
 *         return slice(start, None)
 *     else:
 *         return slice(start, end)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_end); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_8 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }
  __pyx_L13:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.maybe_booleans_to_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":523
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def scalar_compare(ndarray[object] values, object val, object op):             # <<<<<<<<<<<<<<
 *     import operator
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_23scalar_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_23scalar_compare = {__Pyx_NAMESTR("scalar_compare"), (PyCFunction)__pyx_pf_6pandas_3lib_23scalar_compare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_23scalar_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_op = 0;
  PyObject *__pyx_v_operator = NULL;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  int __pyx_v_flag;
  PyObject *__pyx_v_x = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__val,&__pyx_n_s__op,0};
  __Pyx_RefNannySetupContext("scalar_compare");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__op);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "scalar_compare") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_val = values[1];
    __pyx_v_op = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scalar_compare", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.scalar_compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "pandas/src/tseries.pyx":524
 * @cython.boundscheck(False)
 * def scalar_compare(ndarray[object] values, object val, object op):
 *     import operator             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__operator), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_operator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":526
 *     import operator
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[uint8_t, cast=True] result
 *         int flag
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/tseries.pyx":531
 *         object x
 * 
 *     if op is operator.lt:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_LT
 *     elif op is operator.le:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__lt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":532
 * 
 *     if op is operator.lt:
 *         flag = cpython.Py_LT             # <<<<<<<<<<<<<<
 *     elif op is operator.le:
 *         flag = cpython.Py_LE
 */
    __pyx_v_flag = Py_LT;
    goto __pyx_L6;
  }

  /* "pandas/src/tseries.pyx":533
 *     if op is operator.lt:
 *         flag = cpython.Py_LT
 *     elif op is operator.le:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_LE
 *     elif op is operator.gt:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__le); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":534
 *         flag = cpython.Py_LT
 *     elif op is operator.le:
 *         flag = cpython.Py_LE             # <<<<<<<<<<<<<<
 *     elif op is operator.gt:
 *         flag = cpython.Py_GT
 */
    __pyx_v_flag = Py_LE;
    goto __pyx_L6;
  }

  /* "pandas/src/tseries.pyx":535
 *     elif op is operator.le:
 *         flag = cpython.Py_LE
 *     elif op is operator.gt:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_GT
 *     elif op is operator.ge:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__gt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":536
 *         flag = cpython.Py_LE
 *     elif op is operator.gt:
 *         flag = cpython.Py_GT             # <<<<<<<<<<<<<<
 *     elif op is operator.ge:
 *         flag = cpython.Py_GE
 */
    __pyx_v_flag = Py_GT;
    goto __pyx_L6;
  }

  /* "pandas/src/tseries.pyx":537
 *     elif op is operator.gt:
 *         flag = cpython.Py_GT
 *     elif op is operator.ge:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_GE
 *     elif op is operator.eq:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__ge); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":538
 *         flag = cpython.Py_GT
 *     elif op is operator.ge:
 *         flag = cpython.Py_GE             # <<<<<<<<<<<<<<
 *     elif op is operator.eq:
 *         flag = cpython.Py_EQ
 */
    __pyx_v_flag = Py_GE;
    goto __pyx_L6;
  }

  /* "pandas/src/tseries.pyx":539
 *     elif op is operator.ge:
 *         flag = cpython.Py_GE
 *     elif op is operator.eq:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_EQ
 *     elif op is operator.ne:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__eq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":540
 *         flag = cpython.Py_GE
 *     elif op is operator.eq:
 *         flag = cpython.Py_EQ             # <<<<<<<<<<<<<<
 *     elif op is operator.ne:
 *         flag = cpython.Py_NE
 */
    __pyx_v_flag = Py_EQ;
    goto __pyx_L6;
  }

  /* "pandas/src/tseries.pyx":541
 *     elif op is operator.eq:
 *         flag = cpython.Py_EQ
 *     elif op is operator.ne:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_NE
 *     else:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__ne); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":542
 *         flag = cpython.Py_EQ
 *     elif op is operator.ne:
 *         flag = cpython.Py_NE             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Unrecognized operator')
 */
    __pyx_v_flag = Py_NE;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "pandas/src/tseries.pyx":544
 *         flag = cpython.Py_NE
 *     else:
 *         raise ValueError('Unrecognized operator')             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype=bool).view(np.uint8)
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "pandas/src/tseries.pyx":546
 *         raise ValueError('Unrecognized operator')
 * 
 *     result = np.empty(n, dtype=bool).view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     if flag == cpython.Py_NE:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool))) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__uint8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/tseries.pyx":548
 *     result = np.empty(n, dtype=bool).view(np.uint8)
 * 
 *     if flag == cpython.Py_NE:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             x = values[i]
 */
  __pyx_t_3 = (__pyx_v_flag == Py_NE);
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":549
 * 
 *     if flag == cpython.Py_NE:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             x = values[i]
 *             if _checknull(x):
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/tseries.pyx":550
 *     if flag == cpython.Py_NE:
 *         for i in range(n):
 *             x = values[i]             # <<<<<<<<<<<<<<
 *             if _checknull(x):
 *                 result[i] = True
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_13, __pyx_bstride_0_values);
      __Pyx_INCREF((PyObject*)__pyx_t_5);
      __Pyx_XDECREF(__pyx_v_x);
      __pyx_v_x = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pandas/src/tseries.pyx":551
 *         for i in range(n):
 *             x = values[i]
 *             if _checknull(x):             # <<<<<<<<<<<<<<
 *                 result[i] = True
 *             else:
 */
      __pyx_t_3 = __pyx_f_4util__checknull(__pyx_v_x);
      if (__pyx_t_3) {

        /* "pandas/src/tseries.pyx":552
 *             x = values[i]
 *             if _checknull(x):
 *                 result[i] = True             # <<<<<<<<<<<<<<
 *             else:
 *                 result[i] = cpython.PyObject_RichCompareBool(x, val, flag)
 */
        __pyx_t_14 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_14, __pyx_bstride_0_result) = 1;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "pandas/src/tseries.pyx":554
 *                 result[i] = True
 *             else:
 *                 result[i] = cpython.PyObject_RichCompareBool(x, val, flag)             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(n):
 */
        __pyx_t_3 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_val, __pyx_v_flag); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_15 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_15, __pyx_bstride_0_result) = __pyx_t_3;
      }
      __pyx_L10:;
    }
    goto __pyx_L7;
  }
  /*else*/ {

    /* "pandas/src/tseries.pyx":556
 *                 result[i] = cpython.PyObject_RichCompareBool(x, val, flag)
 *     else:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             x = values[i]
 *             if _checknull(x):
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/tseries.pyx":557
 *     else:
 *         for i in range(n):
 *             x = values[i]             # <<<<<<<<<<<<<<
 *             if _checknull(x):
 *                 result[i] = False
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_16, __pyx_bstride_0_values);
      __Pyx_INCREF((PyObject*)__pyx_t_5);
      __Pyx_XDECREF(__pyx_v_x);
      __pyx_v_x = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "pandas/src/tseries.pyx":558
 *         for i in range(n):
 *             x = values[i]
 *             if _checknull(x):             # <<<<<<<<<<<<<<
 *                 result[i] = False
 *             else:
 */
      __pyx_t_3 = __pyx_f_4util__checknull(__pyx_v_x);
      if (__pyx_t_3) {

        /* "pandas/src/tseries.pyx":559
 *             x = values[i]
 *             if _checknull(x):
 *                 result[i] = False             # <<<<<<<<<<<<<<
 *             else:
 *                 result[i] = cpython.PyObject_RichCompareBool(x, val, flag)
 */
        __pyx_t_17 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result) = 0;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "pandas/src/tseries.pyx":561
 *                 result[i] = False
 *             else:
 *                 result[i] = cpython.PyObject_RichCompareBool(x, val, flag)             # <<<<<<<<<<<<<<
 * 
 *     return result.view(bool)
 */
        __pyx_t_3 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_val, __pyx_v_flag); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_18 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_18, __pyx_bstride_0_result) = __pyx_t_3;
      }
      __pyx_L13:;
    }
  }
  __pyx_L7:;

  /* "pandas/src/tseries.pyx":563
 *                 result[i] = cpython.PyObject_RichCompareBool(x, val, flag)
 * 
 *     return result.view(bool)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)));
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.scalar_compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_operator);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":567
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def vec_compare(ndarray[object] left, ndarray[object] right, object op):             # <<<<<<<<<<<<<<
 *     import operator
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_24vec_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_24vec_compare = {__Pyx_NAMESTR("vec_compare"), (PyCFunction)__pyx_pf_6pandas_3lib_24vec_compare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_24vec_compare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  PyObject *__pyx_v_op = 0;
  PyObject *__pyx_v_operator = NULL;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  int __pyx_v_flag;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  Py_buffer __pyx_bstruct_right;
  Py_ssize_t __pyx_bstride_0_right = 0;
  Py_ssize_t __pyx_bshape_0_right = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_left;
  Py_ssize_t __pyx_bstride_0_left = 0;
  Py_ssize_t __pyx_bshape_0_left = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__right,&__pyx_n_s__op,0};
  __Pyx_RefNannySetupContext("vec_compare");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__op);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "vec_compare") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_left = ((PyArrayObject *)values[0]);
    __pyx_v_right = ((PyArrayObject *)values[1]);
    __pyx_v_op = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("vec_compare", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.vec_compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_left.buf = NULL;
  __pyx_bstruct_right.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_left = __pyx_bstruct_left.strides[0];
  __pyx_bshape_0_left = __pyx_bstruct_left.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_right = __pyx_bstruct_right.strides[0];
  __pyx_bshape_0_right = __pyx_bstruct_right.shape[0];

  /* "pandas/src/tseries.pyx":568
 * @cython.boundscheck(False)
 * def vec_compare(ndarray[object] left, ndarray[object] right, object op):
 *     import operator             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(left)
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__operator), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_operator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":570
 *     import operator
 *     cdef:
 *         Py_ssize_t i, n = len(left)             # <<<<<<<<<<<<<<
 *         ndarray[uint8_t, cast=True] result
 *         int flag
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_2;

  /* "pandas/src/tseries.pyx":574
 *         int flag
 * 
 *     if n != len(right):             # <<<<<<<<<<<<<<
 *         raise ValueError('Arrays were different lengths: %d vs %d'
 *                          % (n, len(right)))
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_v_n != __pyx_t_2);
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":576
 *     if n != len(right):
 *         raise ValueError('Arrays were different lengths: %d vs %d'
 *                          % (n, len(right)))             # <<<<<<<<<<<<<<
 * 
 *     if op is operator.lt:
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pandas/src/tseries.pyx":578
 *                          % (n, len(right)))
 * 
 *     if op is operator.lt:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_LT
 *     elif op is operator.le:
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__lt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":579
 * 
 *     if op is operator.lt:
 *         flag = cpython.Py_LT             # <<<<<<<<<<<<<<
 *     elif op is operator.le:
 *         flag = cpython.Py_LE
 */
    __pyx_v_flag = Py_LT;
    goto __pyx_L7;
  }

  /* "pandas/src/tseries.pyx":580
 *     if op is operator.lt:
 *         flag = cpython.Py_LT
 *     elif op is operator.le:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_LE
 *     elif op is operator.gt:
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__le); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":581
 *         flag = cpython.Py_LT
 *     elif op is operator.le:
 *         flag = cpython.Py_LE             # <<<<<<<<<<<<<<
 *     elif op is operator.gt:
 *         flag = cpython.Py_GT
 */
    __pyx_v_flag = Py_LE;
    goto __pyx_L7;
  }

  /* "pandas/src/tseries.pyx":582
 *     elif op is operator.le:
 *         flag = cpython.Py_LE
 *     elif op is operator.gt:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_GT
 *     elif op is operator.ge:
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__gt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":583
 *         flag = cpython.Py_LE
 *     elif op is operator.gt:
 *         flag = cpython.Py_GT             # <<<<<<<<<<<<<<
 *     elif op is operator.ge:
 *         flag = cpython.Py_GE
 */
    __pyx_v_flag = Py_GT;
    goto __pyx_L7;
  }

  /* "pandas/src/tseries.pyx":584
 *     elif op is operator.gt:
 *         flag = cpython.Py_GT
 *     elif op is operator.ge:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_GE
 *     elif op is operator.eq:
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__ge); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":585
 *         flag = cpython.Py_GT
 *     elif op is operator.ge:
 *         flag = cpython.Py_GE             # <<<<<<<<<<<<<<
 *     elif op is operator.eq:
 *         flag = cpython.Py_EQ
 */
    __pyx_v_flag = Py_GE;
    goto __pyx_L7;
  }

  /* "pandas/src/tseries.pyx":586
 *     elif op is operator.ge:
 *         flag = cpython.Py_GE
 *     elif op is operator.eq:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_EQ
 *     elif op is operator.ne:
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__eq); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":587
 *         flag = cpython.Py_GE
 *     elif op is operator.eq:
 *         flag = cpython.Py_EQ             # <<<<<<<<<<<<<<
 *     elif op is operator.ne:
 *         flag = cpython.Py_NE
 */
    __pyx_v_flag = Py_EQ;
    goto __pyx_L7;
  }

  /* "pandas/src/tseries.pyx":588
 *     elif op is operator.eq:
 *         flag = cpython.Py_EQ
 *     elif op is operator.ne:             # <<<<<<<<<<<<<<
 *         flag = cpython.Py_NE
 *     else:
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_operator, __pyx_n_s__ne); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__pyx_v_op == __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":589
 *         flag = cpython.Py_EQ
 *     elif op is operator.ne:
 *         flag = cpython.Py_NE             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('Unrecognized operator')
 */
    __pyx_v_flag = Py_NE;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "pandas/src/tseries.pyx":591
 *         flag = cpython.Py_NE
 *     else:
 *         raise ValueError('Unrecognized operator')             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype=bool).view(np.uint8)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L7:;

  /* "pandas/src/tseries.pyx":593
 *         raise ValueError('Unrecognized operator')
 * 
 *     result = np.empty(n, dtype=bool).view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     if flag == cpython.Py_NE:
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool))) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__view); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":595
 *     result = np.empty(n, dtype=bool).view(np.uint8)
 * 
 *     if flag == cpython.Py_NE:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             x = left[i]
 */
  __pyx_t_3 = (__pyx_v_flag == Py_NE);
  if (__pyx_t_3) {

    /* "pandas/src/tseries.pyx":596
 * 
 *     if flag == cpython.Py_NE:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             x = left[i]
 *             y = right[i]
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/tseries.pyx":597
 *     if flag == cpython.Py_NE:
 *         for i in range(n):
 *             x = left[i]             # <<<<<<<<<<<<<<
 *             y = right[i]
 * 
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_1 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_left.buf, __pyx_t_13, __pyx_bstride_0_left);
      __Pyx_INCREF((PyObject*)__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_x);
      __pyx_v_x = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pandas/src/tseries.pyx":598
 *         for i in range(n):
 *             x = left[i]
 *             y = right[i]             # <<<<<<<<<<<<<<
 * 
 *             if _checknull(x) or _checknull(y):
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_1 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_right.buf, __pyx_t_14, __pyx_bstride_0_right);
      __Pyx_INCREF((PyObject*)__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_y);
      __pyx_v_y = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pandas/src/tseries.pyx":600
 *             y = right[i]
 * 
 *             if _checknull(x) or _checknull(y):             # <<<<<<<<<<<<<<
 *                 result[i] = True
 *             else:
 */
      __pyx_t_3 = __pyx_f_4util__checknull(__pyx_v_x);
      if (!__pyx_t_3) {
        __pyx_t_15 = __pyx_f_4util__checknull(__pyx_v_y);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_3;
      }
      if (__pyx_t_16) {

        /* "pandas/src/tseries.pyx":601
 * 
 *             if _checknull(x) or _checknull(y):
 *                 result[i] = True             # <<<<<<<<<<<<<<
 *             else:
 *                 result[i] = cpython.PyObject_RichCompareBool(x, y, flag)
 */
        __pyx_t_17 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result) = 1;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "pandas/src/tseries.pyx":603
 *                 result[i] = True
 *             else:
 *                 result[i] = cpython.PyObject_RichCompareBool(x, y, flag)             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(n):
 */
        __pyx_t_16 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_y, __pyx_v_flag); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_18 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_18, __pyx_bstride_0_result) = __pyx_t_16;
      }
      __pyx_L11:;
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "pandas/src/tseries.pyx":605
 *                 result[i] = cpython.PyObject_RichCompareBool(x, y, flag)
 *     else:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             x = left[i]
 *             y = right[i]
 */
    __pyx_t_2 = __pyx_v_n;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "pandas/src/tseries.pyx":606
 *     else:
 *         for i in range(n):
 *             x = left[i]             # <<<<<<<<<<<<<<
 *             y = right[i]
 * 
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_1 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_left.buf, __pyx_t_19, __pyx_bstride_0_left);
      __Pyx_INCREF((PyObject*)__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_x);
      __pyx_v_x = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pandas/src/tseries.pyx":607
 *         for i in range(n):
 *             x = left[i]
 *             y = right[i]             # <<<<<<<<<<<<<<
 * 
 *             if _checknull(x) or _checknull(y):
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_1 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_right.buf, __pyx_t_20, __pyx_bstride_0_right);
      __Pyx_INCREF((PyObject*)__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_y);
      __pyx_v_y = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pandas/src/tseries.pyx":609
 *             y = right[i]
 * 
 *             if _checknull(x) or _checknull(y):             # <<<<<<<<<<<<<<
 *                 result[i] = False
 *             else:
 */
      __pyx_t_16 = __pyx_f_4util__checknull(__pyx_v_x);
      if (!__pyx_t_16) {
        __pyx_t_3 = __pyx_f_4util__checknull(__pyx_v_y);
        __pyx_t_15 = __pyx_t_3;
      } else {
        __pyx_t_15 = __pyx_t_16;
      }
      if (__pyx_t_15) {

        /* "pandas/src/tseries.pyx":610
 * 
 *             if _checknull(x) or _checknull(y):
 *                 result[i] = False             # <<<<<<<<<<<<<<
 *             else:
 *                 result[i] = cpython.PyObject_RichCompareBool(x, y, flag)
 */
        __pyx_t_21 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_21, __pyx_bstride_0_result) = 0;
        goto __pyx_L14;
      }
      /*else*/ {

        /* "pandas/src/tseries.pyx":612
 *                 result[i] = False
 *             else:
 *                 result[i] = cpython.PyObject_RichCompareBool(x, y, flag)             # <<<<<<<<<<<<<<
 * 
 *     return result.view(bool)
 */
        __pyx_t_15 = PyObject_RichCompareBool(__pyx_v_x, __pyx_v_y, __pyx_v_flag); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_22 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_22, __pyx_bstride_0_result) = __pyx_t_15;
      }
      __pyx_L14:;
    }
  }
  __pyx_L8:;

  /* "pandas/src/tseries.pyx":614
 *                 result[i] = cpython.PyObject_RichCompareBool(x, y, flag)
 * 
 *     return result.view(bool)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)));
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.vec_compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_operator);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":619
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def scalar_binop(ndarray[object] values, object val, object op):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_25scalar_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_25scalar_binop = {__Pyx_NAMESTR("scalar_binop"), (PyCFunction)__pyx_pf_6pandas_3lib_25scalar_binop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_25scalar_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_op = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_x = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject **__pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__val,&__pyx_n_s__op,0};
  __Pyx_RefNannySetupContext("scalar_binop");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__op);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "scalar_binop") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_val = values[1];
    __pyx_v_op = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scalar_binop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.scalar_binop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "pandas/src/tseries.pyx":621
 * def scalar_binop(ndarray[object] values, object val, object op):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[object] result
 *         object x
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":625
 *         object x
 * 
 *     result = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "pandas/src/tseries.pyx":627
 *     result = np.empty(n, dtype=object)
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         x = values[i]
 *         if util._checknull(x):
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pandas/src/tseries.pyx":628
 * 
 *     for i in range(n):
 *         x = values[i]             # <<<<<<<<<<<<<<
 *         if util._checknull(x):
 *             result[i] = x
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_12, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "pandas/src/tseries.pyx":629
 *     for i in range(n):
 *         x = values[i]
 *         if util._checknull(x):             # <<<<<<<<<<<<<<
 *             result[i] = x
 *         else:
 */
    __pyx_t_13 = __pyx_f_4util__checknull(__pyx_v_x);
    if (__pyx_t_13) {

      /* "pandas/src/tseries.pyx":630
 *         x = values[i]
 *         if util._checknull(x):
 *             result[i] = x             # <<<<<<<<<<<<<<
 *         else:
 *             result[i] = op(x, val)
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_14, __pyx_bstride_0_result);
      __Pyx_GOTREF(*__pyx_t_15);
      __Pyx_DECREF(*__pyx_t_15); __Pyx_INCREF(__pyx_v_x);
      *__pyx_t_15 = __pyx_v_x;
      __Pyx_GIVEREF(*__pyx_t_15);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "pandas/src/tseries.pyx":632
 *             result[i] = x
 *         else:
 *             result[i] = op(x, val)             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_bool(result)
 */
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_2 = PyObject_Call(__pyx_v_op, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_15 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_16, __pyx_bstride_0_result);
      __Pyx_GOTREF(*__pyx_t_15);
      __Pyx_DECREF(*__pyx_t_15); __Pyx_INCREF(__pyx_t_2);
      *__pyx_t_15 = __pyx_t_2;
      __Pyx_GIVEREF(*__pyx_t_15);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L8:;
  }

  /* "pandas/src/tseries.pyx":634
 *             result[i] = op(x, val)
 * 
 *     return maybe_convert_bool(result)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__maybe_convert_bool); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.scalar_binop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":638
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def vec_binop(ndarray[object] left, ndarray[object] right, object op):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(left)
 */

static PyObject *__pyx_pf_6pandas_3lib_26vec_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_26vec_binop = {__Pyx_NAMESTR("vec_binop"), (PyCFunction)__pyx_pf_6pandas_3lib_26vec_binop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_26vec_binop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  PyObject *__pyx_v_op = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  Py_buffer __pyx_bstruct_right;
  Py_ssize_t __pyx_bstride_0_right = 0;
  Py_ssize_t __pyx_bshape_0_right = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_left;
  Py_ssize_t __pyx_bstride_0_left = 0;
  Py_ssize_t __pyx_bshape_0_left = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject **__pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__right,&__pyx_n_s__op,0};
  __Pyx_RefNannySetupContext("vec_binop");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__op);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, 2); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "vec_binop") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_left = ((PyArrayObject *)values[0]);
    __pyx_v_right = ((PyArrayObject *)values[1]);
    __pyx_v_op = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("vec_binop", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_left.buf = NULL;
  __pyx_bstruct_right.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_left = __pyx_bstruct_left.strides[0];
  __pyx_bshape_0_left = __pyx_bstruct_left.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_right = __pyx_bstruct_right.strides[0];
  __pyx_bshape_0_right = __pyx_bstruct_right.shape[0];

  /* "pandas/src/tseries.pyx":640
 * def vec_binop(ndarray[object] left, ndarray[object] right, object op):
 *     cdef:
 *         Py_ssize_t i, n = len(left)             # <<<<<<<<<<<<<<
 *         ndarray[object] result
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":643
 *         ndarray[object] result
 * 
 *     if n != len(right):             # <<<<<<<<<<<<<<
 *         raise ValueError('Arrays were different lengths: %d vs %d'
 *                          % (n, len(right)))
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_v_n != __pyx_t_1);
  if (__pyx_t_2) {

    /* "pandas/src/tseries.pyx":645
 *     if n != len(right):
 *         raise ValueError('Arrays were different lengths: %d vs %d'
 *                          % (n, len(right)))             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype=object)
 */
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "pandas/src/tseries.pyx":647
 *                          % (n, len(right)))
 * 
 *     result = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "pandas/src/tseries.pyx":649
 *     result = np.empty(n, dtype=object)
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         x = left[i]
 *         y = right[i]
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pandas/src/tseries.pyx":650
 * 
 *     for i in range(n):
 *         x = left[i]             # <<<<<<<<<<<<<<
 *         y = right[i]
 *         try:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_left.buf, __pyx_t_13, __pyx_bstride_0_left);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "pandas/src/tseries.pyx":651
 *     for i in range(n):
 *         x = left[i]
 *         y = right[i]             # <<<<<<<<<<<<<<
 *         try:
 *             result[i] = op(x, y)
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_right.buf, __pyx_t_14, __pyx_bstride_0_right);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_y);
    __pyx_v_y = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "pandas/src/tseries.pyx":652
 *         x = left[i]
 *         y = right[i]
 *         try:             # <<<<<<<<<<<<<<
 *             result[i] = op(x, y)
 *         except TypeError:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      /*try:*/ {

        /* "pandas/src/tseries.pyx":653
 *         y = right[i]
 *         try:
 *             result[i] = op(x, y)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             if util._checknull(x):
 */
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_INCREF(__pyx_v_x);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x);
        __Pyx_GIVEREF(__pyx_v_x);
        __Pyx_INCREF(__pyx_v_y);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_y);
        __Pyx_GIVEREF(__pyx_v_y);
        __pyx_t_4 = PyObject_Call(__pyx_v_op, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_15, __pyx_bstride_0_result);
        __Pyx_GOTREF(*__pyx_t_16);
        __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_t_4);
        *__pyx_t_16 = __pyx_t_4;
        __Pyx_GIVEREF(*__pyx_t_16);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L16_try_end;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pandas/src/tseries.pyx":654
 *         try:
 *             result[i] = op(x, y)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             if util._checknull(x):
 *                 result[i] = x
 */
      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_3);

        /* "pandas/src/tseries.pyx":655
 *             result[i] = op(x, y)
 *         except TypeError:
 *             if util._checknull(x):             # <<<<<<<<<<<<<<
 *                 result[i] = x
 *             elif util._checknull(y):
 */
        __pyx_t_2 = __pyx_f_4util__checknull(__pyx_v_x);
        if (__pyx_t_2) {

          /* "pandas/src/tseries.pyx":656
 *         except TypeError:
 *             if util._checknull(x):
 *                 result[i] = x             # <<<<<<<<<<<<<<
 *             elif util._checknull(y):
 *                 result[i] = y
 */
          __pyx_t_17 = __pyx_v_i;
          __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result);
          __Pyx_GOTREF(*__pyx_t_16);
          __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_v_x);
          *__pyx_t_16 = __pyx_v_x;
          __Pyx_GIVEREF(*__pyx_t_16);
          goto __pyx_L19;
        }

        /* "pandas/src/tseries.pyx":657
 *             if util._checknull(x):
 *                 result[i] = x
 *             elif util._checknull(y):             # <<<<<<<<<<<<<<
 *                 result[i] = y
 *             else:
 */
        __pyx_t_2 = __pyx_f_4util__checknull(__pyx_v_y);
        if (__pyx_t_2) {

          /* "pandas/src/tseries.pyx":658
 *                 result[i] = x
 *             elif util._checknull(y):
 *                 result[i] = y             # <<<<<<<<<<<<<<
 *             else:
 *                 raise
 */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_18, __pyx_bstride_0_result);
          __Pyx_GOTREF(*__pyx_t_16);
          __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_v_y);
          *__pyx_t_16 = __pyx_v_y;
          __Pyx_GIVEREF(*__pyx_t_16);
          goto __pyx_L19;
        }
        /*else*/ {

          /* "pandas/src/tseries.pyx":660
 *                 result[i] = y
 *             else:
 *                 raise             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_bool(result)
 */
          __Pyx_GIVEREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_6);
          __Pyx_GIVEREF(__pyx_t_3);
          __Pyx_ErrRestore(__pyx_t_4, __pyx_t_6, __pyx_t_3);
          __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_3 = 0; 
          {__pyx_filename = __pyx_f[3]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        }
        __pyx_L19:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L10_exception_handled;
      }
      __pyx_L11_except_error:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      goto __pyx_L1_error;
      __pyx_L10_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      __pyx_L16_try_end:;
    }
  }

  /* "pandas/src/tseries.pyx":662
 *                 raise
 * 
 *     return maybe_convert_bool(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__maybe_convert_bool); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.vec_binop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pandas/src/tseries.pyx":665
 * 
 * 
 * def value_count_int64(ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_27value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_27value_count_int64 = {__Pyx_NAMESTR("value_count_int64"), (PyCFunction)__pyx_pf_6pandas_3lib_27value_count_int64, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_27value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  kh_int64_t *__pyx_v_table;
  int __pyx_v_ret;
  PyObject *__pyx_v_uniques = 0;
  PyObject *__pyx_v_val = NULL;
  khint_t __pyx_v_k;
  PyObject *__pyx_v_result_keys = NULL;
  PyObject *__pyx_v_result_counts = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int64_t __pyx_t_6;
  int __pyx_t_7;
  khint_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  khint_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value_count_int64");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "pandas/src/tseries.pyx":667
 * def value_count_int64(ndarray[int64_t] values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         kh_int64_t *table
 *         int ret = 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "pandas/src/tseries.pyx":669
 *         Py_ssize_t i, n = len(values)
 *         kh_int64_t *table
 *         int ret = 0             # <<<<<<<<<<<<<<
 *         list uniques = []
 * 
 */
  __pyx_v_ret = 0;

  /* "pandas/src/tseries.pyx":670
 *         kh_int64_t *table
 *         int ret = 0
 *         list uniques = []             # <<<<<<<<<<<<<<
 * 
 *     table = kh_init_int64()
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":672
 *         list uniques = []
 * 
 *     table = kh_init_int64()             # <<<<<<<<<<<<<<
 *     kh_resize_int64(table, n)
 * 
 */
  __pyx_v_table = kh_init_int64();

  /* "pandas/src/tseries.pyx":673
 * 
 *     table = kh_init_int64()
 *     kh_resize_int64(table, n)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  kh_resize_int64(__pyx_v_table, __pyx_v_n);

  /* "pandas/src/tseries.pyx":675
 *     kh_resize_int64(table, n)
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = values[i]
 *         k = kh_get_int64(table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pandas/src/tseries.pyx":676
 * 
 *     for i in range(n):
 *         val = values[i]             # <<<<<<<<<<<<<<
 *         k = kh_get_int64(table, val)
 *         if k != table.n_buckets:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[3]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pandas/src/tseries.pyx":677
 *     for i in range(n):
 *         val = values[i]
 *         k = kh_get_int64(table, val)             # <<<<<<<<<<<<<<
 *         if k != table.n_buckets:
 *             table.vals[k] += 1
 */
    __pyx_t_6 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_k = kh_get_int64(__pyx_v_table, __pyx_t_6);

    /* "pandas/src/tseries.pyx":678
 *         val = values[i]
 *         k = kh_get_int64(table, val)
 *         if k != table.n_buckets:             # <<<<<<<<<<<<<<
 *             table.vals[k] += 1
 *         else:
 */
    __pyx_t_7 = (__pyx_v_k != __pyx_v_table->n_buckets);
    if (__pyx_t_7) {

      /* "pandas/src/tseries.pyx":679
 *         k = kh_get_int64(table, val)
 *         if k != table.n_buckets:
 *             table.vals[k] += 1             # <<<<<<<<<<<<<<
 *         else:
 *             k = kh_put_int64(table, val, &ret)
 */
      __pyx_t_8 = __pyx_v_k;
      (__pyx_v_table->vals[__pyx_t_8]) = ((__pyx_v_table->vals[__pyx_t_8]) + 1);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "pandas/src/tseries.pyx":681
 *             table.vals[k] += 1
 *         else:
 *             k = kh_put_int64(table, val, &ret)             # <<<<<<<<<<<<<<
 *             table.vals[k] = 1
 * 
 */
      __pyx_t_6 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_k = kh_put_int64(__pyx_v_table, __pyx_t_6, (&__pyx_v_ret));

      /* "pandas/src/tseries.pyx":682
 *         else:
 *             k = kh_put_int64(table, val, &ret)
 *             table.vals[k] = 1             # <<<<<<<<<<<<<<
 * 
 *     # for (k = kh_begin(h); k != kh_end(h); ++k)
 */
      (__pyx_v_table->vals[__pyx_v_k]) = 1;
    }
    __pyx_L7:;
  }

  /* "pandas/src/tseries.pyx":686
 *     # for (k = kh_begin(h); k != kh_end(h); ++k)
 *     # 	if (kh_exist(h, k)) kh_value(h, k) = 1;
 *     i = 0             # <<<<<<<<<<<<<<
 *     result_keys = np.empty(table.n_occupied, dtype=np.int64)
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)
 */
  __pyx_v_i = 0;

  /* "pandas/src/tseries.pyx":687
 *     # 	if (kh_exist(h, k)) kh_value(h, k) = 1;
 *     i = 0
 *     result_keys = np.empty(table.n_occupied, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)
 *     for k in range(table.n_buckets):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_9, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_result_keys = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "pandas/src/tseries.pyx":688
 *     i = 0
 *     result_keys = np.empty(table.n_occupied, dtype=np.int64)
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     for k in range(table.n_buckets):
 *         if kh_exist_int64(table, k):
 */
  __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_12));
  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
  __pyx_v_result_counts = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "pandas/src/tseries.pyx":689
 *     result_keys = np.empty(table.n_occupied, dtype=np.int64)
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)
 *     for k in range(table.n_buckets):             # <<<<<<<<<<<<<<
 *         if kh_exist_int64(table, k):
 *             result_keys[i] = table.keys[k]
 */
  __pyx_t_8 = __pyx_v_table->n_buckets;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_8; __pyx_t_13+=1) {
    __pyx_v_k = __pyx_t_13;

    /* "pandas/src/tseries.pyx":690
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)
 *     for k in range(table.n_buckets):
 *         if kh_exist_int64(table, k):             # <<<<<<<<<<<<<<
 *             result_keys[i] = table.keys[k]
 *             result_counts[i] = table.vals[k]
 */
    __pyx_t_7 = kh_exist_int64(__pyx_v_table, __pyx_v_k);
    if (__pyx_t_7) {

      /* "pandas/src/tseries.pyx":691
 *     for k in range(table.n_buckets):
 *         if kh_exist_int64(table, k):
 *             result_keys[i] = table.keys[k]             # <<<<<<<<<<<<<<
 *             result_counts[i] = table.vals[k]
 *             i += 1
 */
      __pyx_t_11 = __Pyx_PyInt_to_py_npy_int64((__pyx_v_table->keys[__pyx_v_k])); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_SetItemInt(__pyx_v_result_keys, __pyx_v_i, __pyx_t_11, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "pandas/src/tseries.pyx":692
 *         if kh_exist_int64(table, k):
 *             result_keys[i] = table.keys[k]
 *             result_counts[i] = table.vals[k]             # <<<<<<<<<<<<<<
 *             i += 1
 *     kh_destroy_int64(table)
 */
      __pyx_t_11 = PyInt_FromSsize_t((__pyx_v_table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_SetItemInt(__pyx_v_result_counts, __pyx_v_i, __pyx_t_11, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "pandas/src/tseries.pyx":693
 *             result_keys[i] = table.keys[k]
 *             result_counts[i] = table.vals[k]
 *             i += 1             # <<<<<<<<<<<<<<
 *     kh_destroy_int64(table)
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
      goto __pyx_L10;
    }
    __pyx_L10:;
  }

  /* "pandas/src/tseries.pyx":694
 *             result_counts[i] = table.vals[k]
 *             i += 1
 *     kh_destroy_int64(table)             # <<<<<<<<<<<<<<
 * 
 *     return result_keys, result_counts
 */
  kh_destroy_int64(__pyx_v_table);

  /* "pandas/src/tseries.pyx":696
 *     kh_destroy_int64(table)
 * 
 *     return result_keys, result_counts             # <<<<<<<<<<<<<<
 * 
 * include "hashtable.pyx"
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  __Pyx_INCREF(__pyx_v_result_keys);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_result_keys);
  __Pyx_GIVEREF(__pyx_v_result_keys);
  __Pyx_INCREF(__pyx_v_result_counts);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_result_counts);
  __Pyx_GIVEREF(__pyx_v_result_counts);
  __pyx_r = ((PyObject *)__pyx_t_11);
  __pyx_t_11 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.value_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_result_keys);
  __Pyx_XDECREF(__pyx_v_result_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":14
 * 
 * 
 * def list_to_object_array(list obj):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert list to object ndarray. Seriously can't believe I had to write this
 */

static PyObject *__pyx_pf_6pandas_3lib_28list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_6pandas_3lib_28list_to_object_array[] = "\n    Convert list to object ndarray. Seriously can't believe I had to write this\n    function\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_28list_to_object_array = {__Pyx_NAMESTR("list_to_object_array"), (PyCFunction)__pyx_pf_6pandas_3lib_28list_to_object_array, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_28list_to_object_array)};
static PyObject *__pyx_pf_6pandas_3lib_28list_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_arr = 0;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject **__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("list_to_object_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), (&PyList_Type), 1, "obj", 1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":23
 *         ndarray[object] arr
 * 
 *     n = len(obj)             # <<<<<<<<<<<<<<
 *     arr = np.empty(n, dtype=object)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_obj) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_obj)); 
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":24
 * 
 *     n = len(obj)
 *     arr = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
    __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":26
 *     arr = np.empty(n, dtype=object)
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         arr[i] = obj[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":27
 * 
 *     for i from 0 <= i < n:
 *         arr[i] = obj[i]             # <<<<<<<<<<<<<<
 * 
 *     return arr
 */
    __pyx_t_5 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_obj), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_arr)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_arr.buf, __pyx_t_11, __pyx_bstride_0_arr);
    __Pyx_GOTREF(*__pyx_t_12);
    __Pyx_DECREF(*__pyx_t_12); __Pyx_INCREF(__pyx_t_5);
    *__pyx_t_12 = __pyx_t_5;
    __Pyx_GIVEREF(*__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":29
 *         arr[i] = obj[i]
 * 
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyObject *)__pyx_v_arr);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.list_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":52
 *         kv_object_t vec
 * 
 *     def __array__(self):             # <<<<<<<<<<<<<<
 *         """ Here we use the __array__ method, that is called when numpy
 *             tries to get an array from the object."""
 */

static PyObject *__pyx_pf_6pandas_3lib_12ObjectVector___array__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pandas_3lib_12ObjectVector___array__[] = " Here we use the __array__ method, that is called when numpy\n            tries to get an array from the object.";
static PyObject *__pyx_pf_6pandas_3lib_12ObjectVector___array__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  npy_intp __pyx_v_shape[1];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__array__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":56
 *             tries to get an array from the object."""
 *         cdef npy_intp shape[1]
 *         shape[0] = <npy_intp> self.vec.n             # <<<<<<<<<<<<<<
 * 
 *         # Create a 1D array, of length 'size'
 */
  (__pyx_v_shape[0]) = ((npy_intp)((struct __pyx_obj_6pandas_3lib_ObjectVector *)__pyx_v_self)->vec.n);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":59
 * 
 *         # Create a 1D array, of length 'size'
 *         return PyArray_SimpleNewFromData(1, shape, np.NPY_OBJECT, self.vec.a)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline append(self, object o):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_SimpleNewFromData(1, __pyx_v_shape, NPY_OBJECT, ((struct __pyx_obj_6pandas_3lib_ObjectVector *)__pyx_v_self)->vec.a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.ObjectVector.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":61
 *         return PyArray_SimpleNewFromData(1, shape, np.NPY_OBJECT, self.vec.a)
 * 
 *     cdef inline append(self, object o):             # <<<<<<<<<<<<<<
 *         kv_object_push(&self.vec, <PyObject*> o)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_12ObjectVector_append(struct __pyx_obj_6pandas_3lib_ObjectVector *__pyx_v_self, PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":62
 * 
 *     cdef inline append(self, object o):
 *         kv_object_push(&self.vec, <PyObject*> o)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  kv_object_push((&__pyx_v_self->vec), ((PyObject *)__pyx_v_o));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":64
 *         kv_object_push(&self.vec, <PyObject*> o)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         kv_object_destroy(&self.vec)
 * 
 */

static void __pyx_pf_6pandas_3lib_12ObjectVector_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pandas_3lib_12ObjectVector_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":65
 * 
 *     def __dealloc__(self):
 *         kv_object_destroy(&self.vec)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  kv_object_destroy((&((struct __pyx_obj_6pandas_3lib_ObjectVector *)__pyx_v_self)->vec));

  __Pyx_RefNannyFinishContext();
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":73
 *         kv_int64_t vec
 * 
 *     def __array__(self):             # <<<<<<<<<<<<<<
 *         """ Here we use the __array__ method, that is called when numpy
 *             tries to get an array from the object."""
 */

static PyObject *__pyx_pf_6pandas_3lib_11Int64Vector___array__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pandas_3lib_11Int64Vector___array__[] = " Here we use the __array__ method, that is called when numpy\n            tries to get an array from the object.";
static PyObject *__pyx_pf_6pandas_3lib_11Int64Vector___array__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  npy_intp __pyx_v_shape[1];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__array__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":77
 *             tries to get an array from the object."""
 *         cdef npy_intp shape[1]
 *         shape[0] = <npy_intp> self.vec.n             # <<<<<<<<<<<<<<
 * 
 *         # Create a 1D array, of length 'size'
 */
  (__pyx_v_shape[0]) = ((npy_intp)((struct __pyx_obj_6pandas_3lib_Int64Vector *)__pyx_v_self)->vec.n);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":80
 * 
 *         # Create a 1D array, of length 'size'
 *         return PyArray_SimpleNewFromData(1, shape, np.NPY_INT64,             # <<<<<<<<<<<<<<
 *                                          self.vec.a)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":81
 *         # Create a 1D array, of length 'size'
 *         return PyArray_SimpleNewFromData(1, shape, np.NPY_INT64,
 *                                          self.vec.a)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline append(self, int64_t x):
 */
  __pyx_t_1 = PyArray_SimpleNewFromData(1, __pyx_v_shape, NPY_INT64, ((struct __pyx_obj_6pandas_3lib_Int64Vector *)__pyx_v_self)->vec.a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Int64Vector.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":83
 *                                          self.vec.a)
 * 
 *     cdef inline append(self, int64_t x):             # <<<<<<<<<<<<<<
 *         kv_int64_push(&self.vec, x)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_11Int64Vector_append(struct __pyx_obj_6pandas_3lib_Int64Vector *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":84
 * 
 *     cdef inline append(self, int64_t x):
 *         kv_int64_push(&self.vec, x)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  kv_int64_push((&__pyx_v_self->vec), __pyx_v_x);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":86
 *         kv_int64_push(&self.vec, x)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.vec.a)
 * 
 */

static void __pyx_pf_6pandas_3lib_11Int64Vector_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pandas_3lib_11Int64Vector_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":87
 * 
 *     def __dealloc__(self):
 *         free(self.vec.a)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  free(((struct __pyx_obj_6pandas_3lib_Int64Vector *)__pyx_v_self)->vec.a);

  __Pyx_RefNannyFinishContext();
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":101
 *     #         kh_resize_str(self.table, size_hint)
 * 
 *     def __cinit__(self, int size_hint=1):             # <<<<<<<<<<<<<<
 *         self.table = kh_init_str()
 *         if size_hint is not None:
 */

static int __pyx_pf_6pandas_3lib_15StringHashTable___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_15StringHashTable___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_size_hint;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size_hint,0};
  __Pyx_RefNannySetupContext("__cinit__");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_size_hint = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_size_hint == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_size_hint = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.StringHashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":102
 * 
 *     def __cinit__(self, int size_hint=1):
 *         self.table = kh_init_str()             # <<<<<<<<<<<<<<
 *         if size_hint is not None:
 *             kh_resize_str(self.table, size_hint)
 */
  ((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table = kh_init_str();

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":103
 *     def __cinit__(self, int size_hint=1):
 *         self.table = kh_init_str()
 *         if size_hint is not None:             # <<<<<<<<<<<<<<
 *             kh_resize_str(self.table, size_hint)
 * 
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_size_hint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":104
 *         self.table = kh_init_str()
 *         if size_hint is not None:
 *             kh_resize_str(self.table, size_hint)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
    kh_resize_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table, __pyx_v_size_hint);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.StringHashTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":106
 *             kh_resize_str(self.table, size_hint)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         kh_destroy_str(self.table)
 * 
 */

static void __pyx_pf_6pandas_3lib_15StringHashTable_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pandas_3lib_15StringHashTable_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":107
 * 
 *     def __dealloc__(self):
 *         kh_destroy_str(self.table)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline int check_type(self, object val):
 */
  kh_destroy_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table);

  __Pyx_RefNannyFinishContext();
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":109
 *         kh_destroy_str(self.table)
 * 
 *     cdef inline int check_type(self, object val):             # <<<<<<<<<<<<<<
 *         return util.is_string_object(val)
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_15StringHashTable_check_type(struct __pyx_obj_6pandas_3lib_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_type");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":110
 * 
 *     cdef inline int check_type(self, object val):
 *         return util.is_string_object(val)             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_item(self, object val):
 */
  __pyx_r = is_string_object(__pyx_v_val);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":112
 *         return util.is_string_object(val)
 * 
 *     cpdef get_item(self, object val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_str(self.table, util.get_c_string(val))
 */

static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_2get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_15StringHashTable_get_item(struct __pyx_obj_6pandas_3lib_StringHashTable *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) {
  khiter_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_15StringHashTable_2get_item)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":114
 *     cpdef get_item(self, object val):
 *         cdef khiter_t k
 *         k = kh_get_str(self.table, util.get_c_string(val))             # <<<<<<<<<<<<<<
 *         if k != self.table.n_buckets:
 *             return self.table.vals[k]
 */
  __pyx_v_k = kh_get_str(__pyx_v_self->table, get_c_string(__pyx_v_val));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":115
 *         cdef khiter_t k
 *         k = kh_get_str(self.table, util.get_c_string(val))
 *         if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *             return self.table.vals[k]
 *         else:
 */
  __pyx_t_4 = (__pyx_v_k != __pyx_v_self->table->n_buckets);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":116
 *         k = kh_get_str(self.table, util.get_c_string(val))
 *         if k != self.table.n_buckets:
 *             return self.table.vals[k]             # <<<<<<<<<<<<<<
 *         else:
 *             raise KeyError(val)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":118
 *             return self.table.vals[k]
 *         else:
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 * 
 *     def get_iter_test(self, object key, Py_ssize_t iterations):
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.StringHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":112
 *         return util.is_string_object(val)
 * 
 *     cpdef get_item(self, object val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_str(self.table, util.get_c_string(val))
 */

static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_2get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_2get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_StringHashTable *)((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->__pyx_vtab)->get_item(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.StringHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":120
 *             raise KeyError(val)
 * 
 *     def get_iter_test(self, object key, Py_ssize_t iterations):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i, val
 *         for i in range(iterations):
 */

static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_3get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_3get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  Py_ssize_t __pyx_v_iterations;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_val;
  khint_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__iterations,0};
  __Pyx_RefNannySetupContext("get_iter_test");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterations);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_iter_test") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = values[0];
    __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.StringHashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":122
 *     def get_iter_test(self, object key, Py_ssize_t iterations):
 *         cdef Py_ssize_t i, val
 *         for i in range(iterations):             # <<<<<<<<<<<<<<
 *             k = kh_get_str(self.table, util.get_c_string(key))
 *             if k != self.table.n_buckets:
 */
  __pyx_t_1 = __pyx_v_iterations;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":123
 *         cdef Py_ssize_t i, val
 *         for i in range(iterations):
 *             k = kh_get_str(self.table, util.get_c_string(key))             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 val = self.table.vals[k]
 */
    __pyx_v_k = kh_get_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table, get_c_string(__pyx_v_key));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":124
 *         for i in range(iterations):
 *             k = kh_get_str(self.table, util.get_c_string(key))
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 val = self.table.vals[k]
 * 
 */
    __pyx_t_3 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":125
 *             k = kh_get_str(self.table, util.get_c_string(key))
 *             if k != self.table.n_buckets:
 *                 val = self.table.vals[k]             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_item(self, object key, Py_ssize_t val):
 */
      __pyx_v_val = (((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":127
 *                 val = self.table.vals[k]
 * 
 *     cpdef set_item(self, object key, Py_ssize_t val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             khiter_t k
 */

static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_4set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_15StringHashTable_set_item(struct __pyx_obj_6pandas_3lib_StringHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) {
  khiter_t __pyx_v_k;
  int __pyx_v_ret;
  char *__pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  kh_cstr_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_item");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_15StringHashTable_4set_item)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":130
 *         cdef:
 *             khiter_t k
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             char* buf
 * 
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":133
 *             char* buf
 * 
 *         buf = util.get_c_string(key)             # <<<<<<<<<<<<<<
 * 
 *         k = kh_put_str(self.table, buf, &ret)
 */
  __pyx_v_buf = get_c_string(__pyx_v_key);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":135
 *         buf = util.get_c_string(key)
 * 
 *         k = kh_put_str(self.table, buf, &ret)             # <<<<<<<<<<<<<<
 *         self.table.keys[k] = key
 *         if kh_exist_str(self.table, k):
 */
  __pyx_v_k = kh_put_str(__pyx_v_self->table, __pyx_v_buf, (&__pyx_v_ret));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":136
 * 
 *         k = kh_put_str(self.table, buf, &ret)
 *         self.table.keys[k] = key             # <<<<<<<<<<<<<<
 *         if kh_exist_str(self.table, k):
 *             self.table.vals[k] = val
 */
  __pyx_t_4 = PyBytes_AsString(__pyx_v_key); if (unlikely((__pyx_t_4 == (kh_cstr_t)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_t_4;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":137
 *         k = kh_put_str(self.table, buf, &ret)
 *         self.table.keys[k] = key
 *         if kh_exist_str(self.table, k):             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = val
 *         else:
 */
  __pyx_t_5 = kh_exist_str(__pyx_v_self->table, __pyx_v_k);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":138
 *         self.table.keys[k] = key
 *         if kh_exist_str(self.table, k):
 *             self.table.vals[k] = val             # <<<<<<<<<<<<<<
 *         else:
 *             raise KeyError(key)
 */
    (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":140
 *             self.table.vals[k] = val
 *         else:
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *     def get_indexer(self, ndarray[object] values):
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    __pyx_t_2 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":127
 *                 val = self.table.vals[k]
 * 
 *     cpdef set_item(self, object key, Py_ssize_t val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             khiter_t k
 */

static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_4set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_4set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  Py_ssize_t __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__val,0};
  __Pyx_RefNannySetupContext("set_item");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_item") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = values[0];
    __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_StringHashTable *)((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->__pyx_vtab)->set_item(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.StringHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":142
 *             raise KeyError(key)
 * 
 *     def get_indexer(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_5get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_5get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  char *__pyx_v_buf;
  __pyx_t_5numpy_int64_t *__pyx_v_resbuf;
  khiter_t __pyx_v_k;
  kh_str_t *__pyx_v_table;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_indexer");
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":144
 *     def get_indexer(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *             char *buf
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":145
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *             char *buf
 *             int64_t *resbuf = <int64_t*> labels.data
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_labels.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
      __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":147
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *             char *buf
 *             int64_t *resbuf = <int64_t*> labels.data             # <<<<<<<<<<<<<<
 *             khiter_t k
 *             kh_str_t *table = self.table
 */
  __pyx_v_resbuf = ((__pyx_t_5numpy_int64_t *)__pyx_v_labels->data);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":149
 *             int64_t *resbuf = <int64_t*> labels.data
 *             khiter_t k
 *             kh_str_t *table = self.table             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_v_table = ((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":151
 *             kh_str_t *table = self.table
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             buf = util.get_c_string(values[i])
 *             k = kh_get_str(table, buf)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":152
 * 
 *         for i in range(n):
 *             buf = util.get_c_string(values[i])             # <<<<<<<<<<<<<<
 *             k = kh_get_str(table, buf)
 *             if k != table.n_buckets:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __pyx_v_buf = get_c_string(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":153
 *         for i in range(n):
 *             buf = util.get_c_string(values[i])
 *             k = kh_get_str(table, buf)             # <<<<<<<<<<<<<<
 *             if k != table.n_buckets:
 *                 resbuf[i] = table.vals[k]
 */
    __pyx_v_k = kh_get_str(__pyx_v_table, __pyx_v_buf);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":154
 *             buf = util.get_c_string(values[i])
 *             k = kh_get_str(table, buf)
 *             if k != table.n_buckets:             # <<<<<<<<<<<<<<
 *                 resbuf[i] = table.vals[k]
 *             else:
 */
    __pyx_t_11 = (__pyx_v_k != __pyx_v_table->n_buckets);
    if (__pyx_t_11) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":155
 *             k = kh_get_str(table, buf)
 *             if k != table.n_buckets:
 *                 resbuf[i] = table.vals[k]             # <<<<<<<<<<<<<<
 *             else:
 *                 resbuf[i] = -1
 */
      (__pyx_v_resbuf[__pyx_v_i]) = (__pyx_v_table->vals[__pyx_v_k]);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":157
 *                 resbuf[i] = table.vals[k]
 *             else:
 *                 resbuf[i] = -1             # <<<<<<<<<<<<<<
 *         return labels
 * 
 */
      (__pyx_v_resbuf[__pyx_v_i]) = -1;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":158
 *             else:
 *                 resbuf[i] = -1
 *         return labels             # <<<<<<<<<<<<<<
 * 
 *     def unique(self, ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  __pyx_r = ((PyObject *)__pyx_v_labels);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.StringHashTable.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":160
 *         return labels
 * 
 *     def unique(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_6unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_6unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  PyObject *__pyx_v_val = 0;
  char *__pyx_v_buf;
  khiter_t __pyx_v_k;
  PyObject *__pyx_v_uniques = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":162
 *     def unique(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             Py_ssize_t idx, count = 0
 *             int ret = 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":163
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = 0             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             object val
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":164
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = 0
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             object val
 *             char *buf
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":168
 *             char *buf
 *             khiter_t k
 *             list uniques = []             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":170
 *             list uniques = []
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             buf = util.get_c_string(val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":171
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             buf = util.get_c_string(val)
 *             k = kh_get_str(self.table, buf)
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":172
 *         for i in range(n):
 *             val = values[i]
 *             buf = util.get_c_string(val)             # <<<<<<<<<<<<<<
 *             k = kh_get_str(self.table, buf)
 *             if k == self.table.n_buckets:
 */
    __pyx_v_buf = get_c_string(__pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":173
 *             val = values[i]
 *             buf = util.get_c_string(val)
 *             k = kh_get_str(self.table, buf)             # <<<<<<<<<<<<<<
 *             if k == self.table.n_buckets:
 *                 k = kh_put_str(self.table, buf, &ret)
 */
    __pyx_v_k = kh_get_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table, __pyx_v_buf);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":174
 *             buf = util.get_c_string(val)
 *             k = kh_get_str(self.table, buf)
 *             if k == self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 k = kh_put_str(self.table, buf, &ret)
 *                 # print 'putting %s, %s' % (val, count)
 */
    __pyx_t_6 = (__pyx_v_k == ((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":175
 *             k = kh_get_str(self.table, buf)
 *             if k == self.table.n_buckets:
 *                 k = kh_put_str(self.table, buf, &ret)             # <<<<<<<<<<<<<<
 *                 # print 'putting %s, %s' % (val, count)
 *                 if not ret:
 */
      __pyx_v_k = kh_put_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table, __pyx_v_buf, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":177
 *                 k = kh_put_str(self.table, buf, &ret)
 *                 # print 'putting %s, %s' % (val, count)
 *                 if not ret:             # <<<<<<<<<<<<<<
 *                     kh_del_str(self.table, k)
 *                 count += 1
 */
      __pyx_t_6 = (!__pyx_v_ret);
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":178
 *                 # print 'putting %s, %s' % (val, count)
 *                 if not ret:
 *                     kh_del_str(self.table, k)             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 uniques.append(val)
 */
        kh_del_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table, __pyx_v_k);
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":179
 *                 if not ret:
 *                     kh_del_str(self.table, k)
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 * 
 */
      __pyx_v_count = (__pyx_v_count + 1);

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":180
 *                     kh_del_str(self.table, k)
 *                 count += 1
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 * 
 *         # return None
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_7 = PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":183
 * 
 *         # return None
 *         return uniques             # <<<<<<<<<<<<<<
 * 
 *     def factorize(self, ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  __pyx_r = ((PyObject *)__pyx_v_uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.StringHashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":185
 *         return uniques
 * 
 *     def factorize(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_7factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15StringHashTable_7factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyObject *__pyx_v_reverse = 0;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  PyObject *__pyx_v_val = 0;
  char *__pyx_v_buf;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("factorize");
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":187
 *     def factorize(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":188
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 *             dict reverse = {}
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_labels.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
      __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":189
 *             Py_ssize_t i, n = len(values)
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *             dict reverse = {}
 *             Py_ssize_t idx, count = 0
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_counts.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
      __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":190
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 *             dict reverse = {}             # <<<<<<<<<<<<<<
 *             Py_ssize_t idx, count = 0
 *             int ret = 0
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_v_reverse = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":191
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 *             dict reverse = {}
 *             Py_ssize_t idx, count = 0             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             object val
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":192
 *             dict reverse = {}
 *             Py_ssize_t idx, count = 0
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             object val
 *             char *buf
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":197
 *             khiter_t k
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             buf = util.get_c_string(val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":198
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             buf = util.get_c_string(val)
 *             k = kh_get_str(self.table, buf)
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_values)) __pyx_t_11 = 0;
    if (unlikely(__pyx_t_11 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_11);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_10, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":199
 *         for i in range(n):
 *             val = values[i]
 *             buf = util.get_c_string(val)             # <<<<<<<<<<<<<<
 *             k = kh_get_str(self.table, buf)
 *             if k != self.table.n_buckets:
 */
    __pyx_v_buf = get_c_string(__pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":200
 *             val = values[i]
 *             buf = util.get_c_string(val)
 *             k = kh_get_str(self.table, buf)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 */
    __pyx_v_k = kh_get_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table, __pyx_v_buf);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":201
 *             buf = util.get_c_string(val)
 *             k = kh_get_str(self.table, buf)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 */
    __pyx_t_12 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_12) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":202
 *             k = kh_get_str(self.table, buf)
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]             # <<<<<<<<<<<<<<
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1
 */
      __pyx_v_idx = (((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":203
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx             # <<<<<<<<<<<<<<
 *                 counts[idx] = counts[idx] + 1
 *             else:
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_11 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_labels)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_13, __pyx_bstride_0_labels) = __pyx_v_idx;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":204
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1             # <<<<<<<<<<<<<<
 *             else:
 *                 k = kh_put_str(self.table, buf, &ret)
 */
      __pyx_t_14 = __pyx_v_idx;
      __pyx_t_11 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_counts)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = __pyx_v_idx;
      __pyx_t_11 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_counts)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_14, __pyx_bstride_0_counts)) + 1);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":206
 *                 counts[idx] = counts[idx] + 1
 *             else:
 *                 k = kh_put_str(self.table, buf, &ret)             # <<<<<<<<<<<<<<
 *                 # print 'putting %s, %s' % (val, count)
 *                 if not ret:
 */
      __pyx_v_k = kh_put_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table, __pyx_v_buf, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":208
 *                 k = kh_put_str(self.table, buf, &ret)
 *                 # print 'putting %s, %s' % (val, count)
 *                 if not ret:             # <<<<<<<<<<<<<<
 *                     kh_del_str(self.table, k)
 * 
 */
      __pyx_t_12 = (!__pyx_v_ret);
      if (__pyx_t_12) {

        /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":209
 *                 # print 'putting %s, %s' % (val, count)
 *                 if not ret:
 *                     kh_del_str(self.table, k)             # <<<<<<<<<<<<<<
 * 
 *                 self.table.vals[k] = count
 */
        kh_del_str(((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table, __pyx_v_k);
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":211
 *                     kh_del_str(self.table, k)
 * 
 *                 self.table.vals[k] = count             # <<<<<<<<<<<<<<
 *                 reverse[count] = val
 *                 labels[i] = count
 */
      (((struct __pyx_obj_6pandas_3lib_StringHashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":212
 * 
 *                 self.table.vals[k] = count
 *                 reverse[count] = val             # <<<<<<<<<<<<<<
 *                 labels[i] = count
 *                 counts[count] = 1
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_reverse), __pyx_v_count, __pyx_v_val, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":213
 *                 self.table.vals[k] = count
 *                 reverse[count] = val
 *                 labels[i] = count             # <<<<<<<<<<<<<<
 *                 counts[count] = 1
 *                 count += 1
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_11 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_labels)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":214
 *                 reverse[count] = val
 *                 labels[i] = count
 *                 counts[count] = 1             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      __pyx_t_17 = __pyx_v_count;
      __pyx_t_11 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_counts)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) = 1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":215
 *                 labels[i] = count
 *                 counts[count] = 1
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         # return None
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":218
 * 
 *         # return None
 *         return reverse, labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 * cdef class Int32HashTable(HashTable):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_reverse));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_reverse));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_reverse));
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.StringHashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_reverse);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":223
 *     cdef kh_int32_t *table
 * 
 *     def __init__(self, size_hint=1):             # <<<<<<<<<<<<<<
 *         if size_hint is not None:
 *             kh_resize_int32(self.table, size_hint)
 */

static int __pyx_pf_6pandas_3lib_14Int32HashTable___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_14Int32HashTable___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size_hint = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  khint_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size_hint,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":224
 * 
 *     def __init__(self, size_hint=1):
 *         if size_hint is not None:             # <<<<<<<<<<<<<<
 *             kh_resize_int32(self.table, size_hint)
 * 
 */
  __pyx_t_1 = (__pyx_v_size_hint != Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":225
 *     def __init__(self, size_hint=1):
 *         if size_hint is not None:
 *             kh_resize_int32(self.table, size_hint)             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
    __pyx_t_2 = __Pyx_PyInt_from_py_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_2 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    kh_resize_int32(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table, __pyx_t_2);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":227
 *             kh_resize_int32(self.table, size_hint)
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = kh_init_int32()
 * 
 */

static int __pyx_pf_6pandas_3lib_14Int32HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_14Int32HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":228
 * 
 *     def __cinit__(self):
 *         self.table = kh_init_int32()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table = kh_init_int32();

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":230
 *         self.table = kh_init_int32()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         kh_destroy_int32(self.table)
 * 
 */

static void __pyx_pf_6pandas_3lib_14Int32HashTable_2__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pandas_3lib_14Int32HashTable_2__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":231
 * 
 *     def __dealloc__(self):
 *         kh_destroy_int32(self.table)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline int check_type(self, object val):
 */
  kh_destroy_int32(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table);

  __Pyx_RefNannyFinishContext();
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":233
 *         kh_destroy_int32(self.table)
 * 
 *     cdef inline int check_type(self, object val):             # <<<<<<<<<<<<<<
 *         return util.is_string_object(val)
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_14Int32HashTable_check_type(struct __pyx_obj_6pandas_3lib_Int32HashTable *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_type");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":234
 * 
 *     cdef inline int check_type(self, object val):
 *         return util.is_string_object(val)             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_item(self, int32_t val):
 */
  __pyx_r = is_string_object(__pyx_v_val);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":236
 *         return util.is_string_object(val)
 * 
 *     cpdef get_item(self, int32_t val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_int32(self.table, val)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_3get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_14Int32HashTable_get_item(struct __pyx_obj_6pandas_3lib_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_val, int __pyx_skip_dispatch) {
  khiter_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_14Int32HashTable_3get_item)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":238
 *     cpdef get_item(self, int32_t val):
 *         cdef khiter_t k
 *         k = kh_get_int32(self.table, val)             # <<<<<<<<<<<<<<
 *         if k != self.table.n_buckets:
 *             return self.table.vals[k]
 */
  __pyx_v_k = kh_get_int32(__pyx_v_self->table, __pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":239
 *         cdef khiter_t k
 *         k = kh_get_int32(self.table, val)
 *         if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *             return self.table.vals[k]
 *         else:
 */
  __pyx_t_4 = (__pyx_v_k != __pyx_v_self->table->n_buckets);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":240
 *         k = kh_get_int32(self.table, val)
 *         if k != self.table.n_buckets:
 *             return self.table.vals[k]             # <<<<<<<<<<<<<<
 *         else:
 *             raise KeyError(val)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":242
 *             return self.table.vals[k]
 *         else:
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 * 
 *     def get_iter_test(self, int32_t key, Py_ssize_t iterations):
 */
    __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":236
 *         return util.is_string_object(val)
 * 
 *     cpdef get_item(self, int32_t val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_int32(self.table, val)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_3get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_3get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) {
  __pyx_t_5numpy_int32_t __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item");
  assert(__pyx_arg_val); {
    __pyx_v_val = __Pyx_PyInt_from_py_npy_int32(__pyx_arg_val); if (unlikely((__pyx_v_val == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Int32HashTable *)((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->__pyx_vtab)->get_item(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":244
 *             raise KeyError(val)
 * 
 *     def get_iter_test(self, int32_t key, Py_ssize_t iterations):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i, val=0
 *         for i in range(iterations):
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_4get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_4get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_5numpy_int32_t __pyx_v_key;
  Py_ssize_t __pyx_v_iterations;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_val;
  khint_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__iterations,0};
  __Pyx_RefNannySetupContext("get_iter_test");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterations);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_iter_test") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = __Pyx_PyInt_from_py_npy_int32(values[0]); if (unlikely((__pyx_v_key == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":245
 * 
 *     def get_iter_test(self, int32_t key, Py_ssize_t iterations):
 *         cdef Py_ssize_t i, val=0             # <<<<<<<<<<<<<<
 *         for i in range(iterations):
 *             k = kh_get_int32(self.table, val)
 */
  __pyx_v_val = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":246
 *     def get_iter_test(self, int32_t key, Py_ssize_t iterations):
 *         cdef Py_ssize_t i, val=0
 *         for i in range(iterations):             # <<<<<<<<<<<<<<
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:
 */
  __pyx_t_1 = __pyx_v_iterations;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":247
 *         cdef Py_ssize_t i, val=0
 *         for i in range(iterations):
 *             k = kh_get_int32(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 val = self.table.vals[k]
 */
    __pyx_v_k = kh_get_int32(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":248
 *         for i in range(iterations):
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 val = self.table.vals[k]
 * 
 */
    __pyx_t_3 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":249
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:
 *                 val = self.table.vals[k]             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_item(self, int32_t key, Py_ssize_t val):
 */
      __pyx_v_val = (((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":251
 *                 val = self.table.vals[k]
 * 
 *     cpdef set_item(self, int32_t key, Py_ssize_t val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             khiter_t k
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_5set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_14Int32HashTable_set_item(struct __pyx_obj_6pandas_3lib_Int32HashTable *__pyx_v_self, __pyx_t_5numpy_int32_t __pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) {
  khiter_t __pyx_v_k;
  int __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_item");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_14Int32HashTable_5set_item)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":254
 *         cdef:
 *             khiter_t k
 *             int ret = 0             # <<<<<<<<<<<<<<
 * 
 *         k = kh_put_int32(self.table, key, &ret)
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":256
 *             int ret = 0
 * 
 *         k = kh_put_int32(self.table, key, &ret)             # <<<<<<<<<<<<<<
 *         self.table.keys[k] = key
 *         if kh_exist_int32(self.table, k):
 */
  __pyx_v_k = kh_put_int32(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":257
 * 
 *         k = kh_put_int32(self.table, key, &ret)
 *         self.table.keys[k] = key             # <<<<<<<<<<<<<<
 *         if kh_exist_int32(self.table, k):
 *             self.table.vals[k] = val
 */
  (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_v_key;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":258
 *         k = kh_put_int32(self.table, key, &ret)
 *         self.table.keys[k] = key
 *         if kh_exist_int32(self.table, k):             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = val
 *         else:
 */
  __pyx_t_5 = kh_exist_int32(__pyx_v_self->table, __pyx_v_k);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":259
 *         self.table.keys[k] = key
 *         if kh_exist_int32(self.table, k):
 *             self.table.vals[k] = val             # <<<<<<<<<<<<<<
 *         else:
 *             raise KeyError(key)
 */
    (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":261
 *             self.table.vals[k] = val
 *         else:
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *     def map_locations(self, ndarray[int32_t] values):
 */
    __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":251
 *                 val = self.table.vals[k]
 * 
 *     cpdef set_item(self, int32_t key, Py_ssize_t val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             khiter_t k
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_5set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_5set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_5numpy_int32_t __pyx_v_key;
  Py_ssize_t __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__val,0};
  __Pyx_RefNannySetupContext("set_item");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_item") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = __Pyx_PyInt_from_py_npy_int32(values[0]); if (unlikely((__pyx_v_key == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Int32HashTable *)((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->__pyx_vtab)->set_item(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":263
 *             raise KeyError(key)
 * 
 *     def map_locations(self, ndarray[int32_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_6map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_6map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  __pyx_t_5numpy_int32_t __pyx_v_val;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_locations");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":265
 *     def map_locations(self, ndarray[int32_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int32_t val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":266
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int32_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":270
 *             khiter_t k
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_put_int32(self.table, val, &ret)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":271
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_put_int32(self.table, val, &ret)
 *             self.table.vals[k] = i
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_values)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_values.buf, __pyx_t_3, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":272
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_put_int32(self.table, val, &ret)             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = i
 * 
 */
    __pyx_v_k = kh_put_int32(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table, __pyx_v_val, (&__pyx_v_ret));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":273
 *             val = values[i]
 *             k = kh_put_int32(self.table, val, &ret)
 *             self.table.vals[k] = i             # <<<<<<<<<<<<<<
 * 
 *     def lookup(self, ndarray[int32_t] values):
 */
    (((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = __pyx_v_i;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":275
 *             self.table.vals[k] = i
 * 
 *     def lookup(self, ndarray[int32_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_7lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_7lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  __pyx_t_5numpy_int32_t __pyx_v_val;
  khiter_t __pyx_v_k;
  PyArrayObject *__pyx_v_locs = 0;
  Py_buffer __pyx_bstruct_locs;
  Py_ssize_t __pyx_bstride_0_locs = 0;
  Py_ssize_t __pyx_bshape_0_locs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup");
  __pyx_bstruct_locs.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":277
 *     def lookup(self, ndarray[int32_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int32_t val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":278
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int32_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":281
 *             int32_t val
 *             khiter_t k
 *             ndarray[int32_t] locs = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_locs, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_locs.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_locs = __pyx_bstruct_locs.strides[0];
      __pyx_bshape_0_locs = __pyx_bstruct_locs.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":283
 *             ndarray[int32_t] locs = np.empty(n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_get_int32(self.table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":284
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":285
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_get_int32(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]
 */
    __pyx_v_k = kh_get_int32(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":286
 *             val = values[i]
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 locs[i] = self.table.vals[k]
 *             else:
 */
    __pyx_t_11 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_11) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":287
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]             # <<<<<<<<<<<<<<
 *             else:
 *                 locs[i] = -1
 */
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_locs.buf, __pyx_t_12, __pyx_bstride_0_locs) = (((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":289
 *                 locs[i] = self.table.vals[k]
 *             else:
 *                 locs[i] = -1             # <<<<<<<<<<<<<<
 * 
 *         return locs
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_locs.buf, __pyx_t_13, __pyx_bstride_0_locs) = -1;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":291
 *                 locs[i] = -1
 * 
 *         return locs             # <<<<<<<<<<<<<<
 * 
 *     def factorize(self, ndarray[int32_t] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_locs));
  __pyx_r = ((PyObject *)__pyx_v_locs);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":293
 *         return locs
 * 
 *     def factorize(self, ndarray[int32_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_8factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int32HashTable_8factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyObject *__pyx_v_reverse = 0;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  __pyx_t_5numpy_int32_t __pyx_v_val;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("factorize");
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":295
 *     def factorize(self, ndarray[int32_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":296
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 *             dict reverse = {}
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_labels.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
      __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":297
 *             Py_ssize_t i, n = len(values)
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *             dict reverse = {}
 *             Py_ssize_t idx, count = 0
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_counts.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
      __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":298
 *             ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 *             dict reverse = {}             # <<<<<<<<<<<<<<
 *             Py_ssize_t idx, count = 0
 *             int ret = 0
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_v_reverse = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":299
 *             ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 *             dict reverse = {}
 *             Py_ssize_t idx, count = 0             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int32_t val
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":300
 *             dict reverse = {}
 *             Py_ssize_t idx, count = 0
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int32_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":304
 *             khiter_t k
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_get_int32(self.table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_1; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":305
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_11 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_values)) __pyx_t_11 = 0;
    if (unlikely(__pyx_t_11 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_11);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_values.buf, __pyx_t_10, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":306
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_get_int32(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 */
    __pyx_v_k = kh_get_int32(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":307
 *             val = values[i]
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 */
    __pyx_t_12 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_12) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":308
 *             k = kh_get_int32(self.table, val)
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]             # <<<<<<<<<<<<<<
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1
 */
      __pyx_v_idx = (((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":309
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx             # <<<<<<<<<<<<<<
 *                 counts[idx] = counts[idx] + 1
 *             else:
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_11 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_labels)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_13, __pyx_bstride_0_labels) = __pyx_v_idx;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":310
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1             # <<<<<<<<<<<<<<
 *             else:
 *                 k = kh_put_int32(self.table, val, &ret)
 */
      __pyx_t_14 = __pyx_v_idx;
      __pyx_t_11 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_counts)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = __pyx_v_idx;
      __pyx_t_11 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_counts)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_14, __pyx_bstride_0_counts)) + 1);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":312
 *                 counts[idx] = counts[idx] + 1
 *             else:
 *                 k = kh_put_int32(self.table, val, &ret)             # <<<<<<<<<<<<<<
 *                 if not ret:
 *                     kh_del_int32(self.table, k)
 */
      __pyx_v_k = kh_put_int32(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table, __pyx_v_val, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":313
 *             else:
 *                 k = kh_put_int32(self.table, val, &ret)
 *                 if not ret:             # <<<<<<<<<<<<<<
 *                     kh_del_int32(self.table, k)
 *                 self.table.vals[k] = count
 */
      __pyx_t_12 = (!__pyx_v_ret);
      if (__pyx_t_12) {

        /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":314
 *                 k = kh_put_int32(self.table, val, &ret)
 *                 if not ret:
 *                     kh_del_int32(self.table, k)             # <<<<<<<<<<<<<<
 *                 self.table.vals[k] = count
 *                 reverse[count] = val
 */
        kh_del_int32(((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table, __pyx_v_k);
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":315
 *                 if not ret:
 *                     kh_del_int32(self.table, k)
 *                 self.table.vals[k] = count             # <<<<<<<<<<<<<<
 *                 reverse[count] = val
 *                 labels[i] = count
 */
      (((struct __pyx_obj_6pandas_3lib_Int32HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":316
 *                     kh_del_int32(self.table, k)
 *                 self.table.vals[k] = count
 *                 reverse[count] = val             # <<<<<<<<<<<<<<
 *                 labels[i] = count
 *                 counts[count] = 1
 */
      __pyx_t_5 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_reverse), __pyx_v_count, __pyx_t_5, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":317
 *                 self.table.vals[k] = count
 *                 reverse[count] = val
 *                 labels[i] = count             # <<<<<<<<<<<<<<
 *                 counts[count] = 1
 *                 count += 1
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_11 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_labels)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":318
 *                 reverse[count] = val
 *                 labels[i] = count
 *                 counts[count] = 1             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      __pyx_t_17 = __pyx_v_count;
      __pyx_t_11 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_counts)) __pyx_t_11 = 0;
      if (unlikely(__pyx_t_11 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_11);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) = 1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":319
 *                 labels[i] = count
 *                 counts[count] = 1
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         # return None
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":322
 * 
 *         # return None
 *         return reverse, labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 * cdef class Int64HashTable(HashTable):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_reverse));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_reverse));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_reverse));
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int32HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_reverse);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":327
 *     cdef kh_int64_t *table
 * 
 *     def __init__(self, size_hint=1):             # <<<<<<<<<<<<<<
 *         if size_hint is not None:
 *             kh_resize_int64(self.table, size_hint)
 */

static int __pyx_pf_6pandas_3lib_14Int64HashTable___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_14Int64HashTable___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size_hint = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  khint_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size_hint,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":328
 * 
 *     def __init__(self, size_hint=1):
 *         if size_hint is not None:             # <<<<<<<<<<<<<<
 *             kh_resize_int64(self.table, size_hint)
 * 
 */
  __pyx_t_1 = (__pyx_v_size_hint != Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":329
 *     def __init__(self, size_hint=1):
 *         if size_hint is not None:
 *             kh_resize_int64(self.table, size_hint)             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
    __pyx_t_2 = __Pyx_PyInt_from_py_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_2 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    kh_resize_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_t_2);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":331
 *             kh_resize_int64(self.table, size_hint)
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = kh_init_int64()
 * 
 */

static int __pyx_pf_6pandas_3lib_14Int64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_14Int64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":332
 * 
 *     def __cinit__(self):
 *         self.table = kh_init_int64()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table = kh_init_int64();

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":334
 *         self.table = kh_init_int64()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         kh_destroy_int64(self.table)
 * 
 */

static void __pyx_pf_6pandas_3lib_14Int64HashTable_2__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pandas_3lib_14Int64HashTable_2__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":335
 * 
 *     def __dealloc__(self):
 *         kh_destroy_int64(self.table)             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, object key):
 */
  kh_destroy_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table);

  __Pyx_RefNannyFinishContext();
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":337
 *         kh_destroy_int64(self.table)
 * 
 *     def __contains__(self, object key):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, key)
 */

static int __pyx_pf_6pandas_3lib_14Int64HashTable_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pf_6pandas_3lib_14Int64HashTable_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  khiter_t __pyx_v_k;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_5numpy_int64_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__contains__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":339
 *     def __contains__(self, object key):
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, key)             # <<<<<<<<<<<<<<
 *         return k != self.table.n_buckets
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_key); if (unlikely((__pyx_t_1 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = kh_get_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_t_1);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":340
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, key)
 *         return k != self.table.n_buckets             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __pyx_r = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->n_buckets);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":342
 *         return k != self.table.n_buckets
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.table.size
 * 
 */

static Py_ssize_t __pyx_pf_6pandas_3lib_14Int64HashTable_4__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6pandas_3lib_14Int64HashTable_4__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":343
 * 
 *     def __len__(self):
 *         return self.table.size             # <<<<<<<<<<<<<<
 * 
 *     cdef inline bint has_key(self, int64_t val):
 */
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->size;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":345
 *         return self.table.size
 * 
 *     cdef inline bint has_key(self, int64_t val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, val)
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_14Int64HashTable_has_key(struct __pyx_obj_6pandas_3lib_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_val) {
  khiter_t __pyx_v_k;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("has_key");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":347
 *     cdef inline bint has_key(self, int64_t val):
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, val)             # <<<<<<<<<<<<<<
 *         return k != self.table.n_buckets
 * 
 */
  __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":348
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, val)
 *         return k != self.table.n_buckets             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_item(self, int64_t val):
 */
  __pyx_r = (__pyx_v_k != __pyx_v_self->table->n_buckets);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":350
 *         return k != self.table.n_buckets
 * 
 *     cpdef get_item(self, int64_t val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, val)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_14Int64HashTable_get_item(struct __pyx_obj_6pandas_3lib_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_val, int __pyx_skip_dispatch) {
  khiter_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_14Int64HashTable_5get_item)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":352
 *     cpdef get_item(self, int64_t val):
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, val)             # <<<<<<<<<<<<<<
 *         if k != self.table.n_buckets:
 *             return self.table.vals[k]
 */
  __pyx_v_k = kh_get_int64(__pyx_v_self->table, __pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":353
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, val)
 *         if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *             return self.table.vals[k]
 *         else:
 */
  __pyx_t_4 = (__pyx_v_k != __pyx_v_self->table->n_buckets);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":354
 *         k = kh_get_int64(self.table, val)
 *         if k != self.table.n_buckets:
 *             return self.table.vals[k]             # <<<<<<<<<<<<<<
 *         else:
 *             raise KeyError(val)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":356
 *             return self.table.vals[k]
 *         else:
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 * 
 *     def get_iter_test(self, int64_t key, Py_ssize_t iterations):
 */
    __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":350
 *         return k != self.table.n_buckets
 * 
 *     cpdef get_item(self, int64_t val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_int64(self.table, val)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_arg_val) {
  __pyx_t_5numpy_int64_t __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item");
  assert(__pyx_arg_val); {
    __pyx_v_val = __Pyx_PyInt_from_py_npy_int64(__pyx_arg_val); if (unlikely((__pyx_v_val == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Int64HashTable *)((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->__pyx_vtab)->get_item(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":358
 *             raise KeyError(val)
 * 
 *     def get_iter_test(self, int64_t key, Py_ssize_t iterations):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i, val=0
 *         for i in range(iterations):
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_6get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_6get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_5numpy_int64_t __pyx_v_key;
  Py_ssize_t __pyx_v_iterations;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_val;
  khint_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__iterations,0};
  __Pyx_RefNannySetupContext("get_iter_test");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterations);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_iter_test") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = __Pyx_PyInt_from_py_npy_int64(values[0]); if (unlikely((__pyx_v_key == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":359
 * 
 *     def get_iter_test(self, int64_t key, Py_ssize_t iterations):
 *         cdef Py_ssize_t i, val=0             # <<<<<<<<<<<<<<
 *         for i in range(iterations):
 *             k = kh_get_int64(self.table, val)
 */
  __pyx_v_val = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":360
 *     def get_iter_test(self, int64_t key, Py_ssize_t iterations):
 *         cdef Py_ssize_t i, val=0
 *         for i in range(iterations):             # <<<<<<<<<<<<<<
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 */
  __pyx_t_1 = __pyx_v_iterations;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":361
 *         cdef Py_ssize_t i, val=0
 *         for i in range(iterations):
 *             k = kh_get_int64(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 val = self.table.vals[k]
 */
    __pyx_v_k = kh_get_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":362
 *         for i in range(iterations):
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 val = self.table.vals[k]
 * 
 */
    __pyx_t_3 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":363
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 *                 val = self.table.vals[k]             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_item(self, int64_t key, Py_ssize_t val):
 */
      __pyx_v_val = (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":365
 *                 val = self.table.vals[k]
 * 
 *     cpdef set_item(self, int64_t key, Py_ssize_t val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             khiter_t k
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_14Int64HashTable_set_item(struct __pyx_obj_6pandas_3lib_Int64HashTable *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) {
  khiter_t __pyx_v_k;
  int __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_item");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_14Int64HashTable_7set_item)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":368
 *         cdef:
 *             khiter_t k
 *             int ret = 0             # <<<<<<<<<<<<<<
 * 
 *         k = kh_put_int64(self.table, key, &ret)
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":370
 *             int ret = 0
 * 
 *         k = kh_put_int64(self.table, key, &ret)             # <<<<<<<<<<<<<<
 *         self.table.keys[k] = key
 *         if kh_exist_int64(self.table, k):
 */
  __pyx_v_k = kh_put_int64(__pyx_v_self->table, __pyx_v_key, (&__pyx_v_ret));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":371
 * 
 *         k = kh_put_int64(self.table, key, &ret)
 *         self.table.keys[k] = key             # <<<<<<<<<<<<<<
 *         if kh_exist_int64(self.table, k):
 *             self.table.vals[k] = val
 */
  (__pyx_v_self->table->keys[__pyx_v_k]) = __pyx_v_key;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":372
 *         k = kh_put_int64(self.table, key, &ret)
 *         self.table.keys[k] = key
 *         if kh_exist_int64(self.table, k):             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = val
 *         else:
 */
  __pyx_t_5 = kh_exist_int64(__pyx_v_self->table, __pyx_v_k);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":373
 *         self.table.keys[k] = key
 *         if kh_exist_int64(self.table, k):
 *             self.table.vals[k] = val             # <<<<<<<<<<<<<<
 *         else:
 *             raise KeyError(key)
 */
    (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":375
 *             self.table.vals[k] = val
 *         else:
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *     def map(self, ndarray[int64_t] keys, ndarray[int64_t] values):
 */
    __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":365
 *                 val = self.table.vals[k]
 * 
 *     cpdef set_item(self, int64_t key, Py_ssize_t val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             khiter_t k
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_5numpy_int64_t __pyx_v_key;
  Py_ssize_t __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__val,0};
  __Pyx_RefNannySetupContext("set_item");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_item") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = __Pyx_PyInt_from_py_npy_int64(values[0]); if (unlikely((__pyx_v_key == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Int64HashTable *)((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->__pyx_vtab)->set_item(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":377
 *             raise KeyError(key)
 * 
 *     def map(self, ndarray[int64_t] keys, ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_8map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_8map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_keys = 0;
  PyArrayObject *__pyx_v_values = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  __pyx_t_5numpy_int64_t __pyx_v_key;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_keys;
  Py_ssize_t __pyx_bstride_0_keys = 0;
  Py_ssize_t __pyx_bshape_0_keys = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__keys,&__pyx_n_s__values,0};
  __Pyx_RefNannySetupContext("map");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__keys);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("map", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "map") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_keys = ((PyArrayObject *)values[0]);
    __pyx_v_values = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_keys.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_keys, (PyObject*)__pyx_v_keys, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_keys = __pyx_bstruct_keys.strides[0];
  __pyx_bshape_0_keys = __pyx_bstruct_keys.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":379
 *     def map(self, ndarray[int64_t] keys, ndarray[int64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int64_t key
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":380
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int64_t key
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":384
 *             khiter_t k
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             key = keys[i]
 *             k = kh_put_int64(self.table, key, &ret)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":385
 * 
 *         for i in range(n):
 *             key = keys[i]             # <<<<<<<<<<<<<<
 *             k = kh_put_int64(self.table, key, &ret)
 *             self.table.vals[k] = <Py_ssize_t> values[i]
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_bshape_0_keys;
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_keys)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_key = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_keys.buf, __pyx_t_3, __pyx_bstride_0_keys));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":386
 *         for i in range(n):
 *             key = keys[i]
 *             k = kh_put_int64(self.table, key, &ret)             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = <Py_ssize_t> values[i]
 * 
 */
    __pyx_v_k = kh_put_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_key, (&__pyx_v_ret));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":387
 *             key = keys[i]
 *             k = kh_put_int64(self.table, key, &ret)
 *             self.table.vals[k] = <Py_ssize_t> values[i]             # <<<<<<<<<<<<<<
 * 
 *     def map_locations(self, ndarray[int64_t] values):
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_5 < 0) {
      __pyx_t_5 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_5 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_5 >= __pyx_bshape_0_values)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = ((Py_ssize_t)(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_5, __pyx_bstride_0_values)));
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_keys);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_keys);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":389
 *             self.table.vals[k] = <Py_ssize_t> values[i]
 * 
 *     def map_locations(self, ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_9map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_9map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_locations");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":391
 *     def map_locations(self, ndarray[int64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int64_t val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":392
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int64_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":396
 *             khiter_t k
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_put_int64(self.table, val, &ret)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":397
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_put_int64(self.table, val, &ret)
 *             self.table.vals[k] = i
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_values)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_3, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":398
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_put_int64(self.table, val, &ret)             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = i
 * 
 */
    __pyx_v_k = kh_put_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val, (&__pyx_v_ret));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":399
 *             val = values[i]
 *             k = kh_put_int64(self.table, val, &ret)
 *             self.table.vals[k] = i             # <<<<<<<<<<<<<<
 * 
 *     def lookup(self, ndarray[int64_t] values):
 */
    (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = __pyx_v_i;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":401
 *             self.table.vals[k] = i
 * 
 *     def lookup(self, ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_10lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_10lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  PyArrayObject *__pyx_v_locs = 0;
  Py_buffer __pyx_bstruct_locs;
  Py_ssize_t __pyx_bstride_0_locs = 0;
  Py_ssize_t __pyx_bshape_0_locs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup");
  __pyx_bstruct_locs.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":403
 *     def lookup(self, ndarray[int64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int64_t val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":404
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int64_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":407
 *             int64_t val
 *             khiter_t k
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_locs, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_locs.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_locs = __pyx_bstruct_locs.strides[0];
      __pyx_bshape_0_locs = __pyx_bstruct_locs.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":409
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":410
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":411
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]
 */
    __pyx_v_k = kh_get_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":412
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 locs[i] = self.table.vals[k]
 *             else:
 */
    __pyx_t_11 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_11) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":413
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]             # <<<<<<<<<<<<<<
 *             else:
 *                 locs[i] = -1
 */
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_locs.buf, __pyx_t_12, __pyx_bstride_0_locs) = (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":415
 *                 locs[i] = self.table.vals[k]
 *             else:
 *                 locs[i] = -1             # <<<<<<<<<<<<<<
 * 
 *         return locs
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_locs.buf, __pyx_t_13, __pyx_bstride_0_locs) = -1;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":417
 *                 locs[i] = -1
 * 
 *         return locs             # <<<<<<<<<<<<<<
 * 
 *     def lookup_i4(self, ndarray[int64_t] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_locs));
  __pyx_r = ((PyObject *)__pyx_v_locs);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":419
 *         return locs
 * 
 *     def lookup_i4(self, ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_11lookup_i4(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_11lookup_i4(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  PyArrayObject *__pyx_v_locs = 0;
  Py_buffer __pyx_bstruct_locs;
  Py_ssize_t __pyx_bstride_0_locs = 0;
  Py_ssize_t __pyx_bshape_0_locs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup_i4");
  __pyx_bstruct_locs.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":421
 *     def lookup_i4(self, ndarray[int64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int64_t val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":422
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int64_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":425
 *             int64_t val
 *             khiter_t k
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_locs, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_locs.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_locs = __pyx_bstruct_locs.strides[0];
      __pyx_bshape_0_locs = __pyx_bstruct_locs.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":427
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":428
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":429
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]
 */
    __pyx_v_k = kh_get_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":430
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 locs[i] = self.table.vals[k]
 *             else:
 */
    __pyx_t_11 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_11) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":431
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]             # <<<<<<<<<<<<<<
 *             else:
 *                 locs[i] = -1
 */
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_locs.buf, __pyx_t_12, __pyx_bstride_0_locs) = (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":433
 *                 locs[i] = self.table.vals[k]
 *             else:
 *                 locs[i] = -1             # <<<<<<<<<<<<<<
 * 
 *         return locs
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_locs.buf, __pyx_t_13, __pyx_bstride_0_locs) = -1;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":435
 *                 locs[i] = -1
 * 
 *         return locs             # <<<<<<<<<<<<<<
 * 
 *     def factorize(self, ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_locs));
  __pyx_r = ((PyObject *)__pyx_v_locs);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.lookup_i4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":437
 *         return locs
 * 
 *     def factorize(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         reverse = {}
 *         labels, counts = self.get_labels(values, reverse, 0)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_12factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_12factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_reverse = NULL;
  PyObject *__pyx_v_labels = NULL;
  PyObject *__pyx_v_counts = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("factorize");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":438
 * 
 *     def factorize(self, ndarray[object] values):
 *         reverse = {}             # <<<<<<<<<<<<<<
 *         labels, counts = self.get_labels(values, reverse, 0)
 *         return reverse, labels, counts
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_reverse = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":439
 *     def factorize(self, ndarray[object] values):
 *         reverse = {}
 *         labels, counts = self.get_labels(values, reverse, 0)             # <<<<<<<<<<<<<<
 *         return reverse, labels, counts
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __Pyx_INCREF(((PyObject *)__pyx_v_reverse));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_reverse));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_reverse));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_labels = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_counts = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":440
 *         reverse = {}
 *         labels, counts = self.get_labels(values, reverse, 0)
 *         return reverse, labels, counts             # <<<<<<<<<<<<<<
 * 
 *     def get_labels(self, ndarray[int64_t] values, list uniques,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_reverse));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_reverse));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_reverse));
  __Pyx_INCREF(__pyx_v_labels);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_INCREF(__pyx_v_counts);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_counts);
  __Pyx_GIVEREF(__pyx_v_counts);
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_reverse);
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":442
 *         return reverse, labels, counts
 * 
 *     def get_labels(self, ndarray[int64_t] values, list uniques,             # <<<<<<<<<<<<<<
 *                    Py_ssize_t count_prior, Py_ssize_t na_sentinel):
 *         cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_13get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_13get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_uniques = 0;
  Py_ssize_t __pyx_v_count_prior;
  Py_ssize_t __pyx_v_na_sentinel;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__uniques,&__pyx_n_s__count_prior,&__pyx_n_s__na_sentinel,0};
  __Pyx_RefNannySetupContext("get_labels");
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uniques);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__count_prior);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__na_sentinel);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_labels") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_uniques = ((PyObject*)values[1]);
    __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_na_sentinel = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_na_sentinel == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), (&PyList_Type), 1, "uniques", 1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":445
 *                    Py_ssize_t count_prior, Py_ssize_t na_sentinel):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] labels
 *             ndarray[int64_t] counts
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":448
 *             ndarray[int64_t] labels
 *             ndarray[int64_t] counts
 *             Py_ssize_t idx, count = count_prior             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int64_t val
 */
  __pyx_v_count = __pyx_v_count_prior;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":449
 *             ndarray[int64_t] counts
 *             Py_ssize_t idx, count = count_prior
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int64_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":453
 *             khiter_t k
 * 
 *         labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         counts = np.empty(count_prior + n, dtype=np.int64)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
    __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":454
 * 
 *         labels = np.empty(n, dtype=np.int64)
 *         counts = np.empty(count_prior + n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_count_prior + __pyx_v_n)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":456
 *         counts = np.empty(count_prior + n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_1; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":457
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_values)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_14, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":458
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 */
    __pyx_v_k = kh_get_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":459
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 */
    __pyx_t_15 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":460
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]             # <<<<<<<<<<<<<<
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1
 */
      __pyx_v_idx = (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":461
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx             # <<<<<<<<<<<<<<
 *                 counts[idx] = counts[idx] + 1
 *             else:
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels) = __pyx_v_idx;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":462
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1             # <<<<<<<<<<<<<<
 *             else:
 *                 k = kh_put_int64(self.table, val, &ret)
 */
      __pyx_t_17 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts)) + 1);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":464
 *                 counts[idx] = counts[idx] + 1
 *             else:
 *                 k = kh_put_int64(self.table, val, &ret)             # <<<<<<<<<<<<<<
 *                 self.table.vals[k] = count
 *                 uniques.append(val)
 */
      __pyx_v_k = kh_put_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":465
 *             else:
 *                 k = kh_put_int64(self.table, val, &ret)
 *                 self.table.vals[k] = count             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 *                 labels[i] = count
 */
      (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":466
 *                 k = kh_put_int64(self.table, val, &ret)
 *                 self.table.vals[k] = count
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 *                 labels[i] = count
 *                 counts[count] = 1
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_5 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_19 = PyList_Append(__pyx_v_uniques, __pyx_t_5); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":467
 *                 self.table.vals[k] = count
 *                 uniques.append(val)
 *                 labels[i] = count             # <<<<<<<<<<<<<<
 *                 counts[count] = 1
 *                 count += 1
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_20, __pyx_bstride_0_labels) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":468
 *                 uniques.append(val)
 *                 labels[i] = count
 *                 counts[count] = 1             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      __pyx_t_21 = __pyx_v_count;
      __pyx_t_8 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_21, __pyx_bstride_0_counts) = 1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":469
 *                 labels[i] = count
 *                 counts[count] = 1
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         return labels, counts[:count].copy()
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":471
 *                 count += 1
 * 
 *         return labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 *     def get_labels_groupby(self, ndarray[int64_t] values, list uniques):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":473
 *         return labels, counts[:count].copy()
 * 
 *     def get_labels_groupby(self, ndarray[int64_t] values, list uniques):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_14get_labels_groupby(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_14get_labels_groupby(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_uniques = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__uniques,0};
  __Pyx_RefNannySetupContext("get_labels_groupby");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uniques);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels_groupby", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_labels_groupby") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_uniques = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_labels_groupby", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.get_labels_groupby", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), (&PyList_Type), 1, "uniques", 1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":475
 *     def get_labels_groupby(self, ndarray[int64_t] values, list uniques):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] labels
 *             Py_ssize_t idx, count = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":477
 *             Py_ssize_t i, n = len(values)
 *             ndarray[int64_t] labels
 *             Py_ssize_t idx, count = 0             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             int64_t val
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":478
 *             ndarray[int64_t] labels
 *             Py_ssize_t idx, count = 0
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             int64_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":482
 *             khiter_t k
 * 
 *         labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
    __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":484
 *         labels = np.empty(n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":485
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 *             # specific for groupby
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_values)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_13, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":488
 * 
 *             # specific for groupby
 *             if val < 0:             # <<<<<<<<<<<<<<
 *                 labels[i] = -1
 *                 continue
 */
    __pyx_t_14 = (__pyx_v_val < 0);
    if (__pyx_t_14) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":489
 *             # specific for groupby
 *             if val < 0:
 *                 labels[i] = -1             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_15, __pyx_bstride_0_labels) = -1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":490
 *             if val < 0:
 *                 labels[i] = -1
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             k = kh_get_int64(self.table, val)
 */
      goto __pyx_L6_continue;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":492
 *                 continue
 * 
 *             k = kh_get_int64(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 */
    __pyx_v_k = kh_get_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":493
 * 
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 */
    __pyx_t_14 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_14) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":494
 *             k = kh_get_int64(self.table, val)
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]             # <<<<<<<<<<<<<<
 *                 labels[i] = idx
 *             else:
 */
      __pyx_v_idx = (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":495
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx             # <<<<<<<<<<<<<<
 *             else:
 *                 k = kh_put_int64(self.table, val, &ret)
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels) = __pyx_v_idx;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":497
 *                 labels[i] = idx
 *             else:
 *                 k = kh_put_int64(self.table, val, &ret)             # <<<<<<<<<<<<<<
 *                 self.table.vals[k] = count
 *                 uniques.append(val)
 */
      __pyx_v_k = kh_put_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":498
 *             else:
 *                 k = kh_put_int64(self.table, val, &ret)
 *                 self.table.vals[k] = count             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 *                 labels[i] = count
 */
      (((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":499
 *                 k = kh_put_int64(self.table, val, &ret)
 *                 self.table.vals[k] = count
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 *                 labels[i] = count
 *                 count += 1
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_6 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_17 = PyList_Append(__pyx_v_uniques, __pyx_t_6); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":500
 *                 self.table.vals[k] = count
 *                 uniques.append(val)
 *                 labels[i] = count             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_18, __pyx_bstride_0_labels) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":501
 *                 uniques.append(val)
 *                 labels[i] = count
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         return labels
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L9:;
    __pyx_L6_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":503
 *                 count += 1
 * 
 *         return labels             # <<<<<<<<<<<<<<
 * 
 *     def unique(self, ndarray[int64_t] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  __pyx_r = ((PyObject *)__pyx_v_labels);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.get_labels_groupby", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":505
 *         return labels
 * 
 *     def unique(self, ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_15unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14Int64HashTable_15unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  PyArrayObject *__pyx_v_result = 0;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  struct __pyx_obj_6pandas_3lib_Int64Vector *__pyx_v_uniques = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":507
 *     def unique(self, ndarray[int64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             Py_ssize_t idx, count = 0
 *             int ret = 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":508
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = 0             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             ndarray result
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":509
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = 0
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             ndarray result
 *             int64_t val
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":513
 *             int64_t val
 *             khiter_t k
 *             Int64Vector uniques = Int64Vector()             # <<<<<<<<<<<<<<
 * 
 *         # TODO: kvec
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Int64Vector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_uniques = ((struct __pyx_obj_6pandas_3lib_Int64Vector *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":517
 *         # TODO: kvec
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":518
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_get_int64(self.table, val)
 *             if k == self.table.n_buckets:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":519
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)             # <<<<<<<<<<<<<<
 *             if k == self.table.n_buckets:
 *                 k = kh_put_int64(self.table, val, &ret)
 */
    __pyx_v_k = kh_get_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":520
 *             val = values[i]
 *             k = kh_get_int64(self.table, val)
 *             if k == self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 k = kh_put_int64(self.table, val, &ret)
 *                 uniques.append(val)
 */
    __pyx_t_6 = (__pyx_v_k == ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":521
 *             k = kh_get_int64(self.table, val)
 *             if k == self.table.n_buckets:
 *                 k = kh_put_int64(self.table, val, &ret)             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 *                 count += 1
 */
      __pyx_v_k = kh_put_int64(((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_self)->table, __pyx_v_val, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":522
 *             if k == self.table.n_buckets:
 *                 k = kh_put_int64(self.table, val, &ret)
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_Int64Vector *)__pyx_v_uniques->__pyx_vtab)->append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":523
 *                 k = kh_put_int64(self.table, val, &ret)
 *                 uniques.append(val)
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         result = np.array(uniques, copy=False)
 */
      __pyx_v_count = (__pyx_v_count + 1);
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":525
 *                 count += 1
 * 
 *         result = np.array(uniques, copy=False)             # <<<<<<<<<<<<<<
 *         result.base = <PyObject*> uniques
 *         Py_INCREF(uniques)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_uniques));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_uniques));
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  __pyx_t_9 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__copy), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":526
 * 
 *         result = np.array(uniques, copy=False)
 *         result.base = <PyObject*> uniques             # <<<<<<<<<<<<<<
 *         Py_INCREF(uniques)
 * 
 */
  __pyx_v_result->base = ((PyObject *)__pyx_v_uniques);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":527
 *         result = np.array(uniques, copy=False)
 *         result.base = <PyObject*> uniques
 *         Py_INCREF(uniques)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  Py_INCREF(((PyObject *)__pyx_v_uniques));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":529
 *         Py_INCREF(uniques)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * def value_count_int64(ndarray[int64_t] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64HashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_uniques);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":531
 *         return result
 * 
 * def value_count_int64(ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_29value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_29value_count_int64 = {__Pyx_NAMESTR("value_count_int64"), (PyCFunction)__pyx_pf_6pandas_3lib_29value_count_int64, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_29value_count_int64(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  kh_int64_t *__pyx_v_table;
  int __pyx_v_ret;
  PyObject *__pyx_v_uniques = 0;
  PyObject *__pyx_v_val = NULL;
  khint_t __pyx_v_k;
  PyObject *__pyx_v_result_keys = NULL;
  PyObject *__pyx_v_result_counts = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  __pyx_t_5numpy_int64_t __pyx_t_6;
  int __pyx_t_7;
  khint_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  khint_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value_count_int64");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":533
 * def value_count_int64(ndarray[int64_t] values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         kh_int64_t *table
 *         int ret = 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":535
 *         Py_ssize_t i, n = len(values)
 *         kh_int64_t *table
 *         int ret = 0             # <<<<<<<<<<<<<<
 *         list uniques = []
 * 
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":536
 *         kh_int64_t *table
 *         int ret = 0
 *         list uniques = []             # <<<<<<<<<<<<<<
 * 
 *     table = kh_init_int64()
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":538
 *         list uniques = []
 * 
 *     table = kh_init_int64()             # <<<<<<<<<<<<<<
 *     kh_resize_int64(table, n)
 * 
 */
  __pyx_v_table = kh_init_int64();

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":539
 * 
 *     table = kh_init_int64()
 *     kh_resize_int64(table, n)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  kh_resize_int64(__pyx_v_table, __pyx_v_n);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":541
 *     kh_resize_int64(table, n)
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = values[i]
 *         k = kh_get_int64(table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":542
 * 
 *     for i in range(n):
 *         val = values[i]             # <<<<<<<<<<<<<<
 *         k = kh_get_int64(table, val)
 *         if k != table.n_buckets:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":543
 *     for i in range(n):
 *         val = values[i]
 *         k = kh_get_int64(table, val)             # <<<<<<<<<<<<<<
 *         if k != table.n_buckets:
 *             table.vals[k] += 1
 */
    __pyx_t_6 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_k = kh_get_int64(__pyx_v_table, __pyx_t_6);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":544
 *         val = values[i]
 *         k = kh_get_int64(table, val)
 *         if k != table.n_buckets:             # <<<<<<<<<<<<<<
 *             table.vals[k] += 1
 *         else:
 */
    __pyx_t_7 = (__pyx_v_k != __pyx_v_table->n_buckets);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":545
 *         k = kh_get_int64(table, val)
 *         if k != table.n_buckets:
 *             table.vals[k] += 1             # <<<<<<<<<<<<<<
 *         else:
 *             k = kh_put_int64(table, val, &ret)
 */
      __pyx_t_8 = __pyx_v_k;
      (__pyx_v_table->vals[__pyx_t_8]) = ((__pyx_v_table->vals[__pyx_t_8]) + 1);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":547
 *             table.vals[k] += 1
 *         else:
 *             k = kh_put_int64(table, val, &ret)             # <<<<<<<<<<<<<<
 *             table.vals[k] = 1
 * 
 */
      __pyx_t_6 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_k = kh_put_int64(__pyx_v_table, __pyx_t_6, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":548
 *         else:
 *             k = kh_put_int64(table, val, &ret)
 *             table.vals[k] = 1             # <<<<<<<<<<<<<<
 * 
 *     # for (k = kh_begin(h); k != kh_end(h); ++k)
 */
      (__pyx_v_table->vals[__pyx_v_k]) = 1;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":552
 *     # for (k = kh_begin(h); k != kh_end(h); ++k)
 *     # 	if (kh_exist(h, k)) kh_value(h, k) = 1;
 *     i = 0             # <<<<<<<<<<<<<<
 *     result_keys = np.empty(table.n_occupied, dtype=np.int64)
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)
 */
  __pyx_v_i = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":553
 *     # 	if (kh_exist(h, k)) kh_value(h, k) = 1;
 *     i = 0
 *     result_keys = np.empty(table.n_occupied, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)
 *     for k in range(table.n_buckets):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_9, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_result_keys = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":554
 *     i = 0
 *     result_keys = np.empty(table.n_occupied, dtype=np.int64)
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     for k in range(table.n_buckets):
 *         if kh_exist_int64(table, k):
 */
  __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_table->n_occupied); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_12 = 0;
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_12));
  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__int64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__dtype), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
  __pyx_v_result_counts = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":555
 *     result_keys = np.empty(table.n_occupied, dtype=np.int64)
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)
 *     for k in range(table.n_buckets):             # <<<<<<<<<<<<<<
 *         if kh_exist_int64(table, k):
 *             result_keys[i] = table.keys[k]
 */
  __pyx_t_8 = __pyx_v_table->n_buckets;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_8; __pyx_t_13+=1) {
    __pyx_v_k = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":556
 *     result_counts = np.zeros(table.n_occupied, dtype=np.int64)
 *     for k in range(table.n_buckets):
 *         if kh_exist_int64(table, k):             # <<<<<<<<<<<<<<
 *             result_keys[i] = table.keys[k]
 *             result_counts[i] = table.vals[k]
 */
    __pyx_t_7 = kh_exist_int64(__pyx_v_table, __pyx_v_k);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":557
 *     for k in range(table.n_buckets):
 *         if kh_exist_int64(table, k):
 *             result_keys[i] = table.keys[k]             # <<<<<<<<<<<<<<
 *             result_counts[i] = table.vals[k]
 *             i += 1
 */
      __pyx_t_11 = __Pyx_PyInt_to_py_npy_int64((__pyx_v_table->keys[__pyx_v_k])); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_SetItemInt(__pyx_v_result_keys, __pyx_v_i, __pyx_t_11, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":558
 *         if kh_exist_int64(table, k):
 *             result_keys[i] = table.keys[k]
 *             result_counts[i] = table.vals[k]             # <<<<<<<<<<<<<<
 *             i += 1
 *     kh_destroy_int64(table)
 */
      __pyx_t_11 = PyInt_FromSsize_t((__pyx_v_table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (__Pyx_SetItemInt(__pyx_v_result_counts, __pyx_v_i, __pyx_t_11, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":559
 *             result_keys[i] = table.keys[k]
 *             result_counts[i] = table.vals[k]
 *             i += 1             # <<<<<<<<<<<<<<
 *     kh_destroy_int64(table)
 * 
 */
      __pyx_v_i = (__pyx_v_i + 1);
      goto __pyx_L10;
    }
    __pyx_L10:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":560
 *             result_counts[i] = table.vals[k]
 *             i += 1
 *     kh_destroy_int64(table)             # <<<<<<<<<<<<<<
 * 
 *     return result_keys, result_counts
 */
  kh_destroy_int64(__pyx_v_table);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":562
 *     kh_destroy_int64(table)
 * 
 *     return result_keys, result_counts             # <<<<<<<<<<<<<<
 * 
 * cdef class Float64HashTable(HashTable):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  __Pyx_INCREF(__pyx_v_result_keys);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_result_keys);
  __Pyx_GIVEREF(__pyx_v_result_keys);
  __Pyx_INCREF(__pyx_v_result_counts);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_result_counts);
  __Pyx_GIVEREF(__pyx_v_result_counts);
  __pyx_r = ((PyObject *)__pyx_t_11);
  __pyx_t_11 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.value_count_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_result_keys);
  __Pyx_XDECREF(__pyx_v_result_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":567
 *     cdef kh_float64_t *table
 * 
 *     def __init__(self, size_hint=1):             # <<<<<<<<<<<<<<
 *         if size_hint is not None:
 *             kh_resize_float64(self.table, size_hint)
 */

static int __pyx_pf_6pandas_3lib_16Float64HashTable___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_16Float64HashTable___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size_hint = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  khint_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size_hint,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":568
 * 
 *     def __init__(self, size_hint=1):
 *         if size_hint is not None:             # <<<<<<<<<<<<<<
 *             kh_resize_float64(self.table, size_hint)
 * 
 */
  __pyx_t_1 = (__pyx_v_size_hint != Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":569
 *     def __init__(self, size_hint=1):
 *         if size_hint is not None:
 *             kh_resize_float64(self.table, size_hint)             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
    __pyx_t_2 = __Pyx_PyInt_from_py_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_2 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    kh_resize_float64(((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table, __pyx_t_2);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":571
 *             kh_resize_float64(self.table, size_hint)
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = kh_init_float64()
 * 
 */

static int __pyx_pf_6pandas_3lib_16Float64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_16Float64HashTable_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":572
 * 
 *     def __cinit__(self):
 *         self.table = kh_init_float64()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  ((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table = kh_init_float64();

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":574
 *         self.table = kh_init_float64()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.table.size
 * 
 */

static Py_ssize_t __pyx_pf_6pandas_3lib_16Float64HashTable_2__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6pandas_3lib_16Float64HashTable_2__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":575
 * 
 *     def __len__(self):
 *         return self.table.size             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table->size;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":577
 *         return self.table.size
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         kh_destroy_float64(self.table)
 * 
 */

static void __pyx_pf_6pandas_3lib_16Float64HashTable_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pandas_3lib_16Float64HashTable_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":578
 * 
 *     def __dealloc__(self):
 *         kh_destroy_float64(self.table)             # <<<<<<<<<<<<<<
 * 
 *     def factorize(self, ndarray[float64_t] values):
 */
  kh_destroy_float64(((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table);

  __Pyx_RefNannyFinishContext();
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":580
 *         kh_destroy_float64(self.table)
 * 
 *     def factorize(self, ndarray[float64_t] values):             # <<<<<<<<<<<<<<
 *         uniques = []
 *         labels, counts = self.get_labels(values, uniques, 0, -1)
 */

static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_4factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_4factorize(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_uniques = NULL;
  PyObject *__pyx_v_labels = NULL;
  PyObject *__pyx_v_counts = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("factorize");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":581
 * 
 *     def factorize(self, ndarray[float64_t] values):
 *         uniques = []             # <<<<<<<<<<<<<<
 *         labels, counts = self.get_labels(values, uniques, 0, -1)
 *         return uniques, labels, counts
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_uniques = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":582
 *     def factorize(self, ndarray[float64_t] values):
 *         uniques = []
 *         labels, counts = self.get_labels(values, uniques, 0, -1)             # <<<<<<<<<<<<<<
 *         return uniques, labels, counts
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Float64HashTable *)((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->__pyx_vtab)->get_labels(((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self), ((PyArrayObject *)__pyx_v_values), __pyx_v_uniques, 0, -1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_labels = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_counts = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":583
 *         uniques = []
 *         labels, counts = self.get_labels(values, uniques, 0, -1)
 *         return uniques, labels, counts             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_labels(self, ndarray[float64_t] values, list uniques,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_uniques));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_uniques));
  __Pyx_INCREF(__pyx_v_labels);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_INCREF(__pyx_v_counts);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_counts);
  __Pyx_GIVEREF(__pyx_v_counts);
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":585
 *         return uniques, labels, counts
 * 
 *     cpdef get_labels(self, ndarray[float64_t] values, list uniques,             # <<<<<<<<<<<<<<
 *                      Py_ssize_t count_prior, int64_t na_sentinel):
 *         cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_5get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_16Float64HashTable_get_labels(struct __pyx_obj_6pandas_3lib_Float64HashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_labels");
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_16Float64HashTable_5get_labels)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_count_prior); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_na_sentinel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
      PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_uniques));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_uniques));
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":588
 *                      Py_ssize_t count_prior, int64_t na_sentinel):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] labels
 *             ndarray[int64_t] counts
 */
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_5;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":591
 *             ndarray[int64_t] labels
 *             ndarray[int64_t] counts
 *             Py_ssize_t idx, count = count_prior             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             float64_t val
 */
  __pyx_v_count = __pyx_v_count_prior;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":592
 *             ndarray[int64_t] counts
 *             Py_ssize_t idx, count = count_prior
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             float64_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":596
 *             khiter_t k
 * 
 *         labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         counts = np.empty(count_prior + n, dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
    __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":597
 * 
 *         labels = np.empty(n, dtype=np.int64)
 *         counts = np.empty(count_prior + n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_count_prior + __pyx_v_n)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":599
 *         counts = np.empty(count_prior + n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
  __pyx_t_5 = __pyx_v_n;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_5; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":600
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 *             if val != val:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_values)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_14, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":602
 *             val = values[i]
 * 
 *             if val != val:             # <<<<<<<<<<<<<<
 *                 labels[i] = na_sentinel
 *                 continue
 */
    __pyx_t_15 = (__pyx_v_val != __pyx_v_val);
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":603
 * 
 *             if val != val:
 *                 labels[i] = na_sentinel             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels) = __pyx_v_na_sentinel;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":604
 *             if val != val:
 *                 labels[i] = na_sentinel
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             k = kh_get_float64(self.table, val)
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":606
 *                 continue
 * 
 *             k = kh_get_float64(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 */
    __pyx_v_k = kh_get_float64(__pyx_v_self->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":607
 * 
 *             k = kh_get_float64(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 */
    __pyx_t_15 = (__pyx_v_k != __pyx_v_self->table->n_buckets);
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":608
 *             k = kh_get_float64(self.table, val)
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]             # <<<<<<<<<<<<<<
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1
 */
      __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]);

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":609
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx             # <<<<<<<<<<<<<<
 *                 counts[idx] = counts[idx] + 1
 *             else:
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_17, __pyx_bstride_0_labels) = __pyx_v_idx;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":610
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1             # <<<<<<<<<<<<<<
 *             else:
 *                 k = kh_put_float64(self.table, val, &ret)
 */
      __pyx_t_18 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_19 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_19, __pyx_bstride_0_counts) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts)) + 1);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":612
 *                 counts[idx] = counts[idx] + 1
 *             else:
 *                 k = kh_put_float64(self.table, val, &ret)             # <<<<<<<<<<<<<<
 *                 self.table.vals[k] = count
 *                 uniques.append(val)
 */
      __pyx_v_k = kh_put_float64(__pyx_v_self->table, __pyx_v_val, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":613
 *             else:
 *                 k = kh_put_float64(self.table, val, &ret)
 *                 self.table.vals[k] = count             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 *                 labels[i] = count
 */
      (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":614
 *                 k = kh_put_float64(self.table, val, &ret)
 *                 self.table.vals[k] = count
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 *                 labels[i] = count
 *                 counts[count] = 1
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_20 = PyList_Append(__pyx_v_uniques, __pyx_t_2); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":615
 *                 self.table.vals[k] = count
 *                 uniques.append(val)
 *                 labels[i] = count             # <<<<<<<<<<<<<<
 *                 counts[count] = 1
 *                 count += 1
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_21, __pyx_bstride_0_labels) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":616
 *                 uniques.append(val)
 *                 labels[i] = count
 *                 counts[count] = 1             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      __pyx_t_22 = __pyx_v_count;
      __pyx_t_8 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_22, __pyx_bstride_0_counts) = 1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":617
 *                 labels[i] = count
 *                 counts[count] = 1
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         return labels, counts[:count].copy()
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L6:;
    __pyx_L3_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":619
 *                 count += 1
 * 
 *         return labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 *     def map_locations(self, ndarray[float64_t] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":585
 *         return uniques, labels, counts
 * 
 *     cpdef get_labels(self, ndarray[float64_t] values, list uniques,             # <<<<<<<<<<<<<<
 *                      Py_ssize_t count_prior, int64_t na_sentinel):
 *         cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_5get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_5get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_uniques = 0;
  Py_ssize_t __pyx_v_count_prior;
  __pyx_t_5numpy_int64_t __pyx_v_na_sentinel;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__uniques,&__pyx_n_s__count_prior,&__pyx_n_s__na_sentinel,0};
  __Pyx_RefNannySetupContext("get_labels");
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uniques);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__count_prior);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__na_sentinel);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_labels") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_uniques = ((PyObject*)values[1]);
    __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_na_sentinel = __Pyx_PyInt_from_py_npy_int64(values[3]); if (unlikely((__pyx_v_na_sentinel == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), (&PyList_Type), 1, "uniques", 1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Float64HashTable *)((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->__pyx_vtab)->get_labels(((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self), __pyx_v_values, __pyx_v_uniques, __pyx_v_count_prior, __pyx_v_na_sentinel, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":621
 *         return labels, counts[:count].copy()
 * 
 *     def map_locations(self, ndarray[float64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_6map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_6map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_locations");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":623
 *     def map_locations(self, ndarray[float64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             khiter_t k
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":624
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             khiter_t k
 * 
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":627
 *             khiter_t k
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             k = kh_put_float64(self.table, values[i], &ret)
 *             self.table.vals[k] = i
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":628
 * 
 *         for i in range(n):
 *             k = kh_put_float64(self.table, values[i], &ret)             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = i
 * 
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_values)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_k = kh_put_float64(((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table, (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_3, __pyx_bstride_0_values)), (&__pyx_v_ret));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":629
 *         for i in range(n):
 *             k = kh_put_float64(self.table, values[i], &ret)
 *             self.table.vals[k] = i             # <<<<<<<<<<<<<<
 * 
 *     def lookup(self, ndarray[float64_t] values):
 */
    (((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = __pyx_v_i;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":631
 *             self.table.vals[k] = i
 * 
 *     def lookup(self, ndarray[float64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_7lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_7lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  PyArrayObject *__pyx_v_locs = 0;
  Py_buffer __pyx_bstruct_locs;
  Py_ssize_t __pyx_bstride_0_locs = 0;
  Py_ssize_t __pyx_bshape_0_locs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup");
  __pyx_bstruct_locs.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":633
 *     def lookup(self, ndarray[float64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             float64_t val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":634
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             float64_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":637
 *             float64_t val
 *             khiter_t k
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_locs, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_locs.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_locs = __pyx_bstruct_locs.strides[0];
      __pyx_bshape_0_locs = __pyx_bstruct_locs.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":639
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             k = kh_get_float64(self.table, val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":640
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             k = kh_get_float64(self.table, val)
 *             if k != self.table.n_buckets:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":641
 *         for i in range(n):
 *             val = values[i]
 *             k = kh_get_float64(self.table, val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]
 */
    __pyx_v_k = kh_get_float64(((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":642
 *             val = values[i]
 *             k = kh_get_float64(self.table, val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 locs[i] = self.table.vals[k]
 *             else:
 */
    __pyx_t_11 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_11) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":643
 *             k = kh_get_float64(self.table, val)
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]             # <<<<<<<<<<<<<<
 *             else:
 *                 locs[i] = -1
 */
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_locs.buf, __pyx_t_12, __pyx_bstride_0_locs) = (((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":645
 *                 locs[i] = self.table.vals[k]
 *             else:
 *                 locs[i] = -1             # <<<<<<<<<<<<<<
 * 
 *         return locs
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_locs.buf, __pyx_t_13, __pyx_bstride_0_locs) = -1;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":647
 *                 locs[i] = -1
 * 
 *         return locs             # <<<<<<<<<<<<<<
 * 
 *     def unique(self, ndarray[float64_t] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_locs));
  __pyx_r = ((PyObject *)__pyx_v_locs);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":649
 *         return locs
 * 
 *     def unique(self, ndarray[float64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_8unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16Float64HashTable_8unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  PyObject *__pyx_v_uniques = 0;
  int __pyx_v_seen_na;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":651
 *     def unique(self, ndarray[float64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             Py_ssize_t idx, count = 0
 *             int ret = 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":652
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = 0             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             float64_t val
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":653
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = 0
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             float64_t val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":656
 *             float64_t val
 *             khiter_t k
 *             list uniques = []             # <<<<<<<<<<<<<<
 *             bint seen_na = 0
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":657
 *             khiter_t k
 *             list uniques = []
 *             bint seen_na = 0             # <<<<<<<<<<<<<<
 * 
 *         # TODO: kvec
 */
  __pyx_v_seen_na = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":661
 *         # TODO: kvec
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":662
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 *             if val == val:
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":664
 *             val = values[i]
 * 
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 k = kh_get_float64(self.table, val)
 *                 if k == self.table.n_buckets:
 */
    __pyx_t_6 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":665
 * 
 *             if val == val:
 *                 k = kh_get_float64(self.table, val)             # <<<<<<<<<<<<<<
 *                 if k == self.table.n_buckets:
 *                     k = kh_put_float64(self.table, val, &ret)
 */
      __pyx_v_k = kh_get_float64(((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table, __pyx_v_val);

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":666
 *             if val == val:
 *                 k = kh_get_float64(self.table, val)
 *                 if k == self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                     k = kh_put_float64(self.table, val, &ret)
 *                     uniques.append(val)
 */
      __pyx_t_6 = (__pyx_v_k == ((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table->n_buckets);
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":667
 *                 k = kh_get_float64(self.table, val)
 *                 if k == self.table.n_buckets:
 *                     k = kh_put_float64(self.table, val, &ret)             # <<<<<<<<<<<<<<
 *                     uniques.append(val)
 *                     count += 1
 */
        __pyx_v_k = kh_put_float64(((struct __pyx_obj_6pandas_3lib_Float64HashTable *)__pyx_v_self)->table, __pyx_v_val, (&__pyx_v_ret));

        /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":668
 *                 if k == self.table.n_buckets:
 *                     k = kh_put_float64(self.table, val, &ret)
 *                     uniques.append(val)             # <<<<<<<<<<<<<<
 *                     count += 1
 *             elif not seen_na:
 */
        if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
        }
        __pyx_t_2 = PyFloat_FromDouble(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = PyList_Append(__pyx_v_uniques, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":669
 *                     k = kh_put_float64(self.table, val, &ret)
 *                     uniques.append(val)
 *                     count += 1             # <<<<<<<<<<<<<<
 *             elif not seen_na:
 *                 seen_na = 1
 */
        __pyx_v_count = (__pyx_v_count + 1);
        goto __pyx_L8;
      }
      __pyx_L8:;
      goto __pyx_L7;
    }

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":670
 *                     uniques.append(val)
 *                     count += 1
 *             elif not seen_na:             # <<<<<<<<<<<<<<
 *                 seen_na = 1
 *                 uniques.append(ONAN)
 */
    __pyx_t_6 = (!__pyx_v_seen_na);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":671
 *                     count += 1
 *             elif not seen_na:
 *                 seen_na = 1             # <<<<<<<<<<<<<<
 *                 uniques.append(ONAN)
 * 
 */
      __pyx_v_seen_na = 1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":672
 *             elif not seen_na:
 *                 seen_na = 1
 *                 uniques.append(ONAN)             # <<<<<<<<<<<<<<
 * 
 *         return uniques
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ONAN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyList_Append(__pyx_v_uniques, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":674
 *                 uniques.append(ONAN)
 * 
 *         return uniques             # <<<<<<<<<<<<<<
 * 
 * cdef class PyObjectHashTable(HashTable):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  __pyx_r = ((PyObject *)__pyx_v_uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Float64HashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":679
 *     cdef kh_pymap_t *table
 * 
 *     def __init__(self, size_hint=1):             # <<<<<<<<<<<<<<
 *         self.table = kh_init_pymap()
 *         kh_resize_pymap(self.table, size_hint)
 */

static int __pyx_pf_6pandas_3lib_17PyObjectHashTable___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_17PyObjectHashTable___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size_hint = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  khint_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size_hint,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size_hint);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":680
 * 
 *     def __init__(self, size_hint=1):
 *         self.table = kh_init_pymap()             # <<<<<<<<<<<<<<
 *         kh_resize_pymap(self.table, size_hint)
 * 
 */
  ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table = kh_init_pymap();

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":681
 *     def __init__(self, size_hint=1):
 *         self.table = kh_init_pymap()
 *         kh_resize_pymap(self.table, size_hint)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = __Pyx_PyInt_from_py_npy_uint32(__pyx_v_size_hint); if (unlikely((__pyx_t_1 == (khint_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  kh_resize_pymap(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table, __pyx_t_1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":683
 *         kh_resize_pymap(self.table, size_hint)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.table is not NULL:
 *             self.destroy()
 */

static void __pyx_pf_6pandas_3lib_17PyObjectHashTable_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pandas_3lib_17PyObjectHashTable_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":684
 * 
 *     def __dealloc__(self):
 *         if self.table is not NULL:             # <<<<<<<<<<<<<<
 *             self.destroy()
 * 
 */
  __pyx_t_1 = (((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table != NULL);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":685
 *     def __dealloc__(self):
 *         if self.table is not NULL:
 *             self.destroy()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable *)((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->__pyx_vtab)->destroy(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":687
 *             self.destroy()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.table.size
 * 
 */

static Py_ssize_t __pyx_pf_6pandas_3lib_17PyObjectHashTable_2__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6pandas_3lib_17PyObjectHashTable_2__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":688
 * 
 *     def __len__(self):
 *         return self.table.size             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, object key):
 */
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table->size;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":690
 *         return self.table.size
 * 
 *     def __contains__(self, object key):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         hash(key)
 */

static int __pyx_pf_6pandas_3lib_17PyObjectHashTable_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pf_6pandas_3lib_17PyObjectHashTable_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  khiter_t __pyx_v_k;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_hash_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__contains__");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":692
 *     def __contains__(self, object key):
 *         cdef khiter_t k
 *         hash(key)             # <<<<<<<<<<<<<<
 *         k = kh_get_pymap(self.table, <PyObject*>key)
 *         return k != self.table.n_buckets
 */
  __pyx_t_1 = PyObject_Hash(__pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":693
 *         cdef khiter_t k
 *         hash(key)
 *         k = kh_get_pymap(self.table, <PyObject*>key)             # <<<<<<<<<<<<<<
 *         return k != self.table.n_buckets
 * 
 */
  __pyx_v_k = kh_get_pymap(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table, ((PyObject *)__pyx_v_key));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":694
 *         hash(key)
 *         k = kh_get_pymap(self.table, <PyObject*>key)
 *         return k != self.table.n_buckets             # <<<<<<<<<<<<<<
 * 
 *     cpdef destroy(self):
 */
  __pyx_r = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table->n_buckets);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":696
 *         return k != self.table.n_buckets
 * 
 *     cpdef destroy(self):             # <<<<<<<<<<<<<<
 *         kh_destroy_pymap(self.table)
 *         self.table = NULL
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_4destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_17PyObjectHashTable_destroy(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroy");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__destroy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_17PyObjectHashTable_4destroy)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":697
 * 
 *     cpdef destroy(self):
 *         kh_destroy_pymap(self.table)             # <<<<<<<<<<<<<<
 *         self.table = NULL
 * 
 */
  kh_destroy_pymap(__pyx_v_self->table);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":698
 *     cpdef destroy(self):
 *         kh_destroy_pymap(self.table)
 *         self.table = NULL             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_item(self, object val):
 */
  __pyx_v_self->table = NULL;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":696
 *         return k != self.table.n_buckets
 * 
 *     cpdef destroy(self):             # <<<<<<<<<<<<<<
 *         kh_destroy_pymap(self.table)
 *         self.table = NULL
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_4destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_4destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroy");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable *)((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->__pyx_vtab)->destroy(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":700
 *         self.table = NULL
 * 
 *     cpdef get_item(self, object val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_pymap(self.table, <PyObject*>val)
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_17PyObjectHashTable_get_item(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) {
  khiter_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_17PyObjectHashTable_5get_item)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":702
 *     cpdef get_item(self, object val):
 *         cdef khiter_t k
 *         k = kh_get_pymap(self.table, <PyObject*>val)             # <<<<<<<<<<<<<<
 *         if k != self.table.n_buckets:
 *             return self.table.vals[k]
 */
  __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":703
 *         cdef khiter_t k
 *         k = kh_get_pymap(self.table, <PyObject*>val)
 *         if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *             return self.table.vals[k]
 *         else:
 */
  __pyx_t_4 = (__pyx_v_k != __pyx_v_self->table->n_buckets);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":704
 *         k = kh_get_pymap(self.table, <PyObject*>val)
 *         if k != self.table.n_buckets:
 *             return self.table.vals[k]             # <<<<<<<<<<<<<<
 *         else:
 *             raise KeyError(val)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_self->table->vals[__pyx_v_k])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":706
 *             return self.table.vals[k]
 *         else:
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 * 
 *     def get_iter_test(self, object key, Py_ssize_t iterations):
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":700
 *         self.table = NULL
 * 
 *     cpdef get_item(self, object val):             # <<<<<<<<<<<<<<
 *         cdef khiter_t k
 *         k = kh_get_pymap(self.table, <PyObject*>val)
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_5get_item(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable *)((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->__pyx_vtab)->get_item(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.get_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":708
 *             raise KeyError(val)
 * 
 *     def get_iter_test(self, object key, Py_ssize_t iterations):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i, val
 *         for i in range(iterations):
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_6get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_6get_iter_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  Py_ssize_t __pyx_v_iterations;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_val;
  khint_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__iterations,0};
  __Pyx_RefNannySetupContext("get_iter_test");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iterations);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_iter_test") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = values[0];
    __pyx_v_iterations = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_iterations == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_iter_test", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.get_iter_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":710
 *     def get_iter_test(self, object key, Py_ssize_t iterations):
 *         cdef Py_ssize_t i, val
 *         for i in range(iterations):             # <<<<<<<<<<<<<<
 *             k = kh_get_pymap(self.table, <PyObject*>key)
 *             if k != self.table.n_buckets:
 */
  __pyx_t_1 = __pyx_v_iterations;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":711
 *         cdef Py_ssize_t i, val
 *         for i in range(iterations):
 *             k = kh_get_pymap(self.table, <PyObject*>key)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 val = self.table.vals[k]
 */
    __pyx_v_k = kh_get_pymap(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table, ((PyObject *)__pyx_v_key));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":712
 *         for i in range(iterations):
 *             k = kh_get_pymap(self.table, <PyObject*>key)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 val = self.table.vals[k]
 * 
 */
    __pyx_t_3 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":713
 *             k = kh_get_pymap(self.table, <PyObject*>key)
 *             if k != self.table.n_buckets:
 *                 val = self.table.vals[k]             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_item(self, object key, Py_ssize_t val):
 */
      __pyx_v_val = (((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":715
 *                 val = self.table.vals[k]
 * 
 *     cpdef set_item(self, object key, Py_ssize_t val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             khiter_t k
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_17PyObjectHashTable_set_item(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *__pyx_v_self, PyObject *__pyx_v_key, Py_ssize_t __pyx_v_val, int __pyx_skip_dispatch) {
  khiter_t __pyx_v_k;
  int __pyx_v_ret;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_hash_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_item");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_item); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_17PyObjectHashTable_7set_item)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":718
 *         cdef:
 *             khiter_t k
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             char* buf
 * 
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":721
 *             char* buf
 * 
 *         hash(key)             # <<<<<<<<<<<<<<
 *         k = kh_put_pymap(self.table, <PyObject*>key, &ret)
 *         # self.table.keys[k] = key
 */
  __pyx_t_4 = PyObject_Hash(__pyx_v_key); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":722
 * 
 *         hash(key)
 *         k = kh_put_pymap(self.table, <PyObject*>key, &ret)             # <<<<<<<<<<<<<<
 *         # self.table.keys[k] = key
 *         if kh_exist_pymap(self.table, k):
 */
  __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_key), (&__pyx_v_ret));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":724
 *         k = kh_put_pymap(self.table, <PyObject*>key, &ret)
 *         # self.table.keys[k] = key
 *         if kh_exist_pymap(self.table, k):             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = val
 *         else:
 */
  __pyx_t_5 = kh_exist_pymap(__pyx_v_self->table, __pyx_v_k);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":725
 *         # self.table.keys[k] = key
 *         if kh_exist_pymap(self.table, k):
 *             self.table.vals[k] = val             # <<<<<<<<<<<<<<
 *         else:
 *             raise KeyError(key)
 */
    (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_val;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":727
 *             self.table.vals[k] = val
 *         else:
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *     def map_locations(self, ndarray[object] values):
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    __pyx_t_2 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":715
 *                 val = self.table.vals[k]
 * 
 *     cpdef set_item(self, object key, Py_ssize_t val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             khiter_t k
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_7set_item(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  Py_ssize_t __pyx_v_val;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__val,0};
  __Pyx_RefNannySetupContext("set_item");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_item") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_key = values[0];
    __pyx_v_val = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_val == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_item", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable *)((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->__pyx_vtab)->set_item(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self), __pyx_v_key, __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.set_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":729
 *             raise KeyError(key)
 * 
 *     def map_locations(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_8map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_8map_locations(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  PyObject *__pyx_v_val = 0;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  Py_hash_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("map_locations");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":731
 *     def map_locations(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             object val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":732
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             object val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":736
 *             khiter_t k
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             hash(val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":737
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             hash(val)
 *             k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":738
 *         for i in range(n):
 *             val = values[i]
 *             hash(val)             # <<<<<<<<<<<<<<
 *             k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 *             self.table.vals[k] = i
 */
    __pyx_t_6 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":739
 *             val = values[i]
 *             hash(val)
 *             k = kh_put_pymap(self.table, <PyObject*>val, &ret)             # <<<<<<<<<<<<<<
 *             self.table.vals[k] = i
 * 
 */
    __pyx_v_k = kh_put_pymap(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":740
 *             hash(val)
 *             k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 *             self.table.vals[k] = i             # <<<<<<<<<<<<<<
 * 
 *     def lookup(self, ndarray[object] values):
 */
    (((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table->vals[__pyx_v_k]) = __pyx_v_i;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.map_locations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":742
 *             self.table.vals[k] = i
 * 
 *     def lookup(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_9lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_9lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  PyObject *__pyx_v_val = 0;
  khiter_t __pyx_v_k;
  PyArrayObject *__pyx_v_locs = 0;
  Py_buffer __pyx_bstruct_locs;
  Py_ssize_t __pyx_bstride_0_locs = 0;
  Py_ssize_t __pyx_bshape_0_locs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_hash_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup");
  __pyx_bstruct_locs.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":744
 *     def lookup(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             object val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":745
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             object val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":748
 *             object val
 *             khiter_t k
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_locs, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_locs.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_locs = __pyx_bstruct_locs.strides[0];
      __pyx_bshape_0_locs = __pyx_bstruct_locs.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":750
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             hash(val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":751
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             hash(val)
 *             k = kh_get_pymap(self.table, <PyObject*>val)
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":752
 *         for i in range(n):
 *             val = values[i]
 *             hash(val)             # <<<<<<<<<<<<<<
 *             k = kh_get_pymap(self.table, <PyObject*>val)
 *             if k != self.table.n_buckets:
 */
    __pyx_t_11 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":753
 *             val = values[i]
 *             hash(val)
 *             k = kh_get_pymap(self.table, <PyObject*>val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]
 */
    __pyx_v_k = kh_get_pymap(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table, ((PyObject *)__pyx_v_val));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":754
 *             hash(val)
 *             k = kh_get_pymap(self.table, <PyObject*>val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 locs[i] = self.table.vals[k]
 *             else:
 */
    __pyx_t_12 = (__pyx_v_k != ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table->n_buckets);
    if (__pyx_t_12) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":755
 *             k = kh_get_pymap(self.table, <PyObject*>val)
 *             if k != self.table.n_buckets:
 *                 locs[i] = self.table.vals[k]             # <<<<<<<<<<<<<<
 *             else:
 *                 locs[i] = -1
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_locs.buf, __pyx_t_13, __pyx_bstride_0_locs) = (((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table->vals[__pyx_v_k]);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":757
 *                 locs[i] = self.table.vals[k]
 *             else:
 *                 locs[i] = -1             # <<<<<<<<<<<<<<
 * 
 *         return locs
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_0_locs;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_locs)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_locs.buf, __pyx_t_14, __pyx_bstride_0_locs) = -1;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":759
 *                 locs[i] = -1
 * 
 *         return locs             # <<<<<<<<<<<<<<
 * 
 *     def lookup2(self, ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_locs));
  __pyx_r = ((PyObject *)__pyx_v_locs);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":761
 *         return locs
 * 
 *     def lookup2(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_10lookup2(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_10lookup2(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  PyArrayObject *__pyx_v_locs = 0;
  Py_buffer __pyx_bstruct_locs;
  Py_ssize_t __pyx_bstride_0_locs = 0;
  Py_ssize_t __pyx_bshape_0_locs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup2");
  __pyx_bstruct_locs.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":763
 *     def lookup2(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             object val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":764
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             object val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":768
 *             khiter_t k
 *             long hval
 *             ndarray[int64_t] locs = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         # for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_locs, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_locs.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_locs = __pyx_bstruct_locs.strides[0];
      __pyx_bshape_0_locs = __pyx_bstruct_locs.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":775
 *             # k = kh_get_pymap(self.table, <PyObject*>val)
 * 
 *         return locs             # <<<<<<<<<<<<<<
 * 
 *     def unique(self, ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_locs));
  __pyx_r = ((PyObject *)__pyx_v_locs);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.lookup2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":777
 *         return locs
 * 
 *     def unique(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_11unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_11unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_result = 0;
  khiter_t __pyx_v_k;
  struct __pyx_obj_6pandas_3lib_ObjectVector *__pyx_v_uniques = 0;
  int __pyx_v_seen_na;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  Py_hash_t __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":779
 *     def unique(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             Py_ssize_t idx, count = 0
 *             int ret = 0
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":780
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = 0             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             object val
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":781
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = 0
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             object val
 *             ndarray result
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":785
 *             ndarray result
 *             khiter_t k
 *             ObjectVector uniques = ObjectVector()             # <<<<<<<<<<<<<<
 *             bint seen_na = 0
 * 
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_ObjectVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_uniques = ((struct __pyx_obj_6pandas_3lib_ObjectVector *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":786
 *             khiter_t k
 *             ObjectVector uniques = ObjectVector()
 *             bint seen_na = 0             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_v_seen_na = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":788
 *             bint seen_na = 0
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             hash(val)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":789
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             hash(val)
 *             if not _checknan(val):
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":790
 *         for i in range(n):
 *             val = values[i]
 *             hash(val)             # <<<<<<<<<<<<<<
 *             if not _checknan(val):
 *                 k = kh_get_pymap(self.table, <PyObject*>val)
 */
    __pyx_t_6 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":791
 *             val = values[i]
 *             hash(val)
 *             if not _checknan(val):             # <<<<<<<<<<<<<<
 *                 k = kh_get_pymap(self.table, <PyObject*>val)
 *                 if k == self.table.n_buckets:
 */
    __pyx_t_7 = (!__pyx_f_4util__checknan(__pyx_v_val));
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":792
 *             hash(val)
 *             if not _checknan(val):
 *                 k = kh_get_pymap(self.table, <PyObject*>val)             # <<<<<<<<<<<<<<
 *                 if k == self.table.n_buckets:
 *                     k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 */
      __pyx_v_k = kh_get_pymap(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table, ((PyObject *)__pyx_v_val));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":793
 *             if not _checknan(val):
 *                 k = kh_get_pymap(self.table, <PyObject*>val)
 *                 if k == self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                     k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 *                     uniques.append(val)
 */
      __pyx_t_7 = (__pyx_v_k == ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table->n_buckets);
      if (__pyx_t_7) {

        /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":794
 *                 k = kh_get_pymap(self.table, <PyObject*>val)
 *                 if k == self.table.n_buckets:
 *                     k = kh_put_pymap(self.table, <PyObject*>val, &ret)             # <<<<<<<<<<<<<<
 *                     uniques.append(val)
 *             elif not seen_na:
 */
        __pyx_v_k = kh_put_pymap(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret));

        /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":795
 *                 if k == self.table.n_buckets:
 *                     k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 *                     uniques.append(val)             # <<<<<<<<<<<<<<
 *             elif not seen_na:
 *                 seen_na = 1
 */
        __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_ObjectVector *)__pyx_v_uniques->__pyx_vtab)->append(__pyx_v_uniques, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L8;
      }
      __pyx_L8:;
      goto __pyx_L7;
    }

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":796
 *                     k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 *                     uniques.append(val)
 *             elif not seen_na:             # <<<<<<<<<<<<<<
 *                 seen_na = 1
 *                 uniques.append(ONAN)
 */
    __pyx_t_7 = (!__pyx_v_seen_na);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":797
 *                     uniques.append(val)
 *             elif not seen_na:
 *                 seen_na = 1             # <<<<<<<<<<<<<<
 *                 uniques.append(ONAN)
 * 
 */
      __pyx_v_seen_na = 1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":798
 *             elif not seen_na:
 *                 seen_na = 1
 *                 uniques.append(ONAN)             # <<<<<<<<<<<<<<
 * 
 *         result = np.array(uniques, copy=False)
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ONAN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = ((struct __pyx_vtabstruct_6pandas_3lib_ObjectVector *)__pyx_v_uniques->__pyx_vtab)->append(__pyx_v_uniques, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":800
 *                 uniques.append(ONAN)
 * 
 *         result = np.array(uniques, copy=False)             # <<<<<<<<<<<<<<
 *         result.base = <PyObject*> uniques
 *         Py_INCREF(uniques)
 */
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_uniques));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_uniques));
  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
  __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__copy), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":801
 * 
 *         result = np.array(uniques, copy=False)
 *         result.base = <PyObject*> uniques             # <<<<<<<<<<<<<<
 *         Py_INCREF(uniques)
 * 
 */
  __pyx_v_result->base = ((PyObject *)__pyx_v_uniques);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":802
 *         result = np.array(uniques, copy=False)
 *         result.base = <PyObject*> uniques
 *         Py_INCREF(uniques)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  Py_INCREF(((PyObject *)__pyx_v_uniques));

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":804
 *         Py_INCREF(uniques)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_labels(self, ndarray[object] values, list uniques,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_uniques);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":806
 *         return result
 * 
 *     cpdef get_labels(self, ndarray[object] values, list uniques,             # <<<<<<<<<<<<<<
 *                      Py_ssize_t count_prior, int64_t na_sentinel):
 *         cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_12get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_17PyObjectHashTable_get_labels(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *__pyx_v_self, PyArrayObject *__pyx_v_values, PyObject *__pyx_v_uniques, Py_ssize_t __pyx_v_count_prior, __pyx_t_5numpy_int64_t __pyx_v_na_sentinel, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  PyObject *__pyx_v_val = 0;
  khiter_t __pyx_v_k;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_hash_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_labels");
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_17PyObjectHashTable_12get_labels)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_count_prior); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_na_sentinel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_INCREF(((PyObject *)__pyx_v_values));
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
      __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
      PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_uniques));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_uniques));
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_2 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":809
 *                      Py_ssize_t count_prior, int64_t na_sentinel):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] labels
 *             ndarray[int64_t] counts
 */
  __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_5;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":812
 *             ndarray[int64_t] labels
 *             ndarray[int64_t] counts
 *             Py_ssize_t idx, count = count_prior             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             object val
 */
  __pyx_v_count = __pyx_v_count_prior;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":813
 *             ndarray[int64_t] counts
 *             Py_ssize_t idx, count = count_prior
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             object val
 *             khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":817
 *             khiter_t k
 * 
 *         labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         counts = np.empty(count_prior + n, dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
    __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":818
 * 
 *         labels = np.empty(n, dtype=np.int64)
 *         counts = np.empty(count_prior + n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_count_prior + __pyx_v_n)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":820
 *         counts = np.empty(count_prior + n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             hash(val)
 */
  __pyx_t_5 = __pyx_v_n;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_5; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":821
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             hash(val)
 * 
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_values)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_14, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":822
 *         for i in range(n):
 *             val = values[i]
 *             hash(val)             # <<<<<<<<<<<<<<
 * 
 *             if val != val or val is None:
 */
    __pyx_t_15 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":824
 *             hash(val)
 * 
 *             if val != val or val is None:             # <<<<<<<<<<<<<<
 *                 labels[i] = na_sentinel
 *                 continue
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_16) {
      __pyx_t_17 = (__pyx_v_val == Py_None);
      __pyx_t_18 = __pyx_t_17;
    } else {
      __pyx_t_18 = __pyx_t_16;
    }
    if (__pyx_t_18) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":825
 * 
 *             if val != val or val is None:
 *                 labels[i] = na_sentinel             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_19, __pyx_bstride_0_labels) = __pyx_v_na_sentinel;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":826
 *             if val != val or val is None:
 *                 labels[i] = na_sentinel
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             k = kh_get_pymap(self.table, <PyObject*>val)
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":828
 *                 continue
 * 
 *             k = kh_get_pymap(self.table, <PyObject*>val)             # <<<<<<<<<<<<<<
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 */
    __pyx_v_k = kh_get_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":829
 * 
 *             k = kh_get_pymap(self.table, <PyObject*>val)
 *             if k != self.table.n_buckets:             # <<<<<<<<<<<<<<
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 */
    __pyx_t_18 = (__pyx_v_k != __pyx_v_self->table->n_buckets);
    if (__pyx_t_18) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":830
 *             k = kh_get_pymap(self.table, <PyObject*>val)
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]             # <<<<<<<<<<<<<<
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1
 */
      __pyx_v_idx = (__pyx_v_self->table->vals[__pyx_v_k]);

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":831
 *             if k != self.table.n_buckets:
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx             # <<<<<<<<<<<<<<
 *                 counts[idx] = counts[idx] + 1
 *             else:
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_20, __pyx_bstride_0_labels) = __pyx_v_idx;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":832
 *                 idx = self.table.vals[k]
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1             # <<<<<<<<<<<<<<
 *             else:
 *                 k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 */
      __pyx_t_21 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_22 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_22, __pyx_bstride_0_counts) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_21, __pyx_bstride_0_counts)) + 1);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":834
 *                 counts[idx] = counts[idx] + 1
 *             else:
 *                 k = kh_put_pymap(self.table, <PyObject*>val, &ret)             # <<<<<<<<<<<<<<
 *                 self.table.vals[k] = count
 *                 uniques.append(val)
 */
      __pyx_v_k = kh_put_pymap(__pyx_v_self->table, ((PyObject *)__pyx_v_val), (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":835
 *             else:
 *                 k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 *                 self.table.vals[k] = count             # <<<<<<<<<<<<<<
 *                 uniques.append(val)
 *                 labels[i] = count
 */
      (__pyx_v_self->table->vals[__pyx_v_k]) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":836
 *                 k = kh_put_pymap(self.table, <PyObject*>val, &ret)
 *                 self.table.vals[k] = count
 *                 uniques.append(val)             # <<<<<<<<<<<<<<
 *                 labels[i] = count
 *                 counts[count] = 1
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_23 = PyList_Append(__pyx_v_uniques, __pyx_v_val); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":837
 *                 self.table.vals[k] = count
 *                 uniques.append(val)
 *                 labels[i] = count             # <<<<<<<<<<<<<<
 *                 counts[count] = 1
 *                 count += 1
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_24, __pyx_bstride_0_labels) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":838
 *                 uniques.append(val)
 *                 labels[i] = count
 *                 counts[count] = 1             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      __pyx_t_25 = __pyx_v_count;
      __pyx_t_8 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_25, __pyx_bstride_0_counts) = 1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":839
 *                 labels[i] = count
 *                 counts[count] = 1
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         return labels, counts[:count].copy()
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L6:;
    __pyx_L3_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":841
 *                 count += 1
 * 
 *         return labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":806
 *         return result
 * 
 *     cpdef get_labels(self, ndarray[object] values, list uniques,             # <<<<<<<<<<<<<<
 *                      Py_ssize_t count_prior, int64_t na_sentinel):
 *         cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_12get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17PyObjectHashTable_12get_labels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_uniques = 0;
  Py_ssize_t __pyx_v_count_prior;
  __pyx_t_5numpy_int64_t __pyx_v_na_sentinel;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__uniques,&__pyx_n_s__count_prior,&__pyx_n_s__na_sentinel,0};
  __Pyx_RefNannySetupContext("get_labels");
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uniques);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__count_prior);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 2); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__na_sentinel);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, 3); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_labels") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_uniques = ((PyObject*)values[1]);
    __pyx_v_count_prior = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_count_prior == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_na_sentinel = __Pyx_PyInt_from_py_npy_int64(values[3]); if (unlikely((__pyx_v_na_sentinel == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_labels", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uniques), (&PyList_Type), 1, "uniques", 1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable *)((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self)->__pyx_vtab)->get_labels(((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_self), __pyx_v_values, __pyx_v_uniques, __pyx_v_count_prior, __pyx_v_na_sentinel, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.PyObjectHashTable.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":849
 *     cdef public Py_ssize_t count
 * 
 *     def __init__(self, size_hint):             # <<<<<<<<<<<<<<
 *         self.table = PyObjectHashTable(size_hint)
 *         self.uniques = []
 */

static int __pyx_pf_6pandas_3lib_10Factorizer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_10Factorizer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size_hint = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size_hint,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size_hint);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_size_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":850
 * 
 *     def __init__(self, size_hint):
 *         self.table = PyObjectHashTable(size_hint)             # <<<<<<<<<<<<<<
 *         self.uniques = []
 *         self.count = 0
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_size_hint);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size_hint);
  __Pyx_GIVEREF(__pyx_v_size_hint);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_PyObjectHashTable)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table));
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table = ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":851
 *     def __init__(self, size_hint):
 *         self.table = PyObjectHashTable(size_hint)
 *         self.uniques = []             # <<<<<<<<<<<<<<
 *         self.count = 0
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":852
 *         self.table = PyObjectHashTable(size_hint)
 *         self.uniques = []
 *         self.count = 0             # <<<<<<<<<<<<<<
 * 
 *     def get_count(self):
 */
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->count = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":854
 *         self.count = 0
 * 
 *     def get_count(self):             # <<<<<<<<<<<<<<
 *         return self.count
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_1get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_1get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_count");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":855
 * 
 *     def get_count(self):
 *         return self.count             # <<<<<<<<<<<<<<
 * 
 *     def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Factorizer.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":857
 *         return self.count
 * 
 *     def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1):             # <<<<<<<<<<<<<<
 *         labels, counts = self.table.get_labels(values, self.uniques,
 *                                                self.count, na_sentinel)
 */

static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_2factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_2factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_sort = 0;
  PyObject *__pyx_v_na_sentinel = 0;
  PyObject *__pyx_v_labels = NULL;
  PyObject *__pyx_v_counts = NULL;
  PyObject *__pyx_v_sorter = NULL;
  PyObject *__pyx_v_reverse_indexer = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__sort,&__pyx_n_s__na_sentinel,0};
  __Pyx_RefNannySetupContext("factorize");
  {
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k_9;
    values[2] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sort);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__na_sentinel);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "factorize") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_sort = values[1];
    __pyx_v_na_sentinel = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("factorize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":858
 * 
 *     def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1):
 *         labels, counts = self.table.get_labels(values, self.uniques,             # <<<<<<<<<<<<<<
 *                                                self.count, na_sentinel)
 * 
 */
  if (!(likely(PyList_CheckExact(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques))||((((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques;
  __Pyx_INCREF(__pyx_t_1);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":859
 *     def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1):
 *         labels, counts = self.table.get_labels(values, self.uniques,
 *                                                self.count, na_sentinel)             # <<<<<<<<<<<<<<
 * 
 *         # sort on
 */
  __pyx_t_2 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_na_sentinel); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable *)((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table->__pyx_vtab)->get_labels(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table, ((PyArrayObject *)__pyx_v_values), ((PyObject*)__pyx_t_1), ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->count, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":858
 * 
 *     def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1):
 *         labels, counts = self.table.get_labels(values, self.uniques,             # <<<<<<<<<<<<<<
 *                                                self.count, na_sentinel)
 * 
 */
  __pyx_v_labels = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_counts = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":862
 * 
 *         # sort on
 *         if sort:             # <<<<<<<<<<<<<<
 *             if labels.dtype != np.int_:
 *                 labels = labels.astype(np.int_)
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_7) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":863
 *         # sort on
 *         if sort:
 *             if labels.dtype != np.int_:             # <<<<<<<<<<<<<<
 *                 labels = labels.astype(np.int_)
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_labels, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":864
 *         if sort:
 *             if labels.dtype != np.int_:
 *                 labels = labels.astype(np.int_)             # <<<<<<<<<<<<<<
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_labels, __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_v_labels);
      __pyx_v_labels = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":866
 *                 labels = labels.astype(np.int_)
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()             # <<<<<<<<<<<<<<
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
    __Pyx_GIVEREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_sorter = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":867
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)             # <<<<<<<<<<<<<<
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int_); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_reverse_indexer = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":868
 *             sorter = list_to_object_array(self.uniques).argsort()
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))             # <<<<<<<<<<<<<<
 * 
 *             labels = reverse_indexer.take(labels)
 */
    __pyx_t_9 = PyObject_GetAttr(__pyx_v_reverse_indexer, __pyx_n_s__put); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sorter);
    __Pyx_GIVEREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":870
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 * 
 *             labels = reverse_indexer.take(labels)             # <<<<<<<<<<<<<<
 *             counts = counts.take(sorter)
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_reverse_indexer, __pyx_n_s__take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_labels);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_labels);
    __Pyx_GIVEREF(__pyx_v_labels);
    __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_labels);
    __pyx_v_labels = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":871
 * 
 *             labels = reverse_indexer.take(labels)
 *             counts = counts.take(sorter)             # <<<<<<<<<<<<<<
 * 
 *         self.count = len(counts)
 */
    __pyx_t_9 = PyObject_GetAttr(__pyx_v_counts, __pyx_n_s__take); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sorter);
    __Pyx_GIVEREF(__pyx_v_sorter);
    __pyx_t_4 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_counts);
    __pyx_v_counts = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":873
 *             counts = counts.take(sorter)
 * 
 *         self.count = len(counts)             # <<<<<<<<<<<<<<
 *         return labels, counts
 * 
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_counts); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->count = __pyx_t_8;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":874
 * 
 *         self.count = len(counts)
 *         return labels, counts             # <<<<<<<<<<<<<<
 * 
 *     def unique(self, ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(__pyx_v_labels);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_INCREF(__pyx_v_counts);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_counts);
  __Pyx_GIVEREF(__pyx_v_counts);
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_sorter);
  __Pyx_XDECREF(__pyx_v_reverse_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":876
 *         return labels, counts
 * 
 *     def unique(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         # just for fun
 *         return self.table.unique(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_3unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_3unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":878
 *     def unique(self, ndarray[object] values):
 *         # just for fun
 *         return self.table.unique(values)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table), __pyx_n_s__unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Factorizer.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":845
 * 
 * cdef class Factorizer:
 *     cdef public PyObjectHashTable table             # <<<<<<<<<<<<<<
 *     cdef public uniques
 *     cdef public Py_ssize_t count
 */

static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_5table___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_5table___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_10Factorizer_5table_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_10Factorizer_5table_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_3lib_PyObjectHashTable))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table));
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table = ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Factorizer.table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_10Factorizer_5table_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_10Factorizer_5table_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table));
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->table = ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":846
 * cdef class Factorizer:
 *     cdef public PyObjectHashTable table
 *     cdef public uniques             # <<<<<<<<<<<<<<
 *     cdef public Py_ssize_t count
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_7uniques___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_7uniques___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_10Factorizer_7uniques_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_10Factorizer_7uniques_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_10Factorizer_7uniques_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_10Factorizer_7uniques_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques);
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->uniques = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":847
 *     cdef public PyObjectHashTable table
 *     cdef public uniques
 *     cdef public Py_ssize_t count             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, size_hint):
 */

static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_5count___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10Factorizer_5count___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Factorizer.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_10Factorizer_5count_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_10Factorizer_5count_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_Factorizer *)__pyx_v_self)->count = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Factorizer.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":886
 *     cdef public Py_ssize_t count
 * 
 *     def __init__(self, size_hint):             # <<<<<<<<<<<<<<
 *         self.table = Int64HashTable(size_hint)
 *         self.uniques = []
 */

static int __pyx_pf_6pandas_3lib_15Int64Factorizer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_15Int64Factorizer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_size_hint = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size_hint,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size_hint);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_size_hint = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":887
 * 
 *     def __init__(self, size_hint):
 *         self.table = Int64HashTable(size_hint)             # <<<<<<<<<<<<<<
 *         self.uniques = []
 *         self.count = 0
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_size_hint);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size_hint);
  __Pyx_GIVEREF(__pyx_v_size_hint);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Int64HashTable)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table));
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table = ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":888
 *     def __init__(self, size_hint):
 *         self.table = Int64HashTable(size_hint)
 *         self.uniques = []             # <<<<<<<<<<<<<<
 *         self.count = 0
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":889
 *         self.table = Int64HashTable(size_hint)
 *         self.uniques = []
 *         self.count = 0             # <<<<<<<<<<<<<<
 * 
 *     def get_count(self):
 */
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->count = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":891
 *         self.count = 0
 * 
 *     def get_count(self):             # <<<<<<<<<<<<<<
 *         return self.count
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_1get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_1get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_count");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":892
 * 
 *     def get_count(self):
 *         return self.count             # <<<<<<<<<<<<<<
 * 
 *     def factorize(self, ndarray[int64_t] values, sort=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":894
 *         return self.count
 * 
 *     def factorize(self, ndarray[int64_t] values, sort=False,             # <<<<<<<<<<<<<<
 *                   na_sentinel=-1):
 *         labels, counts = self.table.get_labels(values, self.uniques,
 */

static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_2factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_2factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_sort = 0;
  PyObject *__pyx_v_na_sentinel = 0;
  PyObject *__pyx_v_labels = NULL;
  PyObject *__pyx_v_counts = NULL;
  PyObject *__pyx_v_sorter = NULL;
  PyObject *__pyx_v_reverse_indexer = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__sort,&__pyx_n_s__na_sentinel,0};
  __Pyx_RefNannySetupContext("factorize");
  {
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_k_11;
    values[2] = ((PyObject *)__pyx_int_neg_1);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sort);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__na_sentinel);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "factorize") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_sort = values[1];
    __pyx_v_na_sentinel = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("factorize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":896
 *     def factorize(self, ndarray[int64_t] values, sort=False,
 *                   na_sentinel=-1):
 *         labels, counts = self.table.get_labels(values, self.uniques,             # <<<<<<<<<<<<<<
 *                                                self.count, na_sentinel)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table), __pyx_n_s__get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":897
 *                   na_sentinel=-1):
 *         labels, counts = self.table.get_labels(values, self.uniques,
 *                                                self.count, na_sentinel)             # <<<<<<<<<<<<<<
 * 
 *         # sort on
 */
  __pyx_t_2 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
  __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_na_sentinel);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_na_sentinel);
  __Pyx_GIVEREF(__pyx_v_na_sentinel);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":896
 *     def factorize(self, ndarray[int64_t] values, sort=False,
 *                   na_sentinel=-1):
 *         labels, counts = self.table.get_labels(values, self.uniques,             # <<<<<<<<<<<<<<
 *                                                self.count, na_sentinel)
 * 
 */
  __pyx_v_labels = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_counts = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":900
 * 
 *         # sort on
 *         if sort:             # <<<<<<<<<<<<<<
 *             if labels.dtype != np.int_:
 *                 labels = labels.astype(np.int_)
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":901
 *         # sort on
 *         if sort:
 *             if labels.dtype != np.int_:             # <<<<<<<<<<<<<<
 *                 labels = labels.astype(np.int_)
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_labels, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":902
 *         if sort:
 *             if labels.dtype != np.int_:
 *                 labels = labels.astype(np.int_)             # <<<<<<<<<<<<<<
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_labels, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_labels);
      __pyx_v_labels = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":904
 *                 labels = labels.astype(np.int_)
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()             # <<<<<<<<<<<<<<
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
    __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__argsort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_sorter = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":905
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)             # <<<<<<<<<<<<<<
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int_); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_reverse_indexer = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":906
 *             sorter = list_to_object_array(self.uniques).argsort()
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))             # <<<<<<<<<<<<<<
 * 
 *             labels = reverse_indexer.take(labels)
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_reverse_indexer, __pyx_n_s__put); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sorter);
    __Pyx_GIVEREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":908
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 * 
 *             labels = reverse_indexer.take(labels)             # <<<<<<<<<<<<<<
 *             counts = counts.take(sorter)
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_reverse_indexer, __pyx_n_s__take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_labels);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_labels);
    __Pyx_GIVEREF(__pyx_v_labels);
    __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_labels);
    __pyx_v_labels = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":909
 * 
 *             labels = reverse_indexer.take(labels)
 *             counts = counts.take(sorter)             # <<<<<<<<<<<<<<
 * 
 *         self.count = len(counts)
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_counts, __pyx_n_s__take); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sorter);
    __Pyx_GIVEREF(__pyx_v_sorter);
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_counts);
    __pyx_v_counts = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":911
 *             counts = counts.take(sorter)
 * 
 *         self.count = len(counts)             # <<<<<<<<<<<<<<
 *         return labels, counts
 * 
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_counts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->count = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":912
 * 
 *         self.count = len(counts)
 *         return labels, counts             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_labels);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_INCREF(__pyx_v_counts);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_counts);
  __Pyx_GIVEREF(__pyx_v_counts);
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_sorter);
  __Pyx_XDECREF(__pyx_v_reverse_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":882
 * 
 * cdef class Int64Factorizer:
 *     cdef public Int64HashTable table             # <<<<<<<<<<<<<<
 *     cdef public list uniques
 *     cdef public Py_ssize_t count
 */

static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_5table___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_5table___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_15Int64Factorizer_5table_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_15Int64Factorizer_5table_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pandas_3lib_Int64HashTable))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table));
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table = ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_15Int64Factorizer_5table_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_15Int64Factorizer_5table_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table));
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->table = ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":883
 * cdef class Int64Factorizer:
 *     cdef public Int64HashTable table
 *     cdef public list uniques             # <<<<<<<<<<<<<<
 *     cdef public Py_ssize_t count
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.uniques.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques));
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->uniques = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":884
 *     cdef public Int64HashTable table
 *     cdef public list uniques
 *     cdef public Py_ssize_t count             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, size_hint):
 */

static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_5count___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_15Int64Factorizer_5count___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_15Int64Factorizer_5count_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_15Int64Factorizer_5count_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)__pyx_v_self)->count = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Int64Factorizer.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":922
 *         Py_ssize_t count
 * 
 *     def __init__(self, table=None, uniques=None):             # <<<<<<<<<<<<<<
 *         if table is None:
 *             self.table = {}
 */

static int __pyx_pf_6pandas_3lib_14DictFactorizer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_14DictFactorizer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_uniques = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__table,&__pyx_n_s__uniques,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__table);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uniques);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_table = values[0];
    __pyx_v_uniques = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":923
 * 
 *     def __init__(self, table=None, uniques=None):
 *         if table is None:             # <<<<<<<<<<<<<<
 *             self.table = {}
 *         else:
 */
  __pyx_t_1 = (__pyx_v_table == Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":924
 *     def __init__(self, table=None, uniques=None):
 *         if table is None:
 *             self.table = {}             # <<<<<<<<<<<<<<
 *         else:
 *             self.table = table
 */
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table));
    ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":926
 *             self.table = {}
 *         else:
 *             self.table = table             # <<<<<<<<<<<<<<
 * 
 *         if uniques is None:
 */
    if (!(likely(PyDict_CheckExact(__pyx_v_table))||((__pyx_v_table) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_table)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_table);
    __Pyx_GIVEREF(__pyx_v_table);
    __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table));
    ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table = ((PyObject*)__pyx_v_table);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":928
 *             self.table = table
 * 
 *         if uniques is None:             # <<<<<<<<<<<<<<
 *             self.uniques = []
 *             self.count = 0
 */
  __pyx_t_1 = (__pyx_v_uniques == Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":929
 * 
 *         if uniques is None:
 *             self.uniques = []             # <<<<<<<<<<<<<<
 *             self.count = 0
 *         else:
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
    ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":930
 *         if uniques is None:
 *             self.uniques = []
 *             self.count = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self.uniques = uniques
 */
    ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count = 0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":932
 *             self.count = 0
 *         else:
 *             self.uniques = uniques             # <<<<<<<<<<<<<<
 *             self.count = len(uniques)
 * 
 */
    if (!(likely(PyList_CheckExact(__pyx_v_uniques))||((__pyx_v_uniques) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_uniques)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_uniques);
    __Pyx_GIVEREF(__pyx_v_uniques);
    __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
    ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques = ((PyObject*)__pyx_v_uniques);

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":933
 *         else:
 *             self.uniques = uniques
 *             self.count = len(uniques)             # <<<<<<<<<<<<<<
 * 
 *     def get_count(self):
 */
    __pyx_t_3 = PyObject_Length(__pyx_v_uniques); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count = __pyx_t_3;
  }
  __pyx_L7:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":935
 *             self.count = len(uniques)
 * 
 *     def get_count(self):             # <<<<<<<<<<<<<<
 *         return self.count
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_1get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_1get_count(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_count");

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":936
 * 
 *     def get_count(self):
 *         return self.count             # <<<<<<<<<<<<<<
 * 
 *     def get_labels(self, ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.get_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":938
 *         return self.count
 * 
 *     def get_labels(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_2get_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_2get_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  Py_ssize_t __pyx_v_idx;
  Py_ssize_t __pyx_v_count;
  int __pyx_v_ret;
  PyObject *__pyx_v_val = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_labels");
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":940
 *     def get_labels(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             ndarray[int64_t] labels
 *             ndarray[int64_t] counts
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":943
 *             ndarray[int64_t] labels
 *             ndarray[int64_t] counts
 *             Py_ssize_t idx, count = self.count             # <<<<<<<<<<<<<<
 *             int ret = 0
 *             object val
 */
  __pyx_v_count = ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":944
 *             ndarray[int64_t] counts
 *             Py_ssize_t idx, count = self.count
 *             int ret = 0             # <<<<<<<<<<<<<<
 *             object val
 * 
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":947
 *             object val
 * 
 *         labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         counts = np.empty(count + n, dtype=np.int64)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
    __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":948
 * 
 *         labels = np.empty(n, dtype=np.int64)
 *         counts = np.empty(count + n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_count + __pyx_v_n)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":950
 *         counts = np.empty(count + n, dtype=np.int64)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_1; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":951
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 * 
 *             if val in self.table:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_values)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_14, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":953
 *             val = values[i]
 * 
 *             if val in self.table:             # <<<<<<<<<<<<<<
 *                 idx = self.table[val]
 *                 labels[i] = idx
 */
    if (unlikely(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_15 = ((PyDict_Contains(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table), __pyx_v_val))); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":954
 * 
 *             if val in self.table:
 *                 idx = self.table[val]             # <<<<<<<<<<<<<<
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1
 */
      __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table), __pyx_v_val); if (!__pyx_t_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_idx = __pyx_t_16;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":955
 *             if val in self.table:
 *                 idx = self.table[val]
 *                 labels[i] = idx             # <<<<<<<<<<<<<<
 *                 counts[idx] = counts[idx] + 1
 *             else:
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels) = __pyx_v_idx;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":956
 *                 idx = self.table[val]
 *                 labels[i] = idx
 *                 counts[idx] = counts[idx] + 1             # <<<<<<<<<<<<<<
 *             else:
 *                 self.table[val] = count
 */
      __pyx_t_17 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = __pyx_v_idx;
      __pyx_t_8 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts)) + 1);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":958
 *                 counts[idx] = counts[idx] + 1
 *             else:
 *                 self.table[val] = count             # <<<<<<<<<<<<<<
 *                 self.uniques.append(val)
 *                 labels[i] = count
 */
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table), __pyx_v_val, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":959
 *             else:
 *                 self.table[val] = count
 *                 self.uniques.append(val)             # <<<<<<<<<<<<<<
 *                 labels[i] = count
 *                 counts[count] = 1
 */
      if (unlikely(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_19 = PyList_Append(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques, __pyx_v_val); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":960
 *                 self.table[val] = count
 *                 self.uniques.append(val)
 *                 labels[i] = count             # <<<<<<<<<<<<<<
 *                 counts[count] = 1
 *                 count += 1
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_20, __pyx_bstride_0_labels) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":961
 *                 self.uniques.append(val)
 *                 labels[i] = count
 *                 counts[count] = 1             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      __pyx_t_21 = __pyx_v_count;
      __pyx_t_8 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_21, __pyx_bstride_0_counts) = 1;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":962
 *                 labels[i] = count
 *                 counts[count] = 1
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *         return labels, counts[:count].copy()
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":964
 *                 count += 1
 * 
 *         return labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 *     def factorize(self, ndarray[object] values, sort=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.get_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":966
 *         return labels, counts[:count].copy()
 * 
 *     def factorize(self, ndarray[object] values, sort=False):             # <<<<<<<<<<<<<<
 *         labels, counts = self.get_labels(values)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_3factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_3factorize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_sort = 0;
  PyObject *__pyx_v_labels = NULL;
  PyObject *__pyx_v_counts = NULL;
  PyObject *__pyx_v_sorter = NULL;
  PyObject *__pyx_v_reverse_indexer = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__sort,0};
  __Pyx_RefNannySetupContext("factorize");
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_12;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sort);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "factorize") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_sort = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("factorize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":967
 * 
 *     def factorize(self, ndarray[object] values, sort=False):
 *         labels, counts = self.get_labels(values)             # <<<<<<<<<<<<<<
 * 
 *         # sort on
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[4]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_v_labels = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_counts = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":970
 * 
 *         # sort on
 *         if sort:             # <<<<<<<<<<<<<<
 *             if labels.dtype != np.int_:
 *                 labels = labels.astype(np.int_)
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":971
 *         # sort on
 *         if sort:
 *             if labels.dtype != np.int_:             # <<<<<<<<<<<<<<
 *                 labels = labels.astype(np.int_)
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_labels, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":972
 *         if sort:
 *             if labels.dtype != np.int_:
 *                 labels = labels.astype(np.int_)             # <<<<<<<<<<<<<<
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_labels, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_labels);
      __pyx_v_labels = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":974
 *                 labels = labels.astype(np.int_)
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()             # <<<<<<<<<<<<<<
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
    __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_sorter = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":975
 * 
 *             sorter = list_to_object_array(self.uniques).argsort()
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)             # <<<<<<<<<<<<<<
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int_); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_reverse_indexer = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":976
 *             sorter = list_to_object_array(self.uniques).argsort()
 *             reverse_indexer = np.empty(len(sorter), dtype=np.int_)
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))             # <<<<<<<<<<<<<<
 * 
 *             labels = reverse_indexer.take(labels)
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_reverse_indexer, __pyx_n_s__put); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sorter);
    __Pyx_GIVEREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":978
 *             reverse_indexer.put(sorter, np.arange(len(sorter)))
 * 
 *             labels = reverse_indexer.take(labels)             # <<<<<<<<<<<<<<
 *             counts = counts.take(sorter)
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_reverse_indexer, __pyx_n_s__take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_labels);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_labels);
    __Pyx_GIVEREF(__pyx_v_labels);
    __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_labels);
    __pyx_v_labels = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":979
 * 
 *             labels = reverse_indexer.take(labels)
 *             counts = counts.take(sorter)             # <<<<<<<<<<<<<<
 * 
 *         self.count = len(counts)
 */
    __pyx_t_8 = PyObject_GetAttr(__pyx_v_counts, __pyx_n_s__take); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_sorter);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sorter);
    __Pyx_GIVEREF(__pyx_v_sorter);
    __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_counts);
    __pyx_v_counts = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":981
 *             counts = counts.take(sorter)
 * 
 *         self.count = len(counts)             # <<<<<<<<<<<<<<
 *         return labels, counts
 * 
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_counts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":982
 * 
 *         self.count = len(counts)
 *         return labels, counts             # <<<<<<<<<<<<<<
 * 
 *     def unique(self, ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_labels);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_INCREF(__pyx_v_counts);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_counts);
  __Pyx_GIVEREF(__pyx_v_counts);
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.factorize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_sorter);
  __Pyx_XDECREF(__pyx_v_reverse_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":984
 *         return labels, counts
 * 
 *     def unique(self, ndarray[object] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_4unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_4unique(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_count;
  PyObject *__pyx_v_val = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":986
 *     def unique(self, ndarray[object] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             Py_ssize_t idx, count = self.count
 *             object val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":987
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = self.count             # <<<<<<<<<<<<<<
 *             object val
 * 
 */
  __pyx_v_count = ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":990
 *             object val
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             if val not in self.table:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":991
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             if val not in self.table:
 *                 self.table[val] = count
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":992
 *         for i in range(n):
 *             val = values[i]
 *             if val not in self.table:             # <<<<<<<<<<<<<<
 *                 self.table[val] = count
 *                 self.uniques.append(val)
 */
    if (unlikely(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_6 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table), __pyx_v_val))); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":993
 *             val = values[i]
 *             if val not in self.table:
 *                 self.table[val] = count             # <<<<<<<<<<<<<<
 *                 self.uniques.append(val)
 *                 count += 1
 */
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table), __pyx_v_val, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":994
 *             if val not in self.table:
 *                 self.table[val] = count
 *                 self.uniques.append(val)             # <<<<<<<<<<<<<<
 *                 count += 1
 *         return self.uniques
 */
      if (unlikely(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_7 = PyList_Append(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques, __pyx_v_val); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":995
 *                 self.table[val] = count
 *                 self.uniques.append(val)
 *                 count += 1             # <<<<<<<<<<<<<<
 *         return self.uniques
 * 
 */
      __pyx_v_count = (__pyx_v_count + 1);
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":996
 *                 self.uniques.append(val)
 *                 count += 1
 *         return self.uniques             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":999
 * 
 * 
 *     def unique_int64(self, ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_5unique_int64(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_5unique_int64(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_count;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique_int64");
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1001
 *     def unique_int64(self, ndarray[int64_t] values):
 *         cdef:
 *             Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *             Py_ssize_t idx, count = self.count
 *             int64_t val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1002
 *         cdef:
 *             Py_ssize_t i, n = len(values)
 *             Py_ssize_t idx, count = self.count             # <<<<<<<<<<<<<<
 *             int64_t val
 * 
 */
  __pyx_v_count = ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1005
 *             int64_t val
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             if val not in self.table:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1006
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             if val not in self.table:
 *                 self.table[val] = count
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_values)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_3, __pyx_bstride_0_values));

    /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1007
 *         for i in range(n):
 *             val = values[i]
 *             if val not in self.table:             # <<<<<<<<<<<<<<
 *                 self.table[val] = count
 *                 self.uniques.append(val)
 */
    __pyx_t_5 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_6 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table), __pyx_t_5))); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1008
 *             val = values[i]
 *             if val not in self.table:
 *                 self.table[val] = count             # <<<<<<<<<<<<<<
 *                 self.uniques.append(val)
 *                 count += 1
 */
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemInt(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table), __pyx_v_val, __pyx_t_5, sizeof(__pyx_t_5numpy_int64_t), __Pyx_PyInt_to_py_npy_int64) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1009
 *             if val not in self.table:
 *                 self.table[val] = count
 *                 self.uniques.append(val)             # <<<<<<<<<<<<<<
 *                 count += 1
 *         return self.uniques
 */
      if (unlikely(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_5 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyList_Append(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1010
 *                 self.table[val] = count
 *                 self.uniques.append(val)
 *                 count += 1             # <<<<<<<<<<<<<<
 *         return self.uniques
 * 
 */
      __pyx_v_count = (__pyx_v_count + 1);
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1011
 *                 self.uniques.append(val)
 *                 count += 1
 *         return self.uniques             # <<<<<<<<<<<<<<
 * 
 * def lookup2(ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.unique_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":918
 * 
 *     cdef public:
 *         dict table             # <<<<<<<<<<<<<<
 *         list uniques
 *         Py_ssize_t count
 */

static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_5table___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_5table___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_14DictFactorizer_5table_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_14DictFactorizer_5table_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table));
  ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.table.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_14DictFactorizer_5table_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_14DictFactorizer_5table_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table));
  ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->table = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":919
 *     cdef public:
 *         dict table
 *         list uniques             # <<<<<<<<<<<<<<
 *         Py_ssize_t count
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_7uniques___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_7uniques___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_14DictFactorizer_7uniques_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_14DictFactorizer_7uniques_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
  ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.uniques.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_14DictFactorizer_7uniques_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_14DictFactorizer_7uniques_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques));
  ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->uniques = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":920
 *         dict table
 *         list uniques
 *         Py_ssize_t count             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, table=None, uniques=None):
 */

static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_5count___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DictFactorizer_5count___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.count.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_14DictFactorizer_5count_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_14DictFactorizer_5count_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)__pyx_v_self)->count = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.DictFactorizer.count.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1013
 *         return self.uniques
 * 
 * def lookup2(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_30lookup2(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_30lookup2 = {__Pyx_NAMESTR("lookup2"), (PyCFunction)__pyx_pf_6pandas_3lib_30lookup2, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_30lookup2(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_n;
  int __pyx_v_ret;
  PyArrayObject *__pyx_v_locs = 0;
  Py_buffer __pyx_bstruct_locs;
  Py_ssize_t __pyx_bstride_0_locs = 0;
  Py_ssize_t __pyx_bshape_0_locs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lookup2");
  __pyx_self = __pyx_self;
  __pyx_bstruct_locs.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1015
 * def lookup2(ndarray[object] values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         int ret = 0
 *         object val
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1016
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 *         int ret = 0             # <<<<<<<<<<<<<<
 *         object val
 *         khiter_t k
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1020
 *         khiter_t k
 *         long hval
 *         ndarray[int64_t] locs = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     # for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_locs, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_locs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_locs.buf = NULL;
      {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_locs = __pyx_bstruct_locs.strides[0];
      __pyx_bshape_0_locs = __pyx_bstruct_locs.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_locs = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1027
 *         # k = kh_get_pymap(self.table, <PyObject*>val)
 * 
 *     return locs             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_locs));
  __pyx_r = ((PyObject *)__pyx_v_locs);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.lookup2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_locs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_locs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":34
 *     basestring = str
 * 
 * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(arr)
 */

static PyObject *__pyx_pf_6pandas_3lib_31ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_31ints_to_pydatetime = {__Pyx_NAMESTR("ints_to_pydatetime"), (PyCFunction)__pyx_pf_6pandas_3lib_31ints_to_pydatetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_31ints_to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_tz = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  pandas_datetimestruct __pyx_v_dts;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_trans = NULL;
  PyObject *__pyx_v_deltas = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_inf = NULL;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  PyObject **__pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  npy_datetime __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__tz,0};
  __Pyx_RefNannySetupContext("ints_to_pydatetime");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "ints_to_pydatetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ints_to_pydatetime", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":36
 * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None):
 *     cdef:
 *         Py_ssize_t i, n = len(arr)             # <<<<<<<<<<<<<<
 *         pandas_datetimestruct dts
 *         ndarray[object] result = np.empty(n, dtype=object)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":38
 *         Py_ssize_t i, n = len(arr)
 *         pandas_datetimestruct dts
 *         ndarray[object] result = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     if tz is not None:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_result.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
      __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":40
 *         ndarray[object] result = np.empty(n, dtype=object)
 * 
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         if tz is pytz.utc:
 *             for i in range(n):
 */
  __pyx_t_7 = (__pyx_v_tz != Py_None);
  if (__pyx_t_7) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":41
 * 
 *     if tz is not None:
 *         if tz is pytz.utc:             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__utc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (__pyx_v_tz == __pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":42
 *     if tz is not None:
 *         if tz is pytz.utc:
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 */
      __pyx_t_1 = __pyx_v_n;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":43
 *         if tz is pytz.utc:
 *             for i in range(n):
 *                 pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 *                                      dts.min, dts.sec, dts.us, tz)
 */
        __pyx_t_9 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_9 < 0) {
          __pyx_t_9 += __pyx_bshape_0_arr;
          if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_arr)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_arr.buf, __pyx_t_9, __pyx_bstride_0_arr)), PANDAS_FR_ns, (&__pyx_v_dts));

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":44
 *             for i in range(n):
 *                 pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,             # <<<<<<<<<<<<<<
 *                                      dts.min, dts.sec, dts.us, tz)
 *         else:
 */
        __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":45
 *                 pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 *                                      dts.min, dts.sec, dts.us, tz)             # <<<<<<<<<<<<<<
 *         else:
 *             trans = _get_transitions(tz)
 */
        __pyx_t_11 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_14));
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_v_tz);
        PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_v_tz);
        __Pyx_GIVEREF(__pyx_v_tz);
        __pyx_t_2 = 0;
        __pyx_t_5 = 0;
        __pyx_t_4 = 0;
        __pyx_t_3 = 0;
        __pyx_t_11 = 0;
        __pyx_t_12 = 0;
        __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":44
 *             for i in range(n):
 *                 pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,             # <<<<<<<<<<<<<<
 *                                      dts.min, dts.sec, dts.us, tz)
 *         else:
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_bshape_0_result;
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_15, __pyx_bstride_0_result);
        __Pyx_GOTREF(*__pyx_t_16);
        __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_t_13);
        *__pyx_t_16 = __pyx_t_13;
        __Pyx_GIVEREF(*__pyx_t_16);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":47
 *                                      dts.min, dts.sec, dts.us, tz)
 *         else:
 *             trans = _get_transitions(tz)             # <<<<<<<<<<<<<<
 *             deltas = _get_deltas(tz)
 *             for i in range(n):
 */
      __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_transitions); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_INCREF(__pyx_v_tz);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_tz);
      __Pyx_GIVEREF(__pyx_v_tz);
      __pyx_t_12 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_v_trans = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":48
 *         else:
 *             trans = _get_transitions(tz)
 *             deltas = _get_deltas(tz)             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 # Adjust datetime64 timestamp, recompute datetimestruct
 */
      __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_deltas); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_INCREF(__pyx_v_tz);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_tz);
      __Pyx_GIVEREF(__pyx_v_tz);
      __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_v_deltas = __pyx_t_13;
      __pyx_t_13 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":49
 *             trans = _get_transitions(tz)
 *             deltas = _get_deltas(tz)
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 # Adjust datetime64 timestamp, recompute datetimestruct
 *                 pos = trans.searchsorted(arr[i]) - 1
 */
      __pyx_t_1 = __pyx_v_n;
      for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
        __pyx_v_i = __pyx_t_8;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":51
 *             for i in range(n):
 *                 # Adjust datetime64 timestamp, recompute datetimestruct
 *                 pos = trans.searchsorted(arr[i]) - 1             # <<<<<<<<<<<<<<
 *                 inf = tz._transition_info[pos]
 * 
 */
        __pyx_t_13 = PyObject_GetAttr(__pyx_v_trans, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_bshape_0_arr;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_arr)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_14 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_arr.buf, __pyx_t_17, __pyx_bstride_0_arr))); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_12));
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Subtract(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_v_pos);
        __pyx_v_pos = __pyx_t_12;
        __pyx_t_12 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":52
 *                 # Adjust datetime64 timestamp, recompute datetimestruct
 *                 pos = trans.searchsorted(arr[i]) - 1
 *                 inf = tz._transition_info[pos]             # <<<<<<<<<<<<<<
 * 
 *                 pandas_datetime_to_datetimestruct(arr[i] + deltas[pos],
 */
        __pyx_t_12 = PyObject_GetAttr(__pyx_v_tz, __pyx_n_s___transition_info); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_14 = PyObject_GetItem(__pyx_t_12, __pyx_v_pos); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_v_inf);
        __pyx_v_inf = __pyx_t_14;
        __pyx_t_14 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":54
 *                 inf = tz._transition_info[pos]
 * 
 *                 pandas_datetime_to_datetimestruct(arr[i] + deltas[pos],             # <<<<<<<<<<<<<<
 *                                                   PANDAS_FR_ns, &dts)
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_bshape_0_arr;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_arr)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_14 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_arr.buf, __pyx_t_18, __pyx_bstride_0_arr))); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_12 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_19 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_13); if (unlikely((__pyx_t_19 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":55
 * 
 *                 pandas_datetime_to_datetimestruct(arr[i] + deltas[pos],
 *                                                   PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 *                                      dts.min, dts.sec, dts.us,
 */
        pandas_datetime_to_datetimestruct(__pyx_t_19, PANDAS_FR_ns, (&__pyx_v_dts));

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":56
 *                 pandas_datetime_to_datetimestruct(arr[i] + deltas[pos],
 *                                                   PANDAS_FR_ns, &dts)
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,             # <<<<<<<<<<<<<<
 *                                      dts.min, dts.sec, dts.us,
 *                                      tz._tzinfos[inf])
 */
        __pyx_t_13 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_12 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_14 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_11 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":57
 *                                                   PANDAS_FR_ns, &dts)
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 *                                      dts.min, dts.sec, dts.us,             # <<<<<<<<<<<<<<
 *                                      tz._tzinfos[inf])
 *     else:
 */
        __pyx_t_3 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":58
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 *                                      dts.min, dts.sec, dts.us,
 *                                      tz._tzinfos[inf])             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(n):
 */
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_tz, __pyx_n_s___tzinfos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_20 = PyObject_GetItem(__pyx_t_2, __pyx_v_inf); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_20);
        __pyx_t_13 = 0;
        __pyx_t_12 = 0;
        __pyx_t_14 = 0;
        __pyx_t_11 = 0;
        __pyx_t_3 = 0;
        __pyx_t_4 = 0;
        __pyx_t_5 = 0;
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":56
 *                 pandas_datetime_to_datetimestruct(arr[i] + deltas[pos],
 *                                                   PANDAS_FR_ns, &dts)
 *                 result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,             # <<<<<<<<<<<<<<
 *                                      dts.min, dts.sec, dts.us,
 *                                      tz._tzinfos[inf])
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_10 = -1;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_bshape_0_result;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_21, __pyx_bstride_0_result);
        __Pyx_GOTREF(*__pyx_t_16);
        __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_t_20);
        *__pyx_t_16 = __pyx_t_20;
        __Pyx_GIVEREF(*__pyx_t_16);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":60
 *                                      tz._tzinfos[inf])
 *     else:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 *             result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":61
 *     else:
 *         for i in range(n):
 *             pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 *                                  dts.min, dts.sec, dts.us)
 */
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_bshape_0_arr;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_arr)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_arr.buf, __pyx_t_22, __pyx_bstride_0_arr)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":62
 *         for i in range(n):
 *             pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 *             result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,             # <<<<<<<<<<<<<<
 *                                  dts.min, dts.sec, dts.us)
 * 
 */
      __pyx_t_20 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_dts.year); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.day); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.hour); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":63
 *             pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 *             result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,
 *                                  dts.min, dts.sec, dts.us)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_3 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.min); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.sec); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_14 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts.us); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_12 = PyTuple_New(7); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_12));
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_20);
      __Pyx_GIVEREF(__pyx_t_20);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_14);
      __Pyx_GIVEREF(__pyx_t_14);
      __pyx_t_20 = 0;
      __pyx_t_2 = 0;
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_11 = 0;
      __pyx_t_14 = 0;
      __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":62
 *         for i in range(n):
 *             pandas_datetime_to_datetimestruct(arr[i], PANDAS_FR_ns, &dts)
 *             result[i] = datetime(dts.year, dts.month, dts.day, dts.hour,             # <<<<<<<<<<<<<<
 *                                  dts.min, dts.sec, dts.us)
 * 
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_23, __pyx_bstride_0_result);
      __Pyx_GOTREF(*__pyx_t_16);
      __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_t_14);
      *__pyx_t_16 = __pyx_t_14;
      __Pyx_GIVEREF(*__pyx_t_16);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    }
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":65
 *                                  dts.min, dts.sec, dts.us)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.ints_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_trans);
  __Pyx_XDECREF(__pyx_v_deltas);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_inf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":73
 * class Timestamp(_Timestamp):
 * 
 *     def __new__(cls, object ts_input, object offset=None, tz=None):             # <<<<<<<<<<<<<<
 *         cdef _TSObject ts
 *         cdef _Timestamp ts_base
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp___new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp___new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp___new__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp___new__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_ts_input = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_tz = 0;
  struct __pyx_obj_6pandas_3lib__TSObject *__pyx_v_ts = 0;
  struct __pyx_obj_6pandas_3lib__Timestamp *__pyx_v_ts_base = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  struct __pyx_opt_args_6pandas_3lib_convert_to_tsobject __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__cls,&__pyx_n_s__ts_input,&__pyx_n_s__offset,&__pyx_n_s__tz,0};
  __Pyx_RefNannySetupContext("__new__");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cls);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ts_input);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__new__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_ts_input = values[1];
    __pyx_v_offset = values[2];
    __pyx_v_tz = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Timestamp.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_ts_input);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":77
 *         cdef _Timestamp ts_base
 * 
 *         if isinstance(ts_input, float):             # <<<<<<<<<<<<<<
 *             # to do, do we want to support this, ie with fractional seconds?
 *             raise TypeError("Cannot convert a float to datetime")
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)(&PyFloat_Type)));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ts_input, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":79
 *         if isinstance(ts_input, float):
 *             # to do, do we want to support this, ie with fractional seconds?
 *             raise TypeError("Cannot convert a float to datetime")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(ts_input, basestring):
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":81
 *             raise TypeError("Cannot convert a float to datetime")
 * 
 *         if isinstance(ts_input, basestring):             # <<<<<<<<<<<<<<
 *             try:
 *                 ts_input = parse_date(ts_input)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__basestring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_ts_input, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":82
 * 
 *         if isinstance(ts_input, basestring):
 *             try:             # <<<<<<<<<<<<<<
 *                 ts_input = parse_date(ts_input)
 *             except Exception:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":83
 *         if isinstance(ts_input, basestring):
 *             try:
 *                 ts_input = parse_date(ts_input)             # <<<<<<<<<<<<<<
 *             except Exception:
 *                 pass
 */
        __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__parse_date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_INCREF(__pyx_v_ts_input);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ts_input);
        __Pyx_GIVEREF(__pyx_v_ts_input);
        __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_ts_input);
        __pyx_v_ts_input = __pyx_t_7;
        __pyx_t_7 = 0;
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":84
 *             try:
 *                 ts_input = parse_date(ts_input)
 *             except Exception:             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
      if (__pyx_t_8) {
        PyErr_Restore(0,0,0);
        goto __pyx_L9_exception_handled;
      }
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L9_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L15_try_end:;
    }
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":87
 *                 pass
 * 
 *         ts = convert_to_tsobject(ts_input, tz)             # <<<<<<<<<<<<<<
 * 
 *         if ts.value == NPY_NAT:
 */
  __pyx_t_9.__pyx_n = 1;
  __pyx_t_9.tz = __pyx_v_tz;
  __pyx_t_7 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_v_ts_input, 0, &__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_6pandas_3lib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ts = ((struct __pyx_obj_6pandas_3lib__TSObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":89
 *         ts = convert_to_tsobject(ts_input, tz)
 * 
 *         if ts.value == NPY_NAT:             # <<<<<<<<<<<<<<
 *             return NaT
 * 
 */
  __pyx_t_2 = (__pyx_v_ts->value == __pyx_v_6pandas_3lib_NPY_NAT);
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":90
 * 
 *         if ts.value == NPY_NAT:
 *             return NaT             # <<<<<<<<<<<<<<
 * 
 *         # make datetime happy
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__NaT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
    goto __pyx_L16;
  }
  __pyx_L16:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":93
 * 
 *         # make datetime happy
 *         ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month,             # <<<<<<<<<<<<<<
 *                                      ts.dts.day, ts.dts.hour, ts.dts.min,
 *                                      ts.dts.sec, ts.dts.us, ts.tzinfo)
 */
  __pyx_t_7 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__Timestamp)), __pyx_n_s____new__); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_ts->dts.year); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":94
 *         # make datetime happy
 *         ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month,
 *                                      ts.dts.day, ts.dts.hour, ts.dts.min,             # <<<<<<<<<<<<<<
 *                                      ts.dts.sec, ts.dts.us, ts.tzinfo)
 * 
 */
  __pyx_t_10 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.day); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.hour); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.min); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":95
 *         ts_base = _Timestamp.__new__(cls, ts.dts.year, ts.dts.month,
 *                                      ts.dts.day, ts.dts.hour, ts.dts.min,
 *                                      ts.dts.sec, ts.dts.us, ts.tzinfo)             # <<<<<<<<<<<<<<
 * 
 *         # fill out rest of data
 */
  __pyx_t_13 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.sec); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.us); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = PyTuple_New(9); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_15));
  __Pyx_INCREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_cls);
  __Pyx_GIVEREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_15, 7, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_14);
  __Pyx_INCREF(__pyx_v_ts->tzinfo);
  PyTuple_SET_ITEM(__pyx_t_15, 8, __pyx_v_ts->tzinfo);
  __Pyx_GIVEREF(__pyx_v_ts->tzinfo);
  __pyx_t_6 = 0;
  __pyx_t_1 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_14 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_6pandas_3lib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ts_base = ((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":98
 * 
 *         # fill out rest of data
 *         ts_base.value = ts.value             # <<<<<<<<<<<<<<
 *         ts_base.offset = offset
 *         ts_base.nanosecond = ts.dts.ps / 1000
 */
  __pyx_v_ts_base->value = __pyx_v_ts->value;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":99
 *         # fill out rest of data
 *         ts_base.value = ts.value
 *         ts_base.offset = offset             # <<<<<<<<<<<<<<
 *         ts_base.nanosecond = ts.dts.ps / 1000
 * 
 */
  __Pyx_INCREF(__pyx_v_offset);
  __Pyx_GIVEREF(__pyx_v_offset);
  __Pyx_GOTREF(__pyx_v_ts_base->offset);
  __Pyx_DECREF(__pyx_v_ts_base->offset);
  __pyx_v_ts_base->offset = __pyx_v_offset;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":100
 *         ts_base.value = ts.value
 *         ts_base.offset = offset
 *         ts_base.nanosecond = ts.dts.ps / 1000             # <<<<<<<<<<<<<<
 * 
 *         return ts_base
 */
  __pyx_v_ts_base->nanosecond = __Pyx_div_long(__pyx_v_ts->dts.ps, 1000);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":102
 *         ts_base.nanosecond = ts.dts.ps / 1000
 * 
 *         return ts_base             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ts_base));
  __pyx_r = ((PyObject *)__pyx_v_ts_base);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("pandas.lib.Timestamp.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ts);
  __Pyx_XDECREF((PyObject *)__pyx_v_ts_base);
  __Pyx_XDECREF(__pyx_v_ts_input);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":104
 *         return ts_base
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         result = self._repr_base
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_1__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_1__repr__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_year2000 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":105
 * 
 *     def __repr__(self):
 *         result = self._repr_base             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___repr_base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":107
 *         result = self._repr_base
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             result += self.strftime('%z')
 *             if self.tzinfo:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":108
 * 
 *         try:
 *             result += self.strftime('%z')             # <<<<<<<<<<<<<<
 *             if self.tzinfo:
 *                 result += self.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__strftime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_v_result);
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":109
 *         try:
 *             result += self.strftime('%z')
 *             if self.tzinfo:             # <<<<<<<<<<<<<<
 *                 result += self.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 *         except ValueError:
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":110
 *             result += self.strftime('%z')
 *             if self.tzinfo:
 *                 result += self.strftime(' %%Z, tz=%s' % self.tzinfo.zone)             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             year2000 = self.replace(year=2000)
 */
        __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__strftime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zone); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_7));
        PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_result);
        __pyx_v_result = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":111
 *             if self.tzinfo:
 *                 result += self.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             year2000 = self.replace(year=2000)
 *             result += year2000.strftime('%z')
 */
    __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_8) {
      __Pyx_AddTraceback("pandas.lib.Timestamp.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_1);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":112
 *                 result += self.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 *         except ValueError:
 *             year2000 = self.replace(year=2000)             # <<<<<<<<<<<<<<
 *             result += year2000.strftime('%z')
 *             if self.tzinfo:
 */
      __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__replace); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_10));
      if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__year), __pyx_int_2000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __pyx_v_year2000 = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":113
 *         except ValueError:
 *             year2000 = self.replace(year=2000)
 *             result += year2000.strftime('%z')             # <<<<<<<<<<<<<<
 *             if self.tzinfo:
 *                 result += year2000.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 */
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_year2000, __pyx_n_s__strftime); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_v_result);
      __pyx_v_result = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":114
 *             year2000 = self.replace(year=2000)
 *             result += year2000.strftime('%z')
 *             if self.tzinfo:             # <<<<<<<<<<<<<<
 *                 result += year2000.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 * 
 */
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":115
 *             result += year2000.strftime('%z')
 *             if self.tzinfo:
 *                 result += year2000.strftime(' %%Z, tz=%s' % self.tzinfo.zone)             # <<<<<<<<<<<<<<
 * 
 *         return '<Timestamp: %s>' % result
 */
        __pyx_t_11 = PyObject_GetAttr(__pyx_v_year2000, __pyx_n_s__strftime); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__zone); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_10));
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_10));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
        __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_v_result);
        __pyx_v_result = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L16;
      }
      __pyx_L16:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    __pyx_L12_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":117
 *                 result += year2000.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 * 
 *         return '<Timestamp: %s>' % result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), __pyx_v_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pandas.lib.Timestamp.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_year2000);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":120
 * 
 *     @property
 *     def _repr_base(self):             # <<<<<<<<<<<<<<
 *         result = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (self.year, self.month,
 *                                                   self.day, self.hour,
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_2_repr_base(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_2_repr_base = {__Pyx_NAMESTR("_repr_base"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_2_repr_base, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_2_repr_base(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_nanos = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_repr_base");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":121
 *     @property
 *     def _repr_base(self):
 *         result = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (self.year, self.month,             # <<<<<<<<<<<<<<
 *                                                   self.day, self.hour,
 *                                                   self.minute, self.second)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":122
 *     def _repr_base(self):
 *         result = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (self.year, self.month,
 *                                                   self.day, self.hour,             # <<<<<<<<<<<<<<
 *                                                   self.minute, self.second)
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__day); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__hour); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":123
 *         result = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (self.year, self.month,
 *                                                   self.day, self.hour,
 *                                                   self.minute, self.second)             # <<<<<<<<<<<<<<
 * 
 *         if self.nanosecond != 0:
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__minute); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__second); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_v_result = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":125
 *                                                   self.minute, self.second)
 * 
 *         if self.nanosecond != 0:             # <<<<<<<<<<<<<<
 *             nanos = self.nanosecond + 1000 * self.microsecond
 *             result += '.%.9d' % nanos
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nanosecond); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_8) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":126
 * 
 *         if self.nanosecond != 0:
 *             nanos = self.nanosecond + 1000 * self.microsecond             # <<<<<<<<<<<<<<
 *             result += '.%.9d' % nanos
 *         elif self.microsecond != 0:
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nanosecond); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__microsecond); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Multiply(__pyx_int_1000, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_nanos = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":127
 *         if self.nanosecond != 0:
 *             nanos = self.nanosecond + 1000 * self.microsecond
 *             result += '.%.9d' % nanos             # <<<<<<<<<<<<<<
 *         elif self.microsecond != 0:
 *             result += '.%.6d' % self.microsecond
 */
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_v_nanos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_v_result);
    __pyx_v_result = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":128
 *             nanos = self.nanosecond + 1000 * self.microsecond
 *             result += '.%.9d' % nanos
 *         elif self.microsecond != 0:             # <<<<<<<<<<<<<<
 *             result += '.%.6d' % self.microsecond
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__microsecond); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_8) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":129
 *             result += '.%.9d' % nanos
 *         elif self.microsecond != 0:
 *             result += '.%.6d' % self.microsecond             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__microsecond); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_result);
    __pyx_v_result = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":131
 *             result += '.%.6d' % self.microsecond
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pandas.lib.Timestamp._repr_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_nanos);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":134
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         """
 *         Alias for tzinfo
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_3tz(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6pandas_3lib_9Timestamp_3tz[] = "\n        Alias for tzinfo\n        ";
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_3tz = {__Pyx_NAMESTR("tz"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_3tz, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_9Timestamp_3tz)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_3tz(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tz");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":138
 *         Alias for tzinfo
 *         """
 *         return self.tzinfo             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Timestamp.tz", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":141
 * 
 *     @property
 *     def freq(self):             # <<<<<<<<<<<<<<
 *         return self.offset
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_4freq(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_4freq = {__Pyx_NAMESTR("freq"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_4freq, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_4freq(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("freq");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":142
 *     @property
 *     def freq(self):
 *         return self.offset             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Timestamp.freq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":144
 *         return self.offset
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.value = state[0]
 *         self.offset = state[1]
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_5__setstate__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_5__setstate__ = {__Pyx_NAMESTR("__setstate__"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_5__setstate__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_5__setstate__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__state,0};
  __Pyx_RefNannySetupContext("__setstate__");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__state);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__setstate__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_state = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Timestamp.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":145
 * 
 *     def __setstate__(self, state):
 *         self.value = state[0]             # <<<<<<<<<<<<<<
 *         self.offset = state[1]
 *         self.tzinfo = state[2]
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__value, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":146
 *     def __setstate__(self, state):
 *         self.value = state[0]
 *         self.offset = state[1]             # <<<<<<<<<<<<<<
 *         self.tzinfo = state[2]
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__offset, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":147
 *         self.value = state[0]
 *         self.offset = state[1]
 *         self.tzinfo = state[2]             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__tzinfo, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Timestamp.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":149
 *         self.tzinfo = state[2]
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         object_state = self.value, self.offset, self.tzinfo
 *         return (Timestamp, object_state)
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_6__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_6__reduce__ = {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_6__reduce__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_6__reduce__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_object_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":150
 * 
 *     def __reduce__(self):
 *         object_state = self.value, self.offset, self.tzinfo             # <<<<<<<<<<<<<<
 *         return (Timestamp, object_state)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_v_object_state = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":151
 *     def __reduce__(self):
 *         object_state = self.value, self.offset, self.tzinfo
 *         return (Timestamp, object_state)             # <<<<<<<<<<<<<<
 * 
 *     def to_period(self, freq=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_object_state));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_object_state));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_object_state));
  __pyx_t_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Timestamp.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_object_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":153
 *         return (Timestamp, object_state)
 * 
 *     def to_period(self, freq=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an period of which this timestamp is an observation.
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_7to_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_9Timestamp_7to_period[] = "\n        Return an period of which this timestamp is an observation.\n        ";
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_7to_period = {__Pyx_NAMESTR("to_period"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_7to_period, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_9Timestamp_7to_period)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_7to_period(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_freq = 0;
  PyObject *__pyx_v_Period = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__freq,0};
  __Pyx_RefNannySetupContext("to_period");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__freq);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "to_period") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_freq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_period", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Timestamp.to_period", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_freq);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":157
 *         Return an period of which this timestamp is an observation.
 *         """
 *         from pandas.tseries.period import Period             # <<<<<<<<<<<<<<
 * 
 *         if freq is None:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Period));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Period));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Period));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_23), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Period); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_Period = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":159
 *         from pandas.tseries.period import Period
 * 
 *         if freq is None:             # <<<<<<<<<<<<<<
 *             freq = self.freq
 * 
 */
  __pyx_t_3 = (__pyx_v_freq == Py_None);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":160
 * 
 *         if freq is None:
 *             freq = self.freq             # <<<<<<<<<<<<<<
 * 
 *         return Period(self, freq=freq)
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_freq);
    __pyx_v_freq = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":162
 *             freq = self.freq
 * 
 *         return Period(self, freq=freq)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__freq), __pyx_v_freq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_v_Period, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Timestamp.to_period", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Period);
  __Pyx_XDECREF(__pyx_v_freq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":165
 * 
 *     @property
 *     def dayofweek(self):             # <<<<<<<<<<<<<<
 *         return self.weekday()
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_8dayofweek(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_8dayofweek = {__Pyx_NAMESTR("dayofweek"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_8dayofweek, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_8dayofweek(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dayofweek");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":166
 *     @property
 *     def dayofweek(self):
 *         return self.weekday()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__weekday); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.Timestamp.dayofweek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":169
 * 
 *     @property
 *     def dayofyear(self):             # <<<<<<<<<<<<<<
 *         return self.day
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_9dayofyear(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_9dayofyear = {__Pyx_NAMESTR("dayofyear"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_9dayofyear, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_9dayofyear(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dayofyear");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":170
 *     @property
 *     def dayofyear(self):
 *         return self.day             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Timestamp.dayofyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":173
 * 
 *     @property
 *     def week(self):             # <<<<<<<<<<<<<<
 *         return self._get_field('woy')
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_10week(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_10week = {__Pyx_NAMESTR("week"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_10week, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_10week(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("week");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":174
 *     @property
 *     def week(self):
 *         return self._get_field('woy')             # <<<<<<<<<<<<<<
 * 
 *     weekofyear = week
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.Timestamp.week", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":179
 * 
 *     @property
 *     def quarter(self):             # <<<<<<<<<<<<<<
 *         return self._get_field('q')
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_11quarter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_11quarter = {__Pyx_NAMESTR("quarter"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_11quarter, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_11quarter(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("quarter");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":180
 *     @property
 *     def quarter(self):
 *         return self._get_field('q')             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.Timestamp.quarter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":183
 * 
 *     @property
 *     def freqstr(self):             # <<<<<<<<<<<<<<
 *         return getattr(self.offset, 'freqstr', self.offset)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_12freqstr(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_12freqstr = {__Pyx_NAMESTR("freqstr"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_12freqstr, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_12freqstr(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("freqstr");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":184
 *     @property
 *     def freqstr(self):
 *         return getattr(self.offset, 'freqstr', self.offset)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_n_s__freqstr);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetAttr3(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Timestamp.freqstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":187
 * 
 *     @property
 *     def asm8(self):             # <<<<<<<<<<<<<<
 *         return np.int64(self.value).view('M8[ns]')
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_13asm8(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_13asm8 = {__Pyx_NAMESTR("asm8"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_13asm8, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_13asm8(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asm8");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":188
 *     @property
 *     def asm8(self):
 *         return np.int64(self.value).view('M8[ns]')             # <<<<<<<<<<<<<<
 * 
 *     def tz_localize(self, tz):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.Timestamp.asm8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":190
 *         return np.int64(self.value).view('M8[ns]')
 * 
 *     def tz_localize(self, tz):             # <<<<<<<<<<<<<<
 *         """
 *         Convert naive Timestamp to local time zone
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_14tz_localize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_9Timestamp_14tz_localize[] = "\n        Convert naive Timestamp to local time zone\n\n        Parameters\n        ----------\n        tz : pytz.timezone\n\n        Returns\n        -------\n        localized : Timestamp\n        ";
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_14tz_localize = {__Pyx_NAMESTR("tz_localize"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_14tz_localize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_9Timestamp_14tz_localize)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_14tz_localize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__tz,0};
  __Pyx_RefNannySetupContext("tz_localize");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tz_localize", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tz_localize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_localize", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Timestamp.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":202
 *         localized : Timestamp
 *         """
 *         if self.tzinfo is None:             # <<<<<<<<<<<<<<
 *             # tz naive, localize
 *             return Timestamp(self.to_pydatetime(), tz=tz)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":204
 *         if self.tzinfo is None:
 *             # tz naive, localize
 *             return Timestamp(self.to_pydatetime(), tz=tz)             # <<<<<<<<<<<<<<
 *         else:
 *             raise Exception('Cannot localize tz-aware Timestamp, use '
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__to_pydatetime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__tz), __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":206
 *             return Timestamp(self.to_pydatetime(), tz=tz)
 *         else:
 *             raise Exception('Cannot localize tz-aware Timestamp, use '             # <<<<<<<<<<<<<<
 *                             'tz_convert for conversions')
 * 
 */
    __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib.Timestamp.tz_localize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":209
 *                             'tz_convert for conversions')
 * 
 *     def tz_convert(self, tz):             # <<<<<<<<<<<<<<
 *         """
 *         Convert Timestamp to another time zone or localize to requested time
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_15tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_9Timestamp_15tz_convert[] = "\n        Convert Timestamp to another time zone or localize to requested time\n        zone\n\n        Parameters\n        ----------\n        tz : pytz.timezone\n\n        Returns\n        -------\n        converted : Timestamp\n        ";
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_15tz_convert = {__Pyx_NAMESTR("tz_convert"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_15tz_convert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_9Timestamp_15tz_convert)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_15tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__tz,0};
  __Pyx_RefNannySetupContext("tz_convert");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tz_convert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Timestamp.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":222
 *         converted : Timestamp
 *         """
 *         if self.tzinfo is None:             # <<<<<<<<<<<<<<
 *             # tz naive, use tz_localize
 *             raise Exception('Cannot convert tz-naive Timestamp, use '
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":224
 *         if self.tzinfo is None:
 *             # tz naive, use tz_localize
 *             raise Exception('Cannot convert tz-naive Timestamp, use '             # <<<<<<<<<<<<<<
 *                             'tz_localize to localize')
 *         else:
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":228
 *         else:
 *             # Same UTC timestamp, different time zone
 *             return Timestamp(self.value, tz=tz)             # <<<<<<<<<<<<<<
 * 
 *     def replace(self, **kwds):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__tz), __pyx_v_tz) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib.Timestamp.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":230
 *             return Timestamp(self.value, tz=tz)
 * 
 *     def replace(self, **kwds):             # <<<<<<<<<<<<<<
 *         return Timestamp(datetime.replace(self, **kwds),
 *                          offset=self.offset)
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_16replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_16replace = {__Pyx_NAMESTR("replace"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_16replace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_16replace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_kwds = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,0};
  __Pyx_RefNannySetupContext("replace");
  __pyx_self = __pyx_self;
  __pyx_v_kwds = PyDict_New(); if (unlikely(!__pyx_v_kwds)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwds);
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwds, values, PyTuple_GET_SIZE(__pyx_args), "replace") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwds); __pyx_v_kwds = 0;
  __Pyx_AddTraceback("pandas.lib.Timestamp.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":231
 * 
 *     def replace(self, **kwds):
 *         return Timestamp(datetime.replace(self, **kwds),             # <<<<<<<<<<<<<<
 *                          offset=self.offset)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s__replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_v_kwds)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":232
 *     def replace(self, **kwds):
 *         return Timestamp(datetime.replace(self, **kwds),
 *                          offset=self.offset)             # <<<<<<<<<<<<<<
 * 
 *     def to_pydatetime(self, warn=True):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__offset), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Timestamp.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_kwds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":234
 *                          offset=self.offset)
 * 
 *     def to_pydatetime(self, warn=True):             # <<<<<<<<<<<<<<
 *         """
 *         If warn=True, issue warning if nanoseconds is nonzero
 */

static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_17to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_9Timestamp_17to_pydatetime[] = "\n        If warn=True, issue warning if nanoseconds is nonzero\n        ";
static PyMethodDef __pyx_mdef_6pandas_3lib_9Timestamp_17to_pydatetime = {__Pyx_NAMESTR("to_pydatetime"), (PyCFunction)__pyx_pf_6pandas_3lib_9Timestamp_17to_pydatetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_9Timestamp_17to_pydatetime)};
static PyObject *__pyx_pf_6pandas_3lib_9Timestamp_17to_pydatetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_warn = 0;
  struct __pyx_obj_6pandas_3lib__TSObject *__pyx_v_ts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  struct __pyx_opt_args_6pandas_3lib_convert_to_tsobject __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__warn,0};
  __Pyx_RefNannySetupContext("to_pydatetime");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_32;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__warn);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "to_pydatetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_warn = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pydatetime", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Timestamp.to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":242
 *             _TSObject ts
 * 
 *         if self.nanosecond != 0 and warn:             # <<<<<<<<<<<<<<
 *             print 'Warning: discarding nonzero nanoseconds'
 *         ts = convert_to_tsobject(self, self.tzinfo)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nanosecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_warn); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":243
 * 
 *         if self.nanosecond != 0 and warn:
 *             print 'Warning: discarding nonzero nanoseconds'             # <<<<<<<<<<<<<<
 *         ts = convert_to_tsobject(self, self.tzinfo)
 * 
 */
    if (__Pyx_PrintOne(0, ((PyObject *)__pyx_kp_s_33)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":244
 *         if self.nanosecond != 0 and warn:
 *             print 'Warning: discarding nonzero nanoseconds'
 *         ts = convert_to_tsobject(self, self.tzinfo)             # <<<<<<<<<<<<<<
 * 
 *         return datetime(ts.dts.year, ts.dts.month, ts.dts.day,
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.tz = __pyx_t_2;
  __pyx_t_1 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_v_self, 0, &__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_3lib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ts = ((struct __pyx_obj_6pandas_3lib__TSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":246
 *         ts = convert_to_tsobject(self, self.tzinfo)
 * 
 *         return datetime(ts.dts.year, ts.dts.month, ts.dts.day,             # <<<<<<<<<<<<<<
 *                         ts.dts.hour, ts.dts.min, ts.dts.sec,
 *                         ts.dts.us, ts.tzinfo)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_ts->dts.year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.month); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.day); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":247
 * 
 *         return datetime(ts.dts.year, ts.dts.month, ts.dts.day,
 *                         ts.dts.hour, ts.dts.min, ts.dts.sec,             # <<<<<<<<<<<<<<
 *                         ts.dts.us, ts.tzinfo)
 * 
 */
  __pyx_t_8 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.hour); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.min); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.sec); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":248
 *         return datetime(ts.dts.year, ts.dts.month, ts.dts.day,
 *                         ts.dts.hour, ts.dts.min, ts.dts.sec,
 *                         ts.dts.us, ts.tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_ts->dts.us); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_12));
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __Pyx_INCREF(__pyx_v_ts->tzinfo);
  PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_v_ts->tzinfo);
  __Pyx_GIVEREF(__pyx_v_ts->tzinfo);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pandas.lib.Timestamp.to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":253
 * class NaTType(_NaT):
 * 
 *     def __new__(cls):             # <<<<<<<<<<<<<<
 *         cdef _NaT base
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_7NaTType___new__(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_7NaTType___new__ = {__Pyx_NAMESTR("__new__"), (PyCFunction)__pyx_pf_6pandas_3lib_7NaTType___new__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_7NaTType___new__(PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  struct __pyx_obj_6pandas_3lib__NaT *__pyx_v_base = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__new__");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":256
 *         cdef _NaT base
 * 
 *         base = _NaT.__new__(cls, 1, 1, 1)             # <<<<<<<<<<<<<<
 *         mangle_nat(base)
 *         base.value = NPY_NAT
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__NaT)), __pyx_n_s____new__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cls);
  __Pyx_GIVEREF(__pyx_v_cls);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_3lib__NaT))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_base = ((struct __pyx_obj_6pandas_3lib__NaT *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":257
 * 
 *         base = _NaT.__new__(cls, 1, 1, 1)
 *         mangle_nat(base)             # <<<<<<<<<<<<<<
 *         base.value = NPY_NAT
 * 
 */
  mangle_nat(((PyObject *)__pyx_v_base));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":258
 *         base = _NaT.__new__(cls, 1, 1, 1)
 *         mangle_nat(base)
 *         base.value = NPY_NAT             # <<<<<<<<<<<<<<
 * 
 *         return base
 */
  __pyx_v_base->__pyx_base.value = __pyx_v_6pandas_3lib_NPY_NAT;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":260
 *         base.value = NPY_NAT
 * 
 *         return base             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_base));
  __pyx_r = ((PyObject *)__pyx_v_base);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.NaTType.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_base);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":262
 *         return base
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'NaT'
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_7NaTType_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_7NaTType_1__repr__ = {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6pandas_3lib_7NaTType_1__repr__, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_7NaTType_1__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":263
 * 
 *     def __repr__(self):
 *         return 'NaT'             # <<<<<<<<<<<<<<
 * 
 *     def weekday(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__NaT));
  __pyx_r = ((PyObject *)__pyx_n_s__NaT);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":265
 *         return 'NaT'
 * 
 *     def weekday(self):             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_7NaTType_2weekday(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_7NaTType_2weekday = {__Pyx_NAMESTR("weekday"), (PyCFunction)__pyx_pf_6pandas_3lib_7NaTType_2weekday, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_7NaTType_2weekday(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("weekday");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":266
 * 
 *     def weekday(self):
 *         return -1             # <<<<<<<<<<<<<<
 * 
 *     def toordinal(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_neg_1);
  __pyx_r = __pyx_int_neg_1;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":268
 *         return -1
 * 
 *     def toordinal(self):             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_7NaTType_3toordinal(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_7NaTType_3toordinal = {__Pyx_NAMESTR("toordinal"), (PyCFunction)__pyx_pf_6pandas_3lib_7NaTType_3toordinal, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_7NaTType_3toordinal(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("toordinal");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":269
 * 
 *     def toordinal(self):
 *         return -1             # <<<<<<<<<<<<<<
 * 
 * fields = ['year', 'quarter', 'month', 'day', 'hour',
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_neg_1);
  __pyx_r = __pyx_int_neg_1;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":284
 * 
 * 
 * cdef inline bint is_timestamp(object o):             # <<<<<<<<<<<<<<
 *     return isinstance(o, Timestamp)
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_timestamp(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_timestamp");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":285
 * 
 * cdef inline bint is_timestamp(object o):
 *     return isinstance(o, Timestamp)             # <<<<<<<<<<<<<<
 * 
 * def is_timestamp_array(ndarray[object] values):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_o, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pandas.lib.is_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":287
 *     return isinstance(o, Timestamp)
 * 
 * def is_timestamp_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */

static PyObject *__pyx_pf_6pandas_3lib_32is_timestamp_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_32is_timestamp_array = {__Pyx_NAMESTR("is_timestamp_array"), (PyCFunction)__pyx_pf_6pandas_3lib_32is_timestamp_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_32is_timestamp_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  int __pyx_v_i;
  int __pyx_v_n;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_timestamp_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":288
 * 
 * def is_timestamp_array(ndarray[object] values):
 *     cdef int i, n = len(values)             # <<<<<<<<<<<<<<
 *     if n == 0:
 *         return False
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":289
 * def is_timestamp_array(ndarray[object] values):
 *     cdef int i, n = len(values)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return False
 *     for i in range(n):
 */
  __pyx_t_2 = (__pyx_v_n == 0);
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":290
 *     cdef int i, n = len(values)
 *     if n == 0:
 *         return False             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         if not is_timestamp(values[i]):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":291
 *     if n == 0:
 *         return False
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if not is_timestamp(values[i]):
 *             return False
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":292
 *         return False
 *     for i in range(n):
 *         if not is_timestamp(values[i]):             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_values)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_6, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __pyx_t_2 = (!__pyx_f_6pandas_3lib_is_timestamp(__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":293
 *     for i in range(n):
 *         if not is_timestamp(values[i]):
 *             return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":294
 *         if not is_timestamp(values[i]):
 *             return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_timestamp_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":297
 * 
 * 
 * cpdef object get_value_box(ndarray arr, object loc):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, sz
 */

static PyObject *__pyx_pf_6pandas_3lib_33get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_get_value_box(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_sz;
  PyObject *__pyx_v_casted = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_box");
  __Pyx_INCREF(__pyx_v_loc);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":301
 *         Py_ssize_t i, sz
 *         void* data_ptr
 *     if util.is_float_object(loc):             # <<<<<<<<<<<<<<
 *         casted = int(loc)
 *         if casted == loc:
 */
  __pyx_t_1 = is_float_object(__pyx_v_loc);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":302
 *         void* data_ptr
 *     if util.is_float_object(loc):
 *         casted = int(loc)             # <<<<<<<<<<<<<<
 *         if casted == loc:
 *             loc = casted
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_loc);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_loc);
    __Pyx_GIVEREF(__pyx_v_loc);
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_casted = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":303
 *     if util.is_float_object(loc):
 *         casted = int(loc)
 *         if casted == loc:             # <<<<<<<<<<<<<<
 *             loc = casted
 *     i = <Py_ssize_t> loc
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":304
 *         casted = int(loc)
 *         if casted == loc:
 *             loc = casted             # <<<<<<<<<<<<<<
 *     i = <Py_ssize_t> loc
 *     sz = cnp.PyArray_SIZE(arr)
 */
      __Pyx_INCREF(__pyx_v_casted);
      __Pyx_DECREF(__pyx_v_loc);
      __pyx_v_loc = __pyx_v_casted;
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":305
 *         if casted == loc:
 *             loc = casted
 *     i = <Py_ssize_t> loc             # <<<<<<<<<<<<<<
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_i = ((Py_ssize_t)__pyx_t_5);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":306
 *             loc = casted
 *     i = <Py_ssize_t> loc
 *     sz = cnp.PyArray_SIZE(arr)             # <<<<<<<<<<<<<<
 * 
 *     if i < 0 and sz > 0:
 */
  __pyx_v_sz = PyArray_SIZE(__pyx_v_arr);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":308
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 *     if i < 0 and sz > 0:             # <<<<<<<<<<<<<<
 *         i += sz
 *     elif i >= sz or sz == 0:
 */
  __pyx_t_4 = (__pyx_v_i < 0);
  if (__pyx_t_4) {
    __pyx_t_6 = (__pyx_v_sz > 0);
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_4;
  }
  if (__pyx_t_7) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":309
 * 
 *     if i < 0 and sz > 0:
 *         i += sz             # <<<<<<<<<<<<<<
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')
 */
    __pyx_v_i = (__pyx_v_i + __pyx_v_sz);
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":310
 *     if i < 0 and sz > 0:
 *         i += sz
 *     elif i >= sz or sz == 0:             # <<<<<<<<<<<<<<
 *         raise IndexError('index out of bounds')
 * 
 */
  __pyx_t_7 = (__pyx_v_i >= __pyx_v_sz);
  if (!__pyx_t_7) {
    __pyx_t_4 = (__pyx_v_sz == 0);
    __pyx_t_6 = __pyx_t_4;
  } else {
    __pyx_t_6 = __pyx_t_7;
  }
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":311
 *         i += sz
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     if arr.descr.type_num == NPY_DATETIME:
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":313
 *         raise IndexError('index out of bounds')
 * 
 *     if arr.descr.type_num == NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         return Timestamp(util.get_value_1d(arr, i))
 *     else:
 */
  __pyx_t_6 = (__pyx_v_arr->descr->type_num == NPY_DATETIME);
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":314
 * 
 *     if arr.descr.type_num == NPY_DATETIME:
 *         return Timestamp(util.get_value_1d(arr, i))             # <<<<<<<<<<<<<<
 *     else:
 *         return util.get_value_1d(arr, i)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":316
 *         return Timestamp(util.get_value_1d(arr, i))
 *     else:
 *         return util.get_value_1d(arr, i)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pandas.lib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_casted);
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":297
 * 
 * 
 * cpdef object get_value_box(ndarray arr, object loc):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, sz
 */

static PyObject *__pyx_pf_6pandas_3lib_33get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_33get_value_box(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__loc,0};
  __Pyx_RefNannySetupContext("get_value_box");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_value_box", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_value_box") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_loc = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_value_box", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib_get_value_box(__pyx_v_arr, __pyx_v_loc, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.get_value_box", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":322
 * # Frequency inference
 * 
 * def unique_deltas(ndarray[int64_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(arr)
 */

static PyObject *__pyx_pf_6pandas_3lib_34unique_deltas(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_34unique_deltas = {__Pyx_NAMESTR("unique_deltas"), (PyCFunction)__pyx_pf_6pandas_3lib_34unique_deltas, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_34unique_deltas(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  khiter_t __pyx_v_k;
  kh_int64_t *__pyx_v_table;
  int __pyx_v_ret;
  PyObject *__pyx_v_uniques = 0;
  PyObject *__pyx_v_result = NULL;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("unique_deltas");
  __pyx_self = __pyx_self;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":324
 * def unique_deltas(ndarray[int64_t] arr):
 *     cdef:
 *         Py_ssize_t i, n = len(arr)             # <<<<<<<<<<<<<<
 *         int64_t val
 *         khiter_t k
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":328
 *         khiter_t k
 *         kh_int64_t *table
 *         int ret = 0             # <<<<<<<<<<<<<<
 *         list uniques = []
 * 
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":329
 *         kh_int64_t *table
 *         int ret = 0
 *         list uniques = []             # <<<<<<<<<<<<<<
 * 
 *     table = kh_init_int64()
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_uniques = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":331
 *         list uniques = []
 * 
 *     table = kh_init_int64()             # <<<<<<<<<<<<<<
 *     kh_resize_int64(table, 10)
 *     for i in range(n - 1):
 */
  __pyx_v_table = kh_init_int64();

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":332
 * 
 *     table = kh_init_int64()
 *     kh_resize_int64(table, 10)             # <<<<<<<<<<<<<<
 *     for i in range(n - 1):
 *         val = arr[i + 1] - arr[i]
 */
  kh_resize_int64(__pyx_v_table, 10);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":333
 *     table = kh_init_int64()
 *     kh_resize_int64(table, 10)
 *     for i in range(n - 1):             # <<<<<<<<<<<<<<
 *         val = arr[i + 1] - arr[i]
 *         k = kh_get_int64(table, val)
 */
  __pyx_t_1 = (__pyx_v_n - 1);
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":334
 *     kh_resize_int64(table, 10)
 *     for i in range(n - 1):
 *         val = arr[i + 1] - arr[i]             # <<<<<<<<<<<<<<
 *         k = kh_get_int64(table, val)
 *         if k == table.n_buckets:
 */
    __pyx_t_4 = (__pyx_v_i + 1);
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_arr)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_arr)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_arr.buf, __pyx_t_4, __pyx_bstride_0_arr)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_arr.buf, __pyx_t_6, __pyx_bstride_0_arr)));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":335
 *     for i in range(n - 1):
 *         val = arr[i + 1] - arr[i]
 *         k = kh_get_int64(table, val)             # <<<<<<<<<<<<<<
 *         if k == table.n_buckets:
 *             kh_put_int64(table, val, &ret)
 */
    __pyx_v_k = kh_get_int64(__pyx_v_table, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":336
 *         val = arr[i + 1] - arr[i]
 *         k = kh_get_int64(table, val)
 *         if k == table.n_buckets:             # <<<<<<<<<<<<<<
 *             kh_put_int64(table, val, &ret)
 *             uniques.append(val)
 */
    __pyx_t_7 = (__pyx_v_k == __pyx_v_table->n_buckets);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":337
 *         k = kh_get_int64(table, val)
 *         if k == table.n_buckets:
 *             kh_put_int64(table, val, &ret)             # <<<<<<<<<<<<<<
 *             uniques.append(val)
 *     kh_destroy_int64(table)
 */
      kh_put_int64(__pyx_v_table, __pyx_v_val, (&__pyx_v_ret));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":338
 *         if k == table.n_buckets:
 *             kh_put_int64(table, val, &ret)
 *             uniques.append(val)             # <<<<<<<<<<<<<<
 *     kh_destroy_int64(table)
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_uniques) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyList_Append(__pyx_v_uniques, __pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":339
 *             kh_put_int64(table, val, &ret)
 *             uniques.append(val)
 *     kh_destroy_int64(table)             # <<<<<<<<<<<<<<
 * 
 *     result = np.array(uniques, dtype=np.int64)
 */
  kh_destroy_int64(__pyx_v_table);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":341
 *     kh_destroy_int64(table)
 * 
 *     result = np.array(uniques, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result.sort()
 *     return result
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_uniques));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_uniques));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_uniques));
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_9, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_v_result = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":342
 * 
 *     result = np.array(uniques, dtype=np.int64)
 *     result.sort()             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_12 = PyObject_GetAttr(__pyx_v_result, __pyx_n_s__sort); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":343
 *     result = np.array(uniques, dtype=np.int64)
 *     result.sort()
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.unique_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_uniques);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":346
 * 
 * 
 * cdef inline bint _is_multiple(int64_t us, int64_t mult):             # <<<<<<<<<<<<<<
 *     return us % mult == 0
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib__is_multiple(__pyx_t_5numpy_int64_t __pyx_v_us, __pyx_t_5numpy_int64_t __pyx_v_mult) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_is_multiple");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":347
 * 
 * cdef inline bint _is_multiple(int64_t us, int64_t mult):
 *     return us % mult == 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(__pyx_v_mult == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_r = (__Pyx_mod___pyx_t_5numpy_int64_t(__pyx_v_us, __pyx_v_mult) == 0);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pandas.lib._is_multiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":350
 * 
 * 
 * def apply_offset(ndarray[object] values, object offset):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_35apply_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_35apply_offset = {__Pyx_NAMESTR("apply_offset"), (PyCFunction)__pyx_pf_6pandas_3lib_35apply_offset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_35apply_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_offset = 0;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_new_values = 0;
  PyObject *__pyx_v_result = NULL;
  Py_buffer __pyx_bstruct_new_values;
  Py_ssize_t __pyx_bstride_0_new_values = 0;
  Py_ssize_t __pyx_bshape_0_new_values = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__offset,0};
  __Pyx_RefNannySetupContext("apply_offset");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__offset);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply_offset", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "apply_offset") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_offset = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply_offset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.apply_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_new_values.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":352
 * def apply_offset(ndarray[object] values, object offset):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] new_values
 *         object boxed
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":356
 *         object boxed
 * 
 *     result = np.empty(n, dtype='M8[ns]')             # <<<<<<<<<<<<<<
 *     new_values = result.view('i8')
 *     pass
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":357
 * 
 *     result = np.empty(n, dtype='M8[ns]')
 *     new_values = result.view('i8')             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_result, __pyx_n_s__view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_new_values);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_new_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_new_values, (PyObject*)__pyx_v_new_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_new_values = __pyx_bstruct_new_values.strides[0];
    __pyx_bshape_0_new_values = __pyx_bstruct_new_values.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_new_values = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_new_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.apply_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_new_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_new_values);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":370
 *         object offset       # frequency reference
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         if self.nanosecond:
 *             return hash(self.value)
 */

static Py_hash_t __pyx_pf_6pandas_3lib_10_Timestamp___hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pf_6pandas_3lib_10_Timestamp___hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_hash_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__hash__");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":371
 * 
 *     def __hash__(self):
 *         if self.nanosecond:             # <<<<<<<<<<<<<<
 *             return hash(self.value)
 *         else:
 */
  if (((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->nanosecond) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":372
 *     def __hash__(self):
 *         if self.nanosecond:
 *             return hash(self.value)             # <<<<<<<<<<<<<<
 *         else:
 *             return datetime.__hash__(self)
 */
    __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":374
 *             return hash(self.value)
 *         else:
 *             return datetime.__hash__(self)             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(_Timestamp self, object other, int op):
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s____hash__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyInt_AsHash_t(__pyx_t_4); if (unlikely((__pyx_t_2 == (Py_hash_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib._Timestamp.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":376
 *             return datetime.__hash__(self)
 * 
 *     def __richcmp__(_Timestamp self, object other, int op):             # <<<<<<<<<<<<<<
 *         cdef _Timestamp ots
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  struct __pyx_obj_6pandas_3lib__Timestamp *__pyx_v_ots = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_3lib__Timestamp, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":379
 *         cdef _Timestamp ots
 * 
 *         if isinstance(other, _Timestamp):             # <<<<<<<<<<<<<<
 *             ots = other
 *         elif isinstance(other, datetime):
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__Timestamp));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":380
 * 
 *         if isinstance(other, _Timestamp):
 *             ots = other             # <<<<<<<<<<<<<<
 *         elif isinstance(other, datetime):
 *             ots = Timestamp(other)
 */
    if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_6pandas_3lib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_other);
    __pyx_v_ots = ((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_other);
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":381
 *         if isinstance(other, _Timestamp):
 *             ots = other
 *         elif isinstance(other, datetime):             # <<<<<<<<<<<<<<
 *             ots = Timestamp(other)
 *         else:
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":382
 *             ots = other
 *         elif isinstance(other, datetime):
 *             ots = Timestamp(other)             # <<<<<<<<<<<<<<
 *         else:
 *             if op == 2:
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_other);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
    __Pyx_GIVEREF(__pyx_v_other);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6pandas_3lib__Timestamp))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ots = ((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":386
 *             if op == 2:
 *                 return False
 *             elif op == 3:             # <<<<<<<<<<<<<<
 *                 return True
 *             else:
 */
    switch (__pyx_v_op) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":384
 *             ots = Timestamp(other)
 *         else:
 *             if op == 2:             # <<<<<<<<<<<<<<
 *                 return False
 *             elif op == 3:
 */
      case 2:

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":385
 *         else:
 *             if op == 2:
 *                 return False             # <<<<<<<<<<<<<<
 *             elif op == 3:
 *                 return True
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
      break;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":386
 *             if op == 2:
 *                 return False
 *             elif op == 3:             # <<<<<<<<<<<<<<
 *                 return True
 *             else:
 */
      case 3:

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":387
 *                 return False
 *             elif op == 3:
 *                 return True             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError('Cannot compare Timestamp with %s' % str(other))
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
      break;
      default:

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":389
 *                 return True
 *             else:
 *                 raise TypeError('Cannot compare Timestamp with %s' % str(other))             # <<<<<<<<<<<<<<
 * 
 *         if self.tzinfo is None:
 */
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_37), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":391
 *                 raise TypeError('Cannot compare Timestamp with %s' % str(other))
 * 
 *         if self.tzinfo is None:             # <<<<<<<<<<<<<<
 *             if other.tzinfo is not None:
 *                 raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = (__pyx_t_4 == Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":392
 * 
 *         if self.tzinfo is None:
 *             if other.tzinfo is not None:             # <<<<<<<<<<<<<<
 *                 raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 *         elif other.tzinfo is None:
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = (__pyx_t_4 != Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":393
 *         if self.tzinfo is None:
 *             if other.tzinfo is not None:
 *                 raise Exception('Cannot compare tz-naive and tz-aware timestamps')             # <<<<<<<<<<<<<<
 *         elif other.tzinfo is None:
 *             raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 */
      __pyx_t_4 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_39), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":394
 *             if other.tzinfo is not None:
 *                 raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 *         elif other.tzinfo is None:             # <<<<<<<<<<<<<<
 *             raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = (__pyx_t_4 == Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":395
 *                 raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 *         elif other.tzinfo is None:
 *             raise Exception('Cannot compare tz-naive and tz-aware timestamps')             # <<<<<<<<<<<<<<
 * 
 *         if op == 2: # ==
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":407
 *         elif op == 4: # >
 *             return self.value > ots.value
 *         elif op == 5: # >=             # <<<<<<<<<<<<<<
 *             return self.value >= ots.value
 * 
 */
  switch (__pyx_v_op) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":397
 *             raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 * 
 *         if op == 2: # ==             # <<<<<<<<<<<<<<
 *             return self.value == ots.value
 *         elif op == 3: # !=
 */
    case 2:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":398
 * 
 *         if op == 2: # ==
 *             return self.value == ots.value             # <<<<<<<<<<<<<<
 *         elif op == 3: # !=
 *             return self.value != ots.value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->value == __pyx_v_ots->value)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":399
 *         if op == 2: # ==
 *             return self.value == ots.value
 *         elif op == 3: # !=             # <<<<<<<<<<<<<<
 *             return self.value != ots.value
 *         elif op == 0: # <
 */
    case 3:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":400
 *             return self.value == ots.value
 *         elif op == 3: # !=
 *             return self.value != ots.value             # <<<<<<<<<<<<<<
 *         elif op == 0: # <
 *             return self.value < ots.value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->value != __pyx_v_ots->value)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":401
 *         elif op == 3: # !=
 *             return self.value != ots.value
 *         elif op == 0: # <             # <<<<<<<<<<<<<<
 *             return self.value < ots.value
 *         elif op == 1: # <=
 */
    case 0:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":402
 *             return self.value != ots.value
 *         elif op == 0: # <
 *             return self.value < ots.value             # <<<<<<<<<<<<<<
 *         elif op == 1: # <=
 *             return self.value <= ots.value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->value < __pyx_v_ots->value)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":403
 *         elif op == 0: # <
 *             return self.value < ots.value
 *         elif op == 1: # <=             # <<<<<<<<<<<<<<
 *             return self.value <= ots.value
 *         elif op == 4: # >
 */
    case 1:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":404
 *             return self.value < ots.value
 *         elif op == 1: # <=
 *             return self.value <= ots.value             # <<<<<<<<<<<<<<
 *         elif op == 4: # >
 *             return self.value > ots.value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->value <= __pyx_v_ots->value)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":405
 *         elif op == 1: # <=
 *             return self.value <= ots.value
 *         elif op == 4: # >             # <<<<<<<<<<<<<<
 *             return self.value > ots.value
 *         elif op == 5: # >=
 */
    case 4:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":406
 *             return self.value <= ots.value
 *         elif op == 4: # >
 *             return self.value > ots.value             # <<<<<<<<<<<<<<
 *         elif op == 5: # >=
 *             return self.value >= ots.value
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->value > __pyx_v_ots->value)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":407
 *         elif op == 4: # >
 *             return self.value > ots.value
 *         elif op == 5: # >=             # <<<<<<<<<<<<<<
 *             return self.value >= ots.value
 * 
 */
    case 5:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":408
 *             return self.value > ots.value
 *         elif op == 5: # >=
 *             return self.value >= ots.value             # <<<<<<<<<<<<<<
 * 
 *     def __add__(self, other):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->value >= __pyx_v_ots->value)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    break;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib._Timestamp.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ots);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":410
 *             return self.value >= ots.value
 * 
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 *         if is_integer_object(other):
 *             if self.offset is None:
 */

static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_2__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_2__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_v_nanos = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__add__");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":411
 * 
 *     def __add__(self, other):
 *         if is_integer_object(other):             # <<<<<<<<<<<<<<
 *             if self.offset is None:
 *                 msg = ("Cannot add integral value to Timestamp "
 */
  __pyx_t_1 = is_integer_object(__pyx_v_other);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":412
 *     def __add__(self, other):
 *         if is_integer_object(other):
 *             if self.offset is None:             # <<<<<<<<<<<<<<
 *                 msg = ("Cannot add integral value to Timestamp "
 *                        "without offset.")
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = (__pyx_t_2 == Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":413
 *         if is_integer_object(other):
 *             if self.offset is None:
 *                 msg = ("Cannot add integral value to Timestamp "             # <<<<<<<<<<<<<<
 *                        "without offset.")
 *                 raise ValueError(msg)
 */
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_41));
      __pyx_v_msg = ((PyObject *)__pyx_kp_s_41);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":415
 *                 msg = ("Cannot add integral value to Timestamp "
 *                        "without offset.")
 *                 raise ValueError(msg)             # <<<<<<<<<<<<<<
 *             else:
 *                 return Timestamp((self.offset.__mul__(other)).apply(self))
 */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_msg);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_msg);
      __Pyx_GIVEREF(__pyx_v_msg);
      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":417
 *                 raise ValueError(msg)
 *             else:
 *                 return Timestamp((self.offset.__mul__(other)).apply(self))             # <<<<<<<<<<<<<<
 *         else:
 *             if isinstance(other, timedelta) or hasattr(other, 'delta'):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____mul__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__apply); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":419
 *                 return Timestamp((self.offset.__mul__(other)).apply(self))
 *         else:
 *             if isinstance(other, timedelta) or hasattr(other, 'delta'):             # <<<<<<<<<<<<<<
 *                 nanos = _delta_to_nanoseconds(other)
 *                 return Timestamp(self.value + nanos, tz=self.tzinfo)
 */
    __pyx_t_5 = ((PyObject *)((PyObject*)__pyx_ptype_8datetime_timedelta));
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_other, __pyx_t_5); 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_3) {
      __pyx_t_5 = ((PyObject *)__pyx_n_s__delta);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = PyObject_HasAttr(__pyx_v_other, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __pyx_t_7;
    } else {
      __pyx_t_8 = __pyx_t_3;
    }
    if (__pyx_t_8) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":420
 *         else:
 *             if isinstance(other, timedelta) or hasattr(other, 'delta'):
 *                 nanos = _delta_to_nanoseconds(other)             # <<<<<<<<<<<<<<
 *                 return Timestamp(self.value + nanos, tz=self.tzinfo)
 *             else:
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_42); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_v_nanos = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":421
 *             if isinstance(other, timedelta) or hasattr(other, 'delta'):
 *                 nanos = _delta_to_nanoseconds(other)
 *                 return Timestamp(self.value + nanos, tz=self.tzinfo)             # <<<<<<<<<<<<<<
 *             else:
 *                 result = datetime.__add__(self, other)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__value); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_v_nanos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__tz), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":423
 *                 return Timestamp(self.value + nanos, tz=self.tzinfo)
 *             else:
 *                 result = datetime.__add__(self, other)             # <<<<<<<<<<<<<<
 *                 if isinstance(result, datetime):
 *                     result = Timestamp(result)
 */
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s____add__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      __Pyx_INCREF(__pyx_v_other);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other);
      __Pyx_GIVEREF(__pyx_v_other);
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_v_result = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":424
 *             else:
 *                 result = datetime.__add__(self, other)
 *                 if isinstance(result, datetime):             # <<<<<<<<<<<<<<
 *                     result = Timestamp(result)
 *                     result.nanosecond = self.nanosecond
 */
      __pyx_t_6 = ((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime));
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_result, __pyx_t_6); 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_8) {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":425
 *                 result = datetime.__add__(self, other)
 *                 if isinstance(result, datetime):
 *                     result = Timestamp(result)             # <<<<<<<<<<<<<<
 *                     result.nanosecond = self.nanosecond
 *                 return result
 */
        __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __Pyx_INCREF(__pyx_v_result);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result);
        __Pyx_GIVEREF(__pyx_v_result);
        __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_result);
        __pyx_v_result = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":426
 *                 if isinstance(result, datetime):
 *                     result = Timestamp(result)
 *                     result.nanosecond = self.nanosecond             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__nanosecond); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s__nanosecond, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":427
 *                     result = Timestamp(result)
 *                     result.nanosecond = self.nanosecond
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *     def __sub__(self, other):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;
    }
    __pyx_L7:;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib._Timestamp.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_nanos);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":429
 *                 return result
 * 
 *     def __sub__(self, other):             # <<<<<<<<<<<<<<
 *         if is_integer_object(other):
 *             return self.__add__(-other)
 */

static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_3__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_3__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__sub__");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":430
 * 
 *     def __sub__(self, other):
 *         if is_integer_object(other):             # <<<<<<<<<<<<<<
 *             return self.__add__(-other)
 *         else:
 */
  __pyx_t_1 = is_integer_object(__pyx_v_other);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":431
 *     def __sub__(self, other):
 *         if is_integer_object(other):
 *             return self.__add__(-other)             # <<<<<<<<<<<<<<
 *         else:
 *             return datetime.__sub__(self, other)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____add__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Negative(__pyx_v_other); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":433
 *             return self.__add__(-other)
 *         else:
 *             return datetime.__sub__(self, other)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _get_field(self, field):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_8datetime_datetime)), __pyx_n_s____sub__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    __Pyx_INCREF(__pyx_v_other);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_other);
    __Pyx_GIVEREF(__pyx_v_other);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib._Timestamp.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":435
 *             return datetime.__sub__(self, other)
 * 
 *     cpdef _get_field(self, field):             # <<<<<<<<<<<<<<
 *         out = get_date_field(np.array([self.value], dtype=np.int64), field)
 *         return out[0]
 */

static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_4_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_10_Timestamp__get_field(struct __pyx_obj_6pandas_3lib__Timestamp *__pyx_v_self, PyObject *__pyx_v_field, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_out = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_field");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___get_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_10_Timestamp_4_get_field)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_field);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
      __Pyx_GIVEREF(__pyx_v_field);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":436
 * 
 *     cpdef _get_field(self, field):
 *         out = get_date_field(np.array([self.value], dtype=np.int64), field)             # <<<<<<<<<<<<<<
 *         return out[0]
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_date_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_self->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_field);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_field);
  __Pyx_GIVEREF(__pyx_v_field);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_out = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":437
 *     cpdef _get_field(self, field):
 *         out = get_date_field(np.array([self.value], dtype=np.int64), field)
 *         return out[0]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_out, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib._Timestamp._get_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":435
 *             return datetime.__sub__(self, other)
 * 
 *     cpdef _get_field(self, field):             # <<<<<<<<<<<<<<
 *         out = get_date_field(np.array([self.value], dtype=np.int64), field)
 *         return out[0]
 */

static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_4_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_4_get_field(PyObject *__pyx_v_self, PyObject *__pyx_v_field) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_field");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib__Timestamp *)((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->__pyx_vtab)->_get_field(((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self), __pyx_v_field, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._Timestamp._get_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":367
 * cdef class _Timestamp(datetime):
 *     cdef readonly:
 *         int64_t value, nanosecond             # <<<<<<<<<<<<<<
 *         object offset       # frequency reference
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_5value___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_5value___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._Timestamp.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_10nanosecond___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_10nanosecond___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->nanosecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._Timestamp.nanosecond.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":368
 *     cdef readonly:
 *         int64_t value, nanosecond
 *         object offset       # frequency reference             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */

static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_6offset___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_10_Timestamp_6offset___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->offset);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_self)->offset;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":442
 * cdef class _NaT(_Timestamp):
 * 
 *     def __richcmp__(_NaT self, object other, int op):             # <<<<<<<<<<<<<<
 *         # if not isinstance(other, (_NaT, _Timestamp)):
 *         #     raise TypeError('Cannot compare %s with NaT' % type(other))
 */

static PyObject *__pyx_pf_6pandas_3lib_4_NaT___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_4_NaT___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_3lib__NaT, 1, "self", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":456
 *         elif op == 4: # >
 *             return False
 *         elif op == 5: # >=             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  switch (__pyx_v_op) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":446
 *         #     raise TypeError('Cannot compare %s with NaT' % type(other))
 * 
 *         if op == 2: # ==             # <<<<<<<<<<<<<<
 *             return False
 *         elif op == 3: # !=
 */
    case 2:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":447
 * 
 *         if op == 2: # ==
 *             return False             # <<<<<<<<<<<<<<
 *         elif op == 3: # !=
 *             return True
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":448
 *         if op == 2: # ==
 *             return False
 *         elif op == 3: # !=             # <<<<<<<<<<<<<<
 *             return True
 *         elif op == 0: # <
 */
    case 3:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":449
 *             return False
 *         elif op == 3: # !=
 *             return True             # <<<<<<<<<<<<<<
 *         elif op == 0: # <
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":450
 *         elif op == 3: # !=
 *             return True
 *         elif op == 0: # <             # <<<<<<<<<<<<<<
 *             return False
 *         elif op == 1: # <=
 */
    case 0:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":451
 *             return True
 *         elif op == 0: # <
 *             return False             # <<<<<<<<<<<<<<
 *         elif op == 1: # <=
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":452
 *         elif op == 0: # <
 *             return False
 *         elif op == 1: # <=             # <<<<<<<<<<<<<<
 *             return False
 *         elif op == 4: # >
 */
    case 1:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":453
 *             return False
 *         elif op == 1: # <=
 *             return False             # <<<<<<<<<<<<<<
 *         elif op == 4: # >
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":454
 *         elif op == 1: # <=
 *             return False
 *         elif op == 4: # >             # <<<<<<<<<<<<<<
 *             return False
 *         elif op == 5: # >=
 */
    case 4:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":455
 *             return False
 *         elif op == 4: # >
 *             return False             # <<<<<<<<<<<<<<
 *         elif op == 5: # >=
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":456
 *         elif op == 4: # >
 *             return False
 *         elif op == 5: # >=             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    case 5:

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":457
 *             return False
 *         elif op == 5: # >=
 *             return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._NaT.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":462
 * 
 * 
 * def _delta_to_nanoseconds(delta):             # <<<<<<<<<<<<<<
 *     try:
 *         delta = delta.delta
 */

static PyObject *__pyx_pf_6pandas_3lib_36_delta_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_delta); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_36_delta_to_nanoseconds = {__Pyx_NAMESTR("_delta_to_nanoseconds"), (PyCFunction)__pyx_pf_6pandas_3lib_36_delta_to_nanoseconds, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_36_delta_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_delta_to_nanoseconds");
  __pyx_self = __pyx_self;
  __Pyx_INCREF(__pyx_v_delta);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":463
 * 
 * def _delta_to_nanoseconds(delta):
 *     try:             # <<<<<<<<<<<<<<
 *         delta = delta.delta
 *     except:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":464
 * def _delta_to_nanoseconds(delta):
 *     try:
 *         delta = delta.delta             # <<<<<<<<<<<<<<
 *     except:
 *         pass
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_delta, __pyx_n_s__delta); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_v_delta);
      __pyx_v_delta = __pyx_t_4;
      __pyx_t_4 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":465
 *     try:
 *         delta = delta.delta
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 *     return (delta.days * 24 * 60 * 60 * 1000000
 */
    /*except:*/ {
      PyErr_Restore(0,0,0);
      goto __pyx_L6_exception_handled;
    }
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L12_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":467
 *     except:
 *         pass
 *     return (delta.days * 24 * 60 * 60 * 1000000             # <<<<<<<<<<<<<<
 *             + delta.seconds * 1000000
 *             + delta.microseconds) * 1000
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":468
 *         pass
 *     return (delta.days * 24 * 60 * 60 * 1000000
 *             + delta.seconds * 1000000             # <<<<<<<<<<<<<<
 *             + delta.microseconds) * 1000
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_delta, __pyx_n_s__days); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_int_24); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_int_60); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_int_60); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_int_1000000); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_delta, __pyx_n_s__seconds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_5, __pyx_int_1000000); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":469
 *     return (delta.days * 24 * 60 * 60 * 1000000
 *             + delta.seconds * 1000000
 *             + delta.microseconds) * 1000             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_delta, __pyx_n_s__microseconds); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib._delta_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_delta);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":480
 * 
 *     property value:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.value
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_9_TSObject_5value___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_9_TSObject_5value___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":481
 *     property value:
 *         def __get__(self):
 *             return self.value             # <<<<<<<<<<<<<<
 * 
 * # helper to extract datetime and int64 from several different possibilities
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(((struct __pyx_obj_6pandas_3lib__TSObject *)__pyx_v_self)->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._TSObject.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":484
 * 
 * # helper to extract datetime and int64 from several different possibilities
 * cpdef convert_to_tsobject(object ts, object tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Extract datetime and int64 from any of:
 */

static PyObject *__pyx_pf_6pandas_3lib_37convert_to_tsobject(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_convert_to_tsobject(PyObject *__pyx_v_ts, int __pyx_skip_dispatch, struct __pyx_opt_args_6pandas_3lib_convert_to_tsobject *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  struct __pyx_obj_6pandas_3lib__TSObject *__pyx_v_obj = 0;
  int __pyx_v_utc_convert;
  PyObject *__pyx_v_trans = NULL;
  PyObject *__pyx_v_deltas = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_inf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __pyx_t_5numpy_int64_t __pyx_t_6;
  npy_datetime __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_to_tsobject");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }
  __Pyx_INCREF(__pyx_v_ts);
  __Pyx_INCREF(__pyx_v_tz);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":496
 *     cdef:
 *         _TSObject obj
 *         bint utc_convert = 1             # <<<<<<<<<<<<<<
 * 
 *     if tz is not None:
 */
  __pyx_v_utc_convert = 1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":498
 *         bint utc_convert = 1
 * 
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         if isinstance(tz, basestring):
 *             tz = pytz.timezone(tz)
 */
  __pyx_t_1 = (__pyx_v_tz != Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":499
 * 
 *     if tz is not None:
 *         if isinstance(tz, basestring):             # <<<<<<<<<<<<<<
 *             tz = pytz.timezone(tz)
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__basestring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_tz, __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":500
 *     if tz is not None:
 *         if isinstance(tz, basestring):
 *             tz = pytz.timezone(tz)             # <<<<<<<<<<<<<<
 * 
 *     obj = _TSObject()
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__timezone); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_tz);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tz);
      __Pyx_GIVEREF(__pyx_v_tz);
      __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_tz);
      __pyx_v_tz = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":502
 *             tz = pytz.timezone(tz)
 * 
 *     obj = _TSObject()             # <<<<<<<<<<<<<<
 * 
 *     if is_datetime64_object(ts):
 */
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__TSObject)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_obj = ((struct __pyx_obj_6pandas_3lib__TSObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":504
 *     obj = _TSObject()
 * 
 *     if is_datetime64_object(ts):             # <<<<<<<<<<<<<<
 *         obj.value = _get_datetime64_nanos(ts)
 *         pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts)
 */
  __pyx_t_5 = is_datetime64_object(__pyx_v_ts);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":505
 * 
 *     if is_datetime64_object(ts):
 *         obj.value = _get_datetime64_nanos(ts)             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts)
 *     elif is_integer_object(ts):
 */
    __pyx_t_4 = __pyx_f_6pandas_3lib__get_datetime64_nanos(__pyx_v_ts); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_obj->value = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":506
 *     if is_datetime64_object(ts):
 *         obj.value = _get_datetime64_nanos(ts)
 *         pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts)             # <<<<<<<<<<<<<<
 *     elif is_integer_object(ts):
 *         obj.value = ts
 */
    pandas_datetime_to_datetimestruct(__pyx_v_obj->value, PANDAS_FR_ns, (&__pyx_v_obj->dts));
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":507
 *         obj.value = _get_datetime64_nanos(ts)
 *         pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts)
 *     elif is_integer_object(ts):             # <<<<<<<<<<<<<<
 *         obj.value = ts
 *         pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts)
 */
  __pyx_t_5 = is_integer_object(__pyx_v_ts);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":508
 *         pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, &obj.dts)
 *     elif is_integer_object(ts):
 *         obj.value = ts             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts)
 *     elif util.is_string_object(ts):
 */
    __pyx_t_6 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_obj->value = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":509
 *     elif is_integer_object(ts):
 *         obj.value = ts
 *         pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts)             # <<<<<<<<<<<<<<
 *     elif util.is_string_object(ts):
 *         _string_to_dts(ts, &obj.dts)
 */
    __pyx_t_7 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_ts); if (unlikely((__pyx_t_7 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    pandas_datetime_to_datetimestruct(__pyx_t_7, PANDAS_FR_ns, (&__pyx_v_obj->dts));
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":510
 *         obj.value = ts
 *         pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts)
 *     elif util.is_string_object(ts):             # <<<<<<<<<<<<<<
 *         _string_to_dts(ts, &obj.dts)
 *         obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts)
 */
  __pyx_t_5 = is_string_object(__pyx_v_ts);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":511
 *         pandas_datetime_to_datetimestruct(ts, PANDAS_FR_ns, &obj.dts)
 *     elif util.is_string_object(ts):
 *         _string_to_dts(ts, &obj.dts)             # <<<<<<<<<<<<<<
 *         obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts)
 *     elif PyDateTime_Check(ts):
 */
    __pyx_t_4 = __pyx_f_6pandas_3lib__string_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":512
 *     elif util.is_string_object(ts):
 *         _string_to_dts(ts, &obj.dts)
 *         obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts)             # <<<<<<<<<<<<<<
 *     elif PyDateTime_Check(ts):
 *         if tz is not None:
 */
    __pyx_v_obj->value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_obj->dts));
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":513
 *         _string_to_dts(ts, &obj.dts)
 *         obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts)
 *     elif PyDateTime_Check(ts):             # <<<<<<<<<<<<<<
 *         if tz is not None:
 *             # sort of a temporary hack
 */
  __pyx_t_1 = PyDateTime_Check(__pyx_v_ts);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":514
 *         obj.value = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &obj.dts)
 *     elif PyDateTime_Check(ts):
 *         if tz is not None:             # <<<<<<<<<<<<<<
 *             # sort of a temporary hack
 *             if ts.tzinfo is not None:
 */
    __pyx_t_1 = (__pyx_v_tz != Py_None);
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":516
 *         if tz is not None:
 *             # sort of a temporary hack
 *             if ts.tzinfo is not None:             # <<<<<<<<<<<<<<
 *                 ts = tz.normalize(ts)
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_ts, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = (__pyx_t_4 != Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":517
 *             # sort of a temporary hack
 *             if ts.tzinfo is not None:
 *                 ts = tz.normalize(ts)             # <<<<<<<<<<<<<<
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *                 obj.tzinfo = ts.tzinfo
 */
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_tz, __pyx_n_s__normalize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        __Pyx_INCREF(__pyx_v_ts);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ts);
        __Pyx_GIVEREF(__pyx_v_ts);
        __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_v_ts);
        __pyx_v_ts = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":518
 *             if ts.tzinfo is not None:
 *                 ts = tz.normalize(ts)
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)             # <<<<<<<<<<<<<<
 *                 obj.tzinfo = ts.tzinfo
 *             elif tz is not pytz.utc:
 */
        __pyx_v_obj->value = __pyx_f_6pandas_3lib__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts));

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":519
 *                 ts = tz.normalize(ts)
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *                 obj.tzinfo = ts.tzinfo             # <<<<<<<<<<<<<<
 *             elif tz is not pytz.utc:
 *                 ts = tz.localize(ts)
 */
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_ts, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_v_obj->tzinfo);
        __Pyx_DECREF(__pyx_v_obj->tzinfo);
        __pyx_v_obj->tzinfo = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L7;
      }

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":520
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *                 obj.tzinfo = ts.tzinfo
 *             elif tz is not pytz.utc:             # <<<<<<<<<<<<<<
 *                 ts = tz.localize(ts)
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__utc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_1 = (__pyx_v_tz != __pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_1) {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":521
 *                 obj.tzinfo = ts.tzinfo
 *             elif tz is not pytz.utc:
 *                 ts = tz.localize(ts)             # <<<<<<<<<<<<<<
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *                 obj.value -= _delta_to_nanoseconds(ts.tzinfo._utcoffset)
 */
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_tz, __pyx_n_s__localize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __Pyx_INCREF(__pyx_v_ts);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ts);
        __Pyx_GIVEREF(__pyx_v_ts);
        __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_v_ts);
        __pyx_v_ts = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":522
 *             elif tz is not pytz.utc:
 *                 ts = tz.localize(ts)
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)             # <<<<<<<<<<<<<<
 *                 obj.value -= _delta_to_nanoseconds(ts.tzinfo._utcoffset)
 *                 obj.tzinfo = ts.tzinfo
 */
        __pyx_v_obj->value = __pyx_f_6pandas_3lib__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts));

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":523
 *                 ts = tz.localize(ts)
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *                 obj.value -= _delta_to_nanoseconds(ts.tzinfo._utcoffset)             # <<<<<<<<<<<<<<
 *                 obj.tzinfo = ts.tzinfo
 *             else:
 */
        __pyx_t_4 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_42); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_ts, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___utcoffset); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_t_2 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_6 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_obj->value = __pyx_t_6;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":524
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *                 obj.value -= _delta_to_nanoseconds(ts.tzinfo._utcoffset)
 *                 obj.tzinfo = ts.tzinfo             # <<<<<<<<<<<<<<
 *             else:
 *                 # UTC
 */
        __pyx_t_2 = PyObject_GetAttr(__pyx_v_ts, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_v_obj->tzinfo);
        __Pyx_DECREF(__pyx_v_obj->tzinfo);
        __pyx_v_obj->tzinfo = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L7;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":527
 *             else:
 *                 # UTC
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)             # <<<<<<<<<<<<<<
 *                 obj.tzinfo = tz
 *         else:
 */
        __pyx_v_obj->value = __pyx_f_6pandas_3lib__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts));

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":528
 *                 # UTC
 *                 obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *                 obj.tzinfo = tz             # <<<<<<<<<<<<<<
 *         else:
 *             obj.value = _pydatetime_to_dts(ts, &obj.dts)
 */
        __Pyx_INCREF(__pyx_v_tz);
        __Pyx_GIVEREF(__pyx_v_tz);
        __Pyx_GOTREF(__pyx_v_obj->tzinfo);
        __Pyx_DECREF(__pyx_v_obj->tzinfo);
        __pyx_v_obj->tzinfo = __pyx_v_tz;
      }
      __pyx_L7:;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":530
 *                 obj.tzinfo = tz
 *         else:
 *             obj.value = _pydatetime_to_dts(ts, &obj.dts)             # <<<<<<<<<<<<<<
 *             obj.tzinfo = ts.tzinfo
 *             if obj.tzinfo is not None:
 */
      __pyx_v_obj->value = __pyx_f_6pandas_3lib__pydatetime_to_dts(__pyx_v_ts, (&__pyx_v_obj->dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":531
 *         else:
 *             obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *             obj.tzinfo = ts.tzinfo             # <<<<<<<<<<<<<<
 *             if obj.tzinfo is not None:
 *                 obj.value -= _delta_to_nanoseconds(obj.tzinfo._utcoffset)
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_ts, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_obj->tzinfo);
      __Pyx_DECREF(__pyx_v_obj->tzinfo);
      __pyx_v_obj->tzinfo = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":532
 *             obj.value = _pydatetime_to_dts(ts, &obj.dts)
 *             obj.tzinfo = ts.tzinfo
 *             if obj.tzinfo is not None:             # <<<<<<<<<<<<<<
 *                 obj.value -= _delta_to_nanoseconds(obj.tzinfo._utcoffset)
 *         _check_dts_bounds(obj.value, &obj.dts)
 */
      __pyx_t_1 = (__pyx_v_obj->tzinfo != Py_None);
      if (__pyx_t_1) {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":533
 *             obj.tzinfo = ts.tzinfo
 *             if obj.tzinfo is not None:
 *                 obj.value -= _delta_to_nanoseconds(obj.tzinfo._utcoffset)             # <<<<<<<<<<<<<<
 *         _check_dts_bounds(obj.value, &obj.dts)
 *         return obj
 */
        __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s_42); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_obj->tzinfo, __pyx_n_s___utcoffset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_6 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_v_obj->value = __pyx_t_6;
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":534
 *             if obj.tzinfo is not None:
 *                 obj.value -= _delta_to_nanoseconds(obj.tzinfo._utcoffset)
 *         _check_dts_bounds(obj.value, &obj.dts)             # <<<<<<<<<<<<<<
 *         return obj
 *     elif PyDate_Check(ts):
 */
    __pyx_t_3 = __pyx_f_6pandas_3lib__check_dts_bounds(__pyx_v_obj->value, (&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":535
 *                 obj.value -= _delta_to_nanoseconds(obj.tzinfo._utcoffset)
 *         _check_dts_bounds(obj.value, &obj.dts)
 *         return obj             # <<<<<<<<<<<<<<
 *     elif PyDate_Check(ts):
 *         obj.value  = _date_to_datetime64(ts, &obj.dts)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_obj));
    __pyx_r = ((PyObject *)__pyx_v_obj);
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":536
 *         _check_dts_bounds(obj.value, &obj.dts)
 *         return obj
 *     elif PyDate_Check(ts):             # <<<<<<<<<<<<<<
 *         obj.value  = _date_to_datetime64(ts, &obj.dts)
 *     else:
 */
  __pyx_t_1 = PyDate_Check(__pyx_v_ts);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":537
 *         return obj
 *     elif PyDate_Check(ts):
 *         obj.value  = _date_to_datetime64(ts, &obj.dts)             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("Could not construct Timestamp from argument %s" %
 */
    __pyx_v_obj->value = __pyx_f_6pandas_3lib__date_to_datetime64(__pyx_v_ts, (&__pyx_v_obj->dts));
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":540
 *     else:
 *         raise ValueError("Could not construct Timestamp from argument %s" %
 *                          type(ts))             # <<<<<<<<<<<<<<
 * 
 *     if obj.value != NPY_NAT:
 */
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_43), ((PyObject *)Py_TYPE(__pyx_v_ts))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":542
 *                          type(ts))
 * 
 *     if obj.value != NPY_NAT:             # <<<<<<<<<<<<<<
 *         _check_dts_bounds(obj.value, &obj.dts)
 * 
 */
  __pyx_t_1 = (__pyx_v_obj->value != __pyx_v_6pandas_3lib_NPY_NAT);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":543
 * 
 *     if obj.value != NPY_NAT:
 *         _check_dts_bounds(obj.value, &obj.dts)             # <<<<<<<<<<<<<<
 * 
 *     if tz is not None:
 */
    __pyx_t_3 = __pyx_f_6pandas_3lib__check_dts_bounds(__pyx_v_obj->value, (&__pyx_v_obj->dts)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":545
 *         _check_dts_bounds(obj.value, &obj.dts)
 * 
 *     if tz is not None:             # <<<<<<<<<<<<<<
 *         if tz is pytz.utc:
 *             obj.tzinfo = tz
 */
  __pyx_t_1 = (__pyx_v_tz != Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":546
 * 
 *     if tz is not None:
 *         if tz is pytz.utc:             # <<<<<<<<<<<<<<
 *             obj.tzinfo = tz
 *         else:
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__utc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_v_tz == __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":547
 *     if tz is not None:
 *         if tz is pytz.utc:
 *             obj.tzinfo = tz             # <<<<<<<<<<<<<<
 *         else:
 *             # Adjust datetime64 timestamp, recompute datetimestruct
 */
      __Pyx_INCREF(__pyx_v_tz);
      __Pyx_GIVEREF(__pyx_v_tz);
      __Pyx_GOTREF(__pyx_v_obj->tzinfo);
      __Pyx_DECREF(__pyx_v_obj->tzinfo);
      __pyx_v_obj->tzinfo = __pyx_v_tz;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":550
 *         else:
 *             # Adjust datetime64 timestamp, recompute datetimestruct
 *             trans = _get_transitions(tz)             # <<<<<<<<<<<<<<
 *             deltas = _get_deltas(tz)
 *             pos = trans.searchsorted(obj.value, side='right') - 1
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_transitions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_v_tz);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tz);
      __Pyx_GIVEREF(__pyx_v_tz);
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_v_trans = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":551
 *             # Adjust datetime64 timestamp, recompute datetimestruct
 *             trans = _get_transitions(tz)
 *             deltas = _get_deltas(tz)             # <<<<<<<<<<<<<<
 *             pos = trans.searchsorted(obj.value, side='right') - 1
 *             inf = tz._transition_info[pos]
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_deltas); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_v_tz);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tz);
      __Pyx_GIVEREF(__pyx_v_tz);
      __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_v_deltas = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":552
 *             trans = _get_transitions(tz)
 *             deltas = _get_deltas(tz)
 *             pos = trans.searchsorted(obj.value, side='right') - 1             # <<<<<<<<<<<<<<
 *             inf = tz._transition_info[pos]
 * 
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_trans, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__right)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_pos = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":553
 *             deltas = _get_deltas(tz)
 *             pos = trans.searchsorted(obj.value, side='right') - 1
 *             inf = tz._transition_info[pos]             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(obj.value + deltas[pos],
 */
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_tz, __pyx_n_s___transition_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_pos); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_inf = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":555
 *             inf = tz._transition_info[pos]
 * 
 *             pandas_datetime_to_datetimestruct(obj.value + deltas[pos],             # <<<<<<<<<<<<<<
 *                                               PANDAS_FR_ns, &obj.dts)
 *             obj.tzinfo = tz._tzinfos[inf]
 */
      __pyx_t_8 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_obj->value); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyObject_GetItem(__pyx_v_deltas, __pyx_v_pos); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_7 == (npy_datetime)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":556
 * 
 *             pandas_datetime_to_datetimestruct(obj.value + deltas[pos],
 *                                               PANDAS_FR_ns, &obj.dts)             # <<<<<<<<<<<<<<
 *             obj.tzinfo = tz._tzinfos[inf]
 * 
 */
      pandas_datetime_to_datetimestruct(__pyx_t_7, PANDAS_FR_ns, (&__pyx_v_obj->dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":557
 *             pandas_datetime_to_datetimestruct(obj.value + deltas[pos],
 *                                               PANDAS_FR_ns, &obj.dts)
 *             obj.tzinfo = tz._tzinfos[inf]             # <<<<<<<<<<<<<<
 * 
 *     return obj
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_tz, __pyx_n_s___tzinfos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_v_inf); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_obj->tzinfo);
      __Pyx_DECREF(__pyx_v_obj->tzinfo);
      __pyx_v_obj->tzinfo = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":559
 *             obj.tzinfo = tz._tzinfos[inf]
 * 
 *     return obj             # <<<<<<<<<<<<<<
 * 
 * cdef int64_t _NS_LOWER_BOUND = -9223285636854775809LL
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_obj));
  __pyx_r = ((PyObject *)__pyx_v_obj);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pandas.lib.convert_to_tsobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_trans);
  __Pyx_XDECREF(__pyx_v_deltas);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_inf);
  __Pyx_XDECREF(__pyx_v_ts);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":484
 * 
 * # helper to extract datetime and int64 from several different possibilities
 * cpdef convert_to_tsobject(object ts, object tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Extract datetime and int64 from any of:
 */

static PyObject *__pyx_pf_6pandas_3lib_37convert_to_tsobject(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_37convert_to_tsobject[] = "\n    Extract datetime and int64 from any of:\n        - np.int64\n        - np.datetime64\n        - python int or long object\n        - iso8601 string object\n        - python datetime object\n        - another timestamp object\n    ";
static PyObject *__pyx_pf_6pandas_3lib_37convert_to_tsobject(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ts = 0;
  PyObject *__pyx_v_tz = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_6pandas_3lib_convert_to_tsobject __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ts,&__pyx_n_s__tz,0};
  __Pyx_RefNannySetupContext("convert_to_tsobject");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ts);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "convert_to_tsobject") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ts = values[0];
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convert_to_tsobject", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.convert_to_tsobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.tz = __pyx_v_tz;
  __pyx_t_1 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_v_ts, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.convert_to_tsobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":564
 * cdef int64_t _NS_UPPER_BOUND = -9223372036854775807LL
 * 
 * cdef inline _check_dts_bounds(int64_t value, pandas_datetimestruct *dts):             # <<<<<<<<<<<<<<
 *     cdef pandas_datetimestruct dts2
 *     if dts.year <= 1677 or dts.year >= 2262:
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__check_dts_bounds(__pyx_t_5numpy_int64_t __pyx_v_value, pandas_datetimestruct *__pyx_v_dts) {
  pandas_datetimestruct __pyx_v_dts2;
  PyObject *__pyx_v_fmt = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_dts_bounds");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":566
 * cdef inline _check_dts_bounds(int64_t value, pandas_datetimestruct *dts):
 *     cdef pandas_datetimestruct dts2
 *     if dts.year <= 1677 or dts.year >= 2262:             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(value, PANDAS_FR_ns, &dts2)
 *         if dts2.year != dts.year:
 */
  __pyx_t_1 = (__pyx_v_dts->year <= 1677);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_dts->year >= 2262);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":567
 *     cdef pandas_datetimestruct dts2
 *     if dts.year <= 1677 or dts.year >= 2262:
 *         pandas_datetime_to_datetimestruct(value, PANDAS_FR_ns, &dts2)             # <<<<<<<<<<<<<<
 *         if dts2.year != dts.year:
 *             fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month,
 */
    pandas_datetime_to_datetimestruct(__pyx_v_value, PANDAS_FR_ns, (&__pyx_v_dts2));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":568
 *     if dts.year <= 1677 or dts.year >= 2262:
 *         pandas_datetime_to_datetimestruct(value, PANDAS_FR_ns, &dts2)
 *         if dts2.year != dts.year:             # <<<<<<<<<<<<<<
 *             fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month,
 *                                                    dts.day, dts.hour,
 */
    __pyx_t_3 = (__pyx_v_dts2.year != __pyx_v_dts->year);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":569
 *         pandas_datetime_to_datetimestruct(value, PANDAS_FR_ns, &dts2)
 *         if dts2.year != dts.year:
 *             fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month,             # <<<<<<<<<<<<<<
 *                                                    dts.day, dts.hour,
 *                                                    dts.min, dts.sec)
 */
      __pyx_t_4 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_dts->year); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts->month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":570
 *         if dts2.year != dts.year:
 *             fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month,
 *                                                    dts.day, dts.hour,             # <<<<<<<<<<<<<<
 *                                                    dts.min, dts.sec)
 * 
 */
      __pyx_t_6 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts->day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts->hour); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":571
 *             fmt = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (dts.year, dts.month,
 *                                                    dts.day, dts.hour,
 *                                                    dts.min, dts.sec)             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError('Out of bounds nanosecond timestamp: %s' % fmt)
 */
      __pyx_t_8 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts->min); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyInt_to_py_npy_int32(__pyx_v_dts->sec); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_10));
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __pyx_v_fmt = ((PyObject *)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":573
 *                                                    dts.min, dts.sec)
 * 
 *             raise ValueError('Out of bounds nanosecond timestamp: %s' % fmt)             # <<<<<<<<<<<<<<
 * 
 * # elif isinstance(ts, _Timestamp):
 */
      __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_44), __pyx_v_fmt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_10));
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
      __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pandas.lib._check_dts_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fmt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":584
 * #     obj.dtval = _dts_to_pydatetime(&obj.dts)
 * 
 * cdef inline object _datetime64_to_datetime(int64_t val):             # <<<<<<<<<<<<<<
 *     cdef pandas_datetimestruct dts
 *     pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts)
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__datetime64_to_datetime(__pyx_t_5numpy_int64_t __pyx_v_val) {
  pandas_datetimestruct __pyx_v_dts;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_datetime64_to_datetime");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":586
 * cdef inline object _datetime64_to_datetime(int64_t val):
 *     cdef pandas_datetimestruct dts
 *     pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *     return _dts_to_pydatetime(&dts)
 * 
 */
  pandas_datetime_to_datetimestruct(__pyx_v_val, PANDAS_FR_ns, (&__pyx_v_dts));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":587
 *     cdef pandas_datetimestruct dts
 *     pandas_datetime_to_datetimestruct(val, PANDAS_FR_ns, &dts)
 *     return _dts_to_pydatetime(&dts)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib__dts_to_pydatetime((&__pyx_v_dts)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._datetime64_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":589
 *     return _dts_to_pydatetime(&dts)
 * 
 * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts):             # <<<<<<<<<<<<<<
 *     return <object> PyDateTime_FromDateAndTime(dts.year, dts.month,
 *                                                dts.day, dts.hour,
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__dts_to_pydatetime(pandas_datetimestruct *__pyx_v_dts) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dts_to_pydatetime");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":590
 * 
 * cdef inline object _dts_to_pydatetime(pandas_datetimestruct *dts):
 *     return <object> PyDateTime_FromDateAndTime(dts.year, dts.month,             # <<<<<<<<<<<<<<
 *                                                dts.day, dts.hour,
 *                                                dts.min, dts.sec, dts.us)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":592
 *     return <object> PyDateTime_FromDateAndTime(dts.year, dts.month,
 *                                                dts.day, dts.hour,
 *                                                dts.min, dts.sec, dts.us)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts):
 */
  __pyx_t_1 = PyDateTime_FromDateAndTime(__pyx_v_dts->year, __pyx_v_dts->month, __pyx_v_dts->day, __pyx_v_dts->hour, __pyx_v_dts->min, __pyx_v_dts->sec, __pyx_v_dts->us); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._dts_to_pydatetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":594
 *                                                dts.min, dts.sec, dts.us)
 * 
 * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts):             # <<<<<<<<<<<<<<
 *     dts.year = PyDateTime_GET_YEAR(val)
 *     dts.month = PyDateTime_GET_MONTH(val)
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib__pydatetime_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_pydatetime_to_dts");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":595
 * 
 * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts):
 *     dts.year = PyDateTime_GET_YEAR(val)             # <<<<<<<<<<<<<<
 *     dts.month = PyDateTime_GET_MONTH(val)
 *     dts.day = PyDateTime_GET_DAY(val)
 */
  if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_val;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":596
 * cdef inline int64_t _pydatetime_to_dts(object val, pandas_datetimestruct *dts):
 *     dts.year = PyDateTime_GET_YEAR(val)
 *     dts.month = PyDateTime_GET_MONTH(val)             # <<<<<<<<<<<<<<
 *     dts.day = PyDateTime_GET_DAY(val)
 *     dts.hour = PyDateTime_DATE_GET_HOUR(val)
 */
  if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_val;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":597
 *     dts.year = PyDateTime_GET_YEAR(val)
 *     dts.month = PyDateTime_GET_MONTH(val)
 *     dts.day = PyDateTime_GET_DAY(val)             # <<<<<<<<<<<<<<
 *     dts.hour = PyDateTime_DATE_GET_HOUR(val)
 *     dts.min = PyDateTime_DATE_GET_MINUTE(val)
 */
  if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_val;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":598
 *     dts.month = PyDateTime_GET_MONTH(val)
 *     dts.day = PyDateTime_GET_DAY(val)
 *     dts.hour = PyDateTime_DATE_GET_HOUR(val)             # <<<<<<<<<<<<<<
 *     dts.min = PyDateTime_DATE_GET_MINUTE(val)
 *     dts.sec = PyDateTime_DATE_GET_SECOND(val)
 */
  __pyx_v_dts->hour = PyDateTime_DATE_GET_HOUR(__pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":599
 *     dts.day = PyDateTime_GET_DAY(val)
 *     dts.hour = PyDateTime_DATE_GET_HOUR(val)
 *     dts.min = PyDateTime_DATE_GET_MINUTE(val)             # <<<<<<<<<<<<<<
 *     dts.sec = PyDateTime_DATE_GET_SECOND(val)
 *     dts.us = PyDateTime_DATE_GET_MICROSECOND(val)
 */
  __pyx_v_dts->min = PyDateTime_DATE_GET_MINUTE(__pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":600
 *     dts.hour = PyDateTime_DATE_GET_HOUR(val)
 *     dts.min = PyDateTime_DATE_GET_MINUTE(val)
 *     dts.sec = PyDateTime_DATE_GET_SECOND(val)             # <<<<<<<<<<<<<<
 *     dts.us = PyDateTime_DATE_GET_MICROSECOND(val)
 *     dts.ps = dts.as = 0
 */
  __pyx_v_dts->sec = PyDateTime_DATE_GET_SECOND(__pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":601
 *     dts.min = PyDateTime_DATE_GET_MINUTE(val)
 *     dts.sec = PyDateTime_DATE_GET_SECOND(val)
 *     dts.us = PyDateTime_DATE_GET_MICROSECOND(val)             # <<<<<<<<<<<<<<
 *     dts.ps = dts.as = 0
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
 */
  __pyx_v_dts->us = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":602
 *     dts.sec = PyDateTime_DATE_GET_SECOND(val)
 *     dts.us = PyDateTime_DATE_GET_MICROSECOND(val)
 *     dts.ps = dts.as = 0             # <<<<<<<<<<<<<<
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
 * 
 */
  __pyx_v_dts->ps = 0;
  __pyx_v_dts->as = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":603
 *     dts.us = PyDateTime_DATE_GET_MICROSECOND(val)
 *     dts.ps = dts.as = 0
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int64_t _dtlike_to_datetime64(object val,
 */
  __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pandas.lib._pydatetime_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":605
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
 * 
 * cdef inline int64_t _dtlike_to_datetime64(object val,             # <<<<<<<<<<<<<<
 *                                           pandas_datetimestruct *dts):
 *     dts.year = val.year
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib__dtlike_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  npy_int64 __pyx_t_2;
  npy_int32 __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_dtlike_to_datetime64");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":607
 * cdef inline int64_t _dtlike_to_datetime64(object val,
 *                                           pandas_datetimestruct *dts):
 *     dts.year = val.year             # <<<<<<<<<<<<<<
 *     dts.month = val.month
 *     dts.day = val.day
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__year); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->year = __pyx_t_2;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":608
 *                                           pandas_datetimestruct *dts):
 *     dts.year = val.year
 *     dts.month = val.month             # <<<<<<<<<<<<<<
 *     dts.day = val.day
 *     dts.hour = val.hour
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__month); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->month = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":609
 *     dts.year = val.year
 *     dts.month = val.month
 *     dts.day = val.day             # <<<<<<<<<<<<<<
 *     dts.hour = val.hour
 *     dts.min = val.minute
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__day); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->day = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":610
 *     dts.month = val.month
 *     dts.day = val.day
 *     dts.hour = val.hour             # <<<<<<<<<<<<<<
 *     dts.min = val.minute
 *     dts.sec = val.second
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->hour = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":611
 *     dts.day = val.day
 *     dts.hour = val.hour
 *     dts.min = val.minute             # <<<<<<<<<<<<<<
 *     dts.sec = val.second
 *     dts.us = val.microsecond
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__minute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->min = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":612
 *     dts.hour = val.hour
 *     dts.min = val.minute
 *     dts.sec = val.second             # <<<<<<<<<<<<<<
 *     dts.us = val.microsecond
 *     dts.ps = dts.as = 0
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__second); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->sec = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":613
 *     dts.min = val.minute
 *     dts.sec = val.second
 *     dts.us = val.microsecond             # <<<<<<<<<<<<<<
 *     dts.ps = dts.as = 0
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__microsecond); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dts->us = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":614
 *     dts.sec = val.second
 *     dts.us = val.microsecond
 *     dts.ps = dts.as = 0             # <<<<<<<<<<<<<<
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
 * 
 */
  __pyx_v_dts->ps = 0;
  __pyx_v_dts->as = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":615
 *     dts.us = val.microsecond
 *     dts.ps = dts.as = 0
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int64_t _date_to_datetime64(object val,
 */
  __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pandas.lib._dtlike_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":617
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
 * 
 * cdef inline int64_t _date_to_datetime64(object val,             # <<<<<<<<<<<<<<
 *                                         pandas_datetimestruct *dts):
 *     dts.year = PyDateTime_GET_YEAR(val)
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib__date_to_datetime64(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_date_to_datetime64");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":619
 * cdef inline int64_t _date_to_datetime64(object val,
 *                                         pandas_datetimestruct *dts):
 *     dts.year = PyDateTime_GET_YEAR(val)             # <<<<<<<<<<<<<<
 *     dts.month = PyDateTime_GET_MONTH(val)
 *     dts.day = PyDateTime_GET_DAY(val)
 */
  if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_val;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dts->year = PyDateTime_GET_YEAR(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":620
 *                                         pandas_datetimestruct *dts):
 *     dts.year = PyDateTime_GET_YEAR(val)
 *     dts.month = PyDateTime_GET_MONTH(val)             # <<<<<<<<<<<<<<
 *     dts.day = PyDateTime_GET_DAY(val)
 *     dts.hour = dts.min = dts.sec = dts.us = 0
 */
  if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_val;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dts->month = PyDateTime_GET_MONTH(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":621
 *     dts.year = PyDateTime_GET_YEAR(val)
 *     dts.month = PyDateTime_GET_MONTH(val)
 *     dts.day = PyDateTime_GET_DAY(val)             # <<<<<<<<<<<<<<
 *     dts.hour = dts.min = dts.sec = dts.us = 0
 *     dts.ps = dts.as = 0
 */
  if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_8datetime_date))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_val;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_dts->day = PyDateTime_GET_DAY(((PyDateTime_Date *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":622
 *     dts.month = PyDateTime_GET_MONTH(val)
 *     dts.day = PyDateTime_GET_DAY(val)
 *     dts.hour = dts.min = dts.sec = dts.us = 0             # <<<<<<<<<<<<<<
 *     dts.ps = dts.as = 0
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
 */
  __pyx_v_dts->hour = 0;
  __pyx_v_dts->min = 0;
  __pyx_v_dts->sec = 0;
  __pyx_v_dts->us = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":623
 *     dts.day = PyDateTime_GET_DAY(val)
 *     dts.hour = dts.min = dts.sec = dts.us = 0
 *     dts.ps = dts.as = 0             # <<<<<<<<<<<<<<
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)
 * 
 */
  __pyx_v_dts->ps = 0;
  __pyx_v_dts->as = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":624
 *     dts.hour = dts.min = dts.sec = dts.us = 0
 *     dts.ps = dts.as = 0
 *     return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, dts)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, __pyx_v_dts);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pandas.lib._date_to_datetime64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":627
 * 
 * 
 * cdef inline _string_to_dts(object val, pandas_datetimestruct* dts):             # <<<<<<<<<<<<<<
 *     cdef:
 *         npy_bool islocal, special
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__string_to_dts(PyObject *__pyx_v_val, pandas_datetimestruct *__pyx_v_dts) {
  npy_bool __pyx_v_islocal;
  npy_bool __pyx_v_special;
  PANDAS_DATETIMEUNIT __pyx_v_out_bestunit;
  int __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_string_to_dts");
  __Pyx_INCREF(__pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":633
 *         int result
 * 
 *     if PyUnicode_Check(val):             # <<<<<<<<<<<<<<
 *         val = PyUnicode_AsASCIIString(val);
 * 
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_val);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":634
 * 
 *     if PyUnicode_Check(val):
 *         val = PyUnicode_AsASCIIString(val);             # <<<<<<<<<<<<<<
 * 
 *     result = parse_iso_8601_datetime(val, len(val), PANDAS_FR_ns,
 */
    __pyx_t_2 = PyUnicode_AsASCIIString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":636
 *         val = PyUnicode_AsASCIIString(val);
 * 
 *     result = parse_iso_8601_datetime(val, len(val), PANDAS_FR_ns,             # <<<<<<<<<<<<<<
 *                                      NPY_UNSAFE_CASTING,
 *                                      dts, &islocal, &out_bestunit, &special)
 */
  __pyx_t_3 = PyBytes_AsString(__pyx_v_val); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":638
 *     result = parse_iso_8601_datetime(val, len(val), PANDAS_FR_ns,
 *                                      NPY_UNSAFE_CASTING,
 *                                      dts, &islocal, &out_bestunit, &special)             # <<<<<<<<<<<<<<
 *     if result == -1:
 *         raise ValueError('Unable to parse %s' % str(val))
 */
  __pyx_v_result = parse_iso_8601_datetime(__pyx_t_3, __pyx_t_4, PANDAS_FR_ns, NPY_UNSAFE_CASTING, __pyx_v_dts, ((npy_bool *)(&__pyx_v_islocal)), (&__pyx_v_out_bestunit), ((npy_bool *)(&__pyx_v_special)));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":639
 *                                      NPY_UNSAFE_CASTING,
 *                                      dts, &islocal, &out_bestunit, &special)
 *     if result == -1:             # <<<<<<<<<<<<<<
 *         raise ValueError('Unable to parse %s' % str(val))
 * 
 */
  __pyx_t_1 = (__pyx_v_result == -1);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":640
 *                                      dts, &islocal, &out_bestunit, &special)
 *     if result == -1:
 *         raise ValueError('Unable to parse %s' % str(val))             # <<<<<<<<<<<<<<
 * 
 * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False,
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_45), __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib._string_to_dts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":642
 *         raise ValueError('Unable to parse %s' % str(val))
 * 
 * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False,             # <<<<<<<<<<<<<<
 *                       format=None, utc=None):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_38array_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_38array_to_datetime = {__Pyx_NAMESTR("array_to_datetime"), (PyCFunction)__pyx_pf_6pandas_3lib_38array_to_datetime, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_38array_to_datetime(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_raise_ = 0;
  PyObject *__pyx_v_dayfirst = 0;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_utc = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_iresult = 0;
  PyArrayObject *__pyx_v_oresult = 0;
  pandas_datetimestruct __pyx_v_dts;
  int __pyx_v_utc_convert;
  struct __pyx_obj_6pandas_3lib__TSObject *__pyx_v__ts = 0;
  PyObject *__pyx_v_parse = NULL;
  PyObject *__pyx_v_result = NULL;
  Py_buffer __pyx_bstruct_iresult;
  Py_ssize_t __pyx_bstride_0_iresult = 0;
  Py_ssize_t __pyx_bshape_0_iresult = 0;
  Py_buffer __pyx_bstruct_oresult;
  Py_ssize_t __pyx_bstride_0_oresult = 0;
  Py_ssize_t __pyx_bshape_0_oresult = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  __pyx_t_5numpy_int64_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  PyObject *__pyx_t_29 = NULL;
  PyObject *__pyx_t_30 = NULL;
  PyObject *__pyx_t_31 = NULL;
  PyObject *__pyx_t_32 = NULL;
  PyObject *__pyx_t_33 = NULL;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  PyObject *__pyx_t_36 = NULL;
  PyArrayObject *__pyx_t_37 = NULL;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  PyObject **__pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__raise_,&__pyx_n_s__dayfirst,&__pyx_n_s__format,&__pyx_n_s__utc,0};
  __Pyx_RefNannySetupContext("array_to_datetime");
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[1] = __pyx_k_46;
    values[2] = __pyx_k_47;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":643
 * 
 * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False,
 *                       format=None, utc=None):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__raise_);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dayfirst);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__utc);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "array_to_datetime") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_raise_ = values[1];
    __pyx_v_dayfirst = values[2];
    __pyx_v_format = values[3];
    __pyx_v_utc = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("array_to_datetime", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_iresult.buf = NULL;
  __pyx_bstruct_oresult.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":645
 *                       format=None, utc=None):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         object val
 *         ndarray[int64_t] iresult
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":650
 *         ndarray[object] oresult
 *         pandas_datetimestruct dts
 *         bint utc_convert = bool(utc)             # <<<<<<<<<<<<<<
 *         _TSObject _ts
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_utc);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_utc);
  __Pyx_GIVEREF(__pyx_v_utc);
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_utc_convert = __pyx_t_4;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":653
 *         _TSObject _ts
 * 
 *     from dateutil.parser import parse             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__parse));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__parse));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__parse));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_48), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__parse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_parse = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":655
 *     from dateutil.parser import parse
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         result = np.empty(n, dtype='M8[ns]')
 *         iresult = result.view('i8')
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":656
 * 
 *     try:
 *         result = np.empty(n, dtype='M8[ns]')             # <<<<<<<<<<<<<<
 *         iresult = result.view('i8')
 *         for i in range(n):
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __pyx_t_9 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_v_result = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":657
 *     try:
 *         result = np.empty(n, dtype='M8[ns]')
 *         iresult = result.view('i8')             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             val = values[i]
 */
      __pyx_t_9 = PyObject_GetAttr(__pyx_v_result, __pyx_n_s__view); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_bstruct_iresult);
        __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_iresult, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_11 < 0)) {
          PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_iresult, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          }
        }
        __pyx_bstride_0_iresult = __pyx_bstruct_iresult.strides[0];
        __pyx_bshape_0_iresult = __pyx_bstruct_iresult.shape[0];
        if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
      }
      __pyx_t_10 = 0;
      __pyx_v_iresult = ((PyArrayObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":658
 *         result = np.empty(n, dtype='M8[ns]')
 *         iresult = result.view('i8')
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             if util._checknull(val):
 */
      __pyx_t_1 = __pyx_v_n;
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) {
        __pyx_v_i = __pyx_t_15;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":659
 *         iresult = result.view('i8')
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             if util._checknull(val):
 *                 iresult[i] = iNaT
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_11 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_bshape_0_values;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_values)) __pyx_t_11 = 0;
        if (unlikely(__pyx_t_11 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_11);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
        }
        __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_16, __pyx_bstride_0_values);
        __Pyx_INCREF((PyObject*)__pyx_t_2);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":660
 *         for i in range(n):
 *             val = values[i]
 *             if util._checknull(val):             # <<<<<<<<<<<<<<
 *                 iresult[i] = iNaT
 *             elif PyDateTime_Check(val):
 */
        __pyx_t_4 = __pyx_f_4util__checknull(__pyx_v_val);
        if (__pyx_t_4) {

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":661
 *             val = values[i]
 *             if util._checknull(val):
 *                 iresult[i] = iNaT             # <<<<<<<<<<<<<<
 *             elif PyDateTime_Check(val):
 *                 if val.tzinfo is not None:
 */
          __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_17 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_17 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_11 = -1;
          if (__pyx_t_18 < 0) {
            __pyx_t_18 += __pyx_bshape_0_iresult;
            if (unlikely(__pyx_t_18 < 0)) __pyx_t_11 = 0;
          } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
          if (unlikely(__pyx_t_11 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_11);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_18, __pyx_bstride_0_iresult) = __pyx_t_17;
          goto __pyx_L16;
        }

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":662
 *             if util._checknull(val):
 *                 iresult[i] = iNaT
 *             elif PyDateTime_Check(val):             # <<<<<<<<<<<<<<
 *                 if val.tzinfo is not None:
 *                     if utc_convert:
 */
        __pyx_t_4 = PyDateTime_Check(__pyx_v_val);
        if (__pyx_t_4) {

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":663
 *                 iresult[i] = iNaT
 *             elif PyDateTime_Check(val):
 *                 if val.tzinfo is not None:             # <<<<<<<<<<<<<<
 *                     if utc_convert:
 *                         _ts = convert_to_tsobject(val)
 */
          __pyx_t_2 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__tzinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = (__pyx_t_2 != Py_None);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_4) {

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":664
 *             elif PyDateTime_Check(val):
 *                 if val.tzinfo is not None:
 *                     if utc_convert:             # <<<<<<<<<<<<<<
 *                         _ts = convert_to_tsobject(val)
 *                         iresult[i] = _ts.value
 */
            if (__pyx_v_utc_convert) {

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":665
 *                 if val.tzinfo is not None:
 *                     if utc_convert:
 *                         _ts = convert_to_tsobject(val)             # <<<<<<<<<<<<<<
 *                         iresult[i] = _ts.value
 *                         _check_dts_bounds(iresult[i], &_ts.dts)
 */
              __pyx_t_2 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_v_val, 0, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_3lib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
              __Pyx_XDECREF(((PyObject *)__pyx_v__ts));
              __pyx_v__ts = ((struct __pyx_obj_6pandas_3lib__TSObject *)__pyx_t_2);
              __pyx_t_2 = 0;

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":666
 *                     if utc_convert:
 *                         _ts = convert_to_tsobject(val)
 *                         iresult[i] = _ts.value             # <<<<<<<<<<<<<<
 *                         _check_dts_bounds(iresult[i], &_ts.dts)
 *                     else:
 */
              __pyx_t_19 = __pyx_v_i;
              __pyx_t_11 = -1;
              if (__pyx_t_19 < 0) {
                __pyx_t_19 += __pyx_bshape_0_iresult;
                if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 0;
              } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
              if (unlikely(__pyx_t_11 != -1)) {
                __Pyx_RaiseBufferIndexError(__pyx_t_11);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
              }
              *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_19, __pyx_bstride_0_iresult) = __pyx_v__ts->value;

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":667
 *                         _ts = convert_to_tsobject(val)
 *                         iresult[i] = _ts.value
 *                         _check_dts_bounds(iresult[i], &_ts.dts)             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise ValueError('Tz-aware datetime.datetime cannot '
 */
              __pyx_t_20 = __pyx_v_i;
              __pyx_t_11 = -1;
              if (__pyx_t_20 < 0) {
                __pyx_t_20 += __pyx_bshape_0_iresult;
                if (unlikely(__pyx_t_20 < 0)) __pyx_t_11 = 0;
              } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
              if (unlikely(__pyx_t_11 != -1)) {
                __Pyx_RaiseBufferIndexError(__pyx_t_11);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
              }
              __pyx_t_2 = __pyx_f_6pandas_3lib__check_dts_bounds((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_20, __pyx_bstride_0_iresult)), (&__pyx_v__ts->dts)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L18;
            }
            /*else*/ {

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":669
 *                         _check_dts_bounds(iresult[i], &_ts.dts)
 *                     else:
 *                         raise ValueError('Tz-aware datetime.datetime cannot '             # <<<<<<<<<<<<<<
 *                                          'be converted to datetime64 unless '
 *                                          'utc=True')
 */
              __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_Raise(__pyx_t_2, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
            }
            __pyx_L18:;
            goto __pyx_L17;
          }
          /*else*/ {

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":673
 *                                          'utc=True')
 *                 else:
 *                     iresult[i] = _pydatetime_to_dts(val, &dts)             # <<<<<<<<<<<<<<
 *                     _check_dts_bounds(iresult[i], &dts)
 *             elif PyDate_Check(val):
 */
            __pyx_t_21 = __pyx_v_i;
            __pyx_t_11 = -1;
            if (__pyx_t_21 < 0) {
              __pyx_t_21 += __pyx_bshape_0_iresult;
              if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 0;
            } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
            if (unlikely(__pyx_t_11 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_11);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
            }
            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_21, __pyx_bstride_0_iresult) = __pyx_f_6pandas_3lib__pydatetime_to_dts(__pyx_v_val, (&__pyx_v_dts));

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":674
 *                 else:
 *                     iresult[i] = _pydatetime_to_dts(val, &dts)
 *                     _check_dts_bounds(iresult[i], &dts)             # <<<<<<<<<<<<<<
 *             elif PyDate_Check(val):
 *                 iresult[i] = _date_to_datetime64(val, &dts)
 */
            __pyx_t_22 = __pyx_v_i;
            __pyx_t_11 = -1;
            if (__pyx_t_22 < 0) {
              __pyx_t_22 += __pyx_bshape_0_iresult;
              if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 0;
            } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
            if (unlikely(__pyx_t_11 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_11);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
            }
            __pyx_t_2 = __pyx_f_6pandas_3lib__check_dts_bounds((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_22, __pyx_bstride_0_iresult)), (&__pyx_v_dts)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __pyx_L17:;
          goto __pyx_L16;
        }

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":675
 *                     iresult[i] = _pydatetime_to_dts(val, &dts)
 *                     _check_dts_bounds(iresult[i], &dts)
 *             elif PyDate_Check(val):             # <<<<<<<<<<<<<<
 *                 iresult[i] = _date_to_datetime64(val, &dts)
 *                 _check_dts_bounds(iresult[i], &dts)
 */
        __pyx_t_4 = PyDate_Check(__pyx_v_val);
        if (__pyx_t_4) {

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":676
 *                     _check_dts_bounds(iresult[i], &dts)
 *             elif PyDate_Check(val):
 *                 iresult[i] = _date_to_datetime64(val, &dts)             # <<<<<<<<<<<<<<
 *                 _check_dts_bounds(iresult[i], &dts)
 *             elif util.is_datetime64_object(val):
 */
          __pyx_t_23 = __pyx_v_i;
          __pyx_t_11 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_bshape_0_iresult;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
          if (unlikely(__pyx_t_11 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_11);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_23, __pyx_bstride_0_iresult) = __pyx_f_6pandas_3lib__date_to_datetime64(__pyx_v_val, (&__pyx_v_dts));

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":677
 *             elif PyDate_Check(val):
 *                 iresult[i] = _date_to_datetime64(val, &dts)
 *                 _check_dts_bounds(iresult[i], &dts)             # <<<<<<<<<<<<<<
 *             elif util.is_datetime64_object(val):
 *                 iresult[i] = _get_datetime64_nanos(val)
 */
          __pyx_t_24 = __pyx_v_i;
          __pyx_t_11 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_bshape_0_iresult;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_11 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
          if (unlikely(__pyx_t_11 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_11);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          }
          __pyx_t_2 = __pyx_f_6pandas_3lib__check_dts_bounds((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_24, __pyx_bstride_0_iresult)), (&__pyx_v_dts)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L16;
        }

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":678
 *                 iresult[i] = _date_to_datetime64(val, &dts)
 *                 _check_dts_bounds(iresult[i], &dts)
 *             elif util.is_datetime64_object(val):             # <<<<<<<<<<<<<<
 *                 iresult[i] = _get_datetime64_nanos(val)
 *             elif util.is_integer_object(val):
 */
        __pyx_t_11 = is_datetime64_object(__pyx_v_val);
        if (__pyx_t_11) {

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":679
 *                 _check_dts_bounds(iresult[i], &dts)
 *             elif util.is_datetime64_object(val):
 *                 iresult[i] = _get_datetime64_nanos(val)             # <<<<<<<<<<<<<<
 *             elif util.is_integer_object(val):
 *                 iresult[i] = val
 */
          __pyx_t_2 = __pyx_f_6pandas_3lib__get_datetime64_nanos(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_17 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_17 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_25 = __pyx_v_i;
          __pyx_t_11 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_bshape_0_iresult;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_11 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
          if (unlikely(__pyx_t_11 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_11);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_25, __pyx_bstride_0_iresult) = __pyx_t_17;
          goto __pyx_L16;
        }

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":680
 *             elif util.is_datetime64_object(val):
 *                 iresult[i] = _get_datetime64_nanos(val)
 *             elif util.is_integer_object(val):             # <<<<<<<<<<<<<<
 *                 iresult[i] = val
 *             else:
 */
        __pyx_t_11 = is_integer_object(__pyx_v_val);
        if (__pyx_t_11) {

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":681
 *                 iresult[i] = _get_datetime64_nanos(val)
 *             elif util.is_integer_object(val):
 *                 iresult[i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 if len(val) == 0:
 */
          __pyx_t_17 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_17 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __pyx_t_26 = __pyx_v_i;
          __pyx_t_11 = -1;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_bshape_0_iresult;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_11 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
          if (unlikely(__pyx_t_11 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_11);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_26, __pyx_bstride_0_iresult) = __pyx_t_17;
          goto __pyx_L16;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":683
 *                 iresult[i] = val
 *             else:
 *                 if len(val) == 0:             # <<<<<<<<<<<<<<
 *                     iresult[i] = iNaT
 *                     continue
 */
          __pyx_t_27 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_27 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __pyx_t_4 = (__pyx_t_27 == 0);
          if (__pyx_t_4) {

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":684
 *             else:
 *                 if len(val) == 0:
 *                     iresult[i] = iNaT             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
            __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_17 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_17 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_27 = __pyx_v_i;
            __pyx_t_11 = -1;
            if (__pyx_t_27 < 0) {
              __pyx_t_27 += __pyx_bshape_0_iresult;
              if (unlikely(__pyx_t_27 < 0)) __pyx_t_11 = 0;
            } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
            if (unlikely(__pyx_t_11 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_11);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
            }
            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_27, __pyx_bstride_0_iresult) = __pyx_t_17;

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":685
 *                 if len(val) == 0:
 *                     iresult[i] = iNaT
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 try:
 */
            goto __pyx_L14_continue;
            goto __pyx_L19;
          }
          __pyx_L19:;

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":687
 *                     continue
 * 
 *                 try:             # <<<<<<<<<<<<<<
 *                     _string_to_dts(val, &dts)
 *                     iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns,
 */
          {
            __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_12);
            /*try:*/ {

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":688
 * 
 *                 try:
 *                     _string_to_dts(val, &dts)             # <<<<<<<<<<<<<<
 *                     iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns,
 *                                                                    &dts)
 */
              __pyx_t_2 = __pyx_f_6pandas_3lib__string_to_dts(__pyx_v_val, (&__pyx_v_dts)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":689
 *                 try:
 *                     _string_to_dts(val, &dts)
 *                     iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns,             # <<<<<<<<<<<<<<
 *                                                                    &dts)
 *                 except ValueError:
 */
              __pyx_t_28 = __pyx_v_i;
              __pyx_t_11 = -1;
              if (__pyx_t_28 < 0) {
                __pyx_t_28 += __pyx_bshape_0_iresult;
                if (unlikely(__pyx_t_28 < 0)) __pyx_t_11 = 0;
              } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
              if (unlikely(__pyx_t_11 != -1)) {
                __Pyx_RaiseBufferIndexError(__pyx_t_11);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
              }
              *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_28, __pyx_bstride_0_iresult) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts));
            }
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L27_try_end;
            __pyx_L20_error:;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":691
 *                     iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns,
 *                                                                    &dts)
 *                 except ValueError:             # <<<<<<<<<<<<<<
 *                     try:
 *                         result[i] = parse(val, dayfirst=dayfirst)
 */
            __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
            if (__pyx_t_11) {
              __Pyx_AddTraceback("pandas.lib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_GOTREF(__pyx_t_8);

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":692
 *                                                                    &dts)
 *                 except ValueError:
 *                     try:             # <<<<<<<<<<<<<<
 *                         result[i] = parse(val, dayfirst=dayfirst)
 *                     except Exception:
 */
              {
                __Pyx_ExceptionSave(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31);
                __Pyx_XGOTREF(__pyx_t_29);
                __Pyx_XGOTREF(__pyx_t_30);
                __Pyx_XGOTREF(__pyx_t_31);
                /*try:*/ {

                  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":693
 *                 except ValueError:
 *                     try:
 *                         result[i] = parse(val, dayfirst=dayfirst)             # <<<<<<<<<<<<<<
 *                     except Exception:
 *                         raise TypeError
 */
                  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
                  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
                  __Pyx_INCREF(__pyx_v_val);
                  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val);
                  __Pyx_GIVEREF(__pyx_v_val);
                  __pyx_t_32 = PyDict_New(); if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
                  __Pyx_GOTREF(((PyObject *)__pyx_t_32));
                  if (PyDict_SetItem(__pyx_t_32, ((PyObject *)__pyx_n_s__dayfirst), __pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
                  __pyx_t_33 = PyEval_CallObjectWithKeywords(__pyx_v_parse, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_32)); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
                  __Pyx_GOTREF(__pyx_t_33);
                  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
                  __Pyx_DECREF(((PyObject *)__pyx_t_32)); __pyx_t_32 = 0;
                  if (__Pyx_SetItemInt(__pyx_v_result, __pyx_v_i, __pyx_t_33, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L30_error;}
                  __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                }
                __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
                __Pyx_XDECREF(__pyx_t_30); __pyx_t_30 = 0;
                __Pyx_XDECREF(__pyx_t_31); __pyx_t_31 = 0;
                goto __pyx_L37_try_end;
                __pyx_L30_error:;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0;
                __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;

                /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":694
 *                     try:
 *                         result[i] = parse(val, dayfirst=dayfirst)
 *                     except Exception:             # <<<<<<<<<<<<<<
 *                         raise TypeError
 *                     pandas_datetime_to_datetimestruct(iresult[i], PANDAS_FR_ns,
 */
                __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
                if (__pyx_t_11) {
                  __Pyx_AddTraceback("pandas.lib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_33, &__pyx_t_32, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                  __Pyx_GOTREF(__pyx_t_33);
                  __Pyx_GOTREF(__pyx_t_32);
                  __Pyx_GOTREF(__pyx_t_3);

                  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":695
 *                         result[i] = parse(val, dayfirst=dayfirst)
 *                     except Exception:
 *                         raise TypeError             # <<<<<<<<<<<<<<
 *                     pandas_datetime_to_datetimestruct(iresult[i], PANDAS_FR_ns,
 *                                                       &dts)
 */
                  __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                  __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
                  __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  goto __pyx_L31_exception_handled;
                }
                __pyx_L32_except_error:;
                __Pyx_XGIVEREF(__pyx_t_29);
                __Pyx_XGIVEREF(__pyx_t_30);
                __Pyx_XGIVEREF(__pyx_t_31);
                __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_30, __pyx_t_31);
                goto __pyx_L22_except_error;
                __pyx_L31_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_29);
                __Pyx_XGIVEREF(__pyx_t_30);
                __Pyx_XGIVEREF(__pyx_t_31);
                __Pyx_ExceptionReset(__pyx_t_29, __pyx_t_30, __pyx_t_31);
                __pyx_L37_try_end:;
              }

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":696
 *                     except Exception:
 *                         raise TypeError
 *                     pandas_datetime_to_datetimestruct(iresult[i], PANDAS_FR_ns,             # <<<<<<<<<<<<<<
 *                                                       &dts)
 *                 _check_dts_bounds(iresult[i], &dts)
 */
              __pyx_t_34 = __pyx_v_i;
              __pyx_t_11 = -1;
              if (__pyx_t_34 < 0) {
                __pyx_t_34 += __pyx_bshape_0_iresult;
                if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 0;
              } else if (unlikely(__pyx_t_34 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
              if (unlikely(__pyx_t_11 != -1)) {
                __Pyx_RaiseBufferIndexError(__pyx_t_11);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;}
              }

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":697
 *                         raise TypeError
 *                     pandas_datetime_to_datetimestruct(iresult[i], PANDAS_FR_ns,
 *                                                       &dts)             # <<<<<<<<<<<<<<
 *                 _check_dts_bounds(iresult[i], &dts)
 *         return result
 */
              pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_34, __pyx_bstride_0_iresult)), PANDAS_FR_ns, (&__pyx_v_dts));
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              goto __pyx_L21_exception_handled;
            }
            __pyx_L22_except_error:;
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
            goto __pyx_L6_error;
            __pyx_L21_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
            __pyx_L27_try_end:;
          }

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":698
 *                     pandas_datetime_to_datetimestruct(iresult[i], PANDAS_FR_ns,
 *                                                       &dts)
 *                 _check_dts_bounds(iresult[i], &dts)             # <<<<<<<<<<<<<<
 *         return result
 *     except TypeError:
 */
          __pyx_t_35 = __pyx_v_i;
          __pyx_t_11 = -1;
          if (__pyx_t_35 < 0) {
            __pyx_t_35 += __pyx_bshape_0_iresult;
            if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 0;
          } else if (unlikely(__pyx_t_35 >= __pyx_bshape_0_iresult)) __pyx_t_11 = 0;
          if (unlikely(__pyx_t_11 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_11);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          }
          __pyx_t_8 = __pyx_f_6pandas_3lib__check_dts_bounds((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_35, __pyx_bstride_0_iresult)), (&__pyx_v_dts)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __pyx_L16:;
        __pyx_L14_continue:;
      }

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":699
 *                                                       &dts)
 *                 _check_dts_bounds(iresult[i], &dts)
 *         return result             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         oresult = np.empty(n, dtype=object)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L10_try_return;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L13_try_end;
    __pyx_L10_try_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;
    __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":700
 *                 _check_dts_bounds(iresult[i], &dts)
 *         return result
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         oresult = np.empty(n, dtype=object)
 * 
 */
    __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("pandas.lib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_2);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":701
 *         return result
 *     except TypeError:
 *         oresult = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_32 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_33 = PyTuple_New(1); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_33));
      PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __pyx_t_36 = PyEval_CallObjectWithKeywords(__pyx_t_32, ((PyObject *)__pyx_t_33), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __Pyx_GOTREF(__pyx_t_36);
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_33)); __pyx_t_33 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_36) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_36, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      __pyx_t_37 = ((PyArrayObject *)__pyx_t_36);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_bstruct_oresult);
        __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_oresult, (PyObject*)__pyx_t_37, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
        if (unlikely(__pyx_t_11 < 0)) {
          PyErr_Fetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_oresult, (PyObject*)__pyx_v_oresult, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          }
        }
        __pyx_bstride_0_oresult = __pyx_bstruct_oresult.strides[0];
        __pyx_bshape_0_oresult = __pyx_bstruct_oresult.shape[0];
        if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
      }
      __pyx_t_37 = 0;
      __pyx_v_oresult = ((PyArrayObject *)__pyx_t_36);
      __pyx_t_36 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":703
 *         oresult = np.empty(n, dtype=object)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = values[i]
 *             if util._checknull(val):
 */
      __pyx_t_1 = __pyx_v_n;
      for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_1; __pyx_t_15+=1) {
        __pyx_v_i = __pyx_t_15;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":704
 * 
 *         for i in range(n):
 *             val = values[i]             # <<<<<<<<<<<<<<
 *             if util._checknull(val):
 *                 oresult[i] = val
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_11 = -1;
        if (__pyx_t_38 < 0) {
          __pyx_t_38 += __pyx_bshape_0_values;
          if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 0;
        } else if (unlikely(__pyx_t_38 >= __pyx_bshape_0_values)) __pyx_t_11 = 0;
        if (unlikely(__pyx_t_11 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_11);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
        }
        __pyx_t_36 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_38, __pyx_bstride_0_values);
        __Pyx_INCREF((PyObject*)__pyx_t_36);
        __Pyx_XDECREF(__pyx_v_val);
        __pyx_v_val = __pyx_t_36;
        __pyx_t_36 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":705
 *         for i in range(n):
 *             val = values[i]
 *             if util._checknull(val):             # <<<<<<<<<<<<<<
 *                 oresult[i] = val
 *             else:
 */
        __pyx_t_4 = __pyx_f_4util__checknull(__pyx_v_val);
        if (__pyx_t_4) {

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":706
 *             val = values[i]
 *             if util._checknull(val):
 *                 oresult[i] = val             # <<<<<<<<<<<<<<
 *             else:
 *                 if len(val) == 0:
 */
          __pyx_t_39 = __pyx_v_i;
          __pyx_t_11 = -1;
          if (__pyx_t_39 < 0) {
            __pyx_t_39 += __pyx_bshape_0_oresult;
            if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 0;
          } else if (unlikely(__pyx_t_39 >= __pyx_bshape_0_oresult)) __pyx_t_11 = 0;
          if (unlikely(__pyx_t_11 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_11);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          }
          __pyx_t_40 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_oresult.buf, __pyx_t_39, __pyx_bstride_0_oresult);
          __Pyx_GOTREF(*__pyx_t_40);
          __Pyx_DECREF(*__pyx_t_40); __Pyx_INCREF(__pyx_v_val);
          *__pyx_t_40 = __pyx_v_val;
          __Pyx_GIVEREF(*__pyx_t_40);
          goto __pyx_L44;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":708
 *                 oresult[i] = val
 *             else:
 *                 if len(val) == 0:             # <<<<<<<<<<<<<<
 *                     # TODO: ??
 *                     oresult[i] = 'NaT'
 */
          __pyx_t_41 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_41 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
          __pyx_t_4 = (__pyx_t_41 == 0);
          if (__pyx_t_4) {

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":710
 *                 if len(val) == 0:
 *                     # TODO: ??
 *                     oresult[i] = 'NaT'             # <<<<<<<<<<<<<<
 *                     continue
 *                 try:
 */
            __pyx_t_41 = __pyx_v_i;
            __pyx_t_11 = -1;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_bshape_0_oresult;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_11 = 0;
            } else if (unlikely(__pyx_t_41 >= __pyx_bshape_0_oresult)) __pyx_t_11 = 0;
            if (unlikely(__pyx_t_11 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_11);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
            }
            __pyx_t_40 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_oresult.buf, __pyx_t_41, __pyx_bstride_0_oresult);
            __Pyx_GOTREF(*__pyx_t_40);
            __Pyx_DECREF(*__pyx_t_40); __Pyx_INCREF(__pyx_n_s__NaT);
            *__pyx_t_40 = __pyx_n_s__NaT;
            __Pyx_GIVEREF(*__pyx_t_40);

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":711
 *                     # TODO: ??
 *                     oresult[i] = 'NaT'
 *                     continue             # <<<<<<<<<<<<<<
 *                 try:
 *                     oresult[i] = parse(val, dayfirst=dayfirst)
 */
            goto __pyx_L42_continue;
            goto __pyx_L45;
          }
          __pyx_L45:;

          /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":712
 *                     oresult[i] = 'NaT'
 *                     continue
 *                 try:             # <<<<<<<<<<<<<<
 *                     oresult[i] = parse(val, dayfirst=dayfirst)
 *                 except Exception:
 */
          {
            __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
            __Pyx_XGOTREF(__pyx_t_14);
            __Pyx_XGOTREF(__pyx_t_13);
            __Pyx_XGOTREF(__pyx_t_12);
            /*try:*/ {

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":713
 *                     continue
 *                 try:
 *                     oresult[i] = parse(val, dayfirst=dayfirst)             # <<<<<<<<<<<<<<
 *                 except Exception:
 *                     if raise_:
 */
              __pyx_t_36 = PyTuple_New(1); if (unlikely(!__pyx_t_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L46_error;}
              __Pyx_GOTREF(((PyObject *)__pyx_t_36));
              __Pyx_INCREF(__pyx_v_val);
              PyTuple_SET_ITEM(__pyx_t_36, 0, __pyx_v_val);
              __Pyx_GIVEREF(__pyx_v_val);
              __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L46_error;}
              __Pyx_GOTREF(((PyObject *)__pyx_t_3));
              if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dayfirst), __pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L46_error;}
              __pyx_t_33 = PyEval_CallObjectWithKeywords(__pyx_v_parse, ((PyObject *)__pyx_t_36), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L46_error;}
              __Pyx_GOTREF(__pyx_t_33);
              __Pyx_DECREF(((PyObject *)__pyx_t_36)); __pyx_t_36 = 0;
              __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
              __pyx_t_42 = __pyx_v_i;
              __pyx_t_11 = -1;
              if (__pyx_t_42 < 0) {
                __pyx_t_42 += __pyx_bshape_0_oresult;
                if (unlikely(__pyx_t_42 < 0)) __pyx_t_11 = 0;
              } else if (unlikely(__pyx_t_42 >= __pyx_bshape_0_oresult)) __pyx_t_11 = 0;
              if (unlikely(__pyx_t_11 != -1)) {
                __Pyx_RaiseBufferIndexError(__pyx_t_11);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L46_error;}
              }
              __pyx_t_40 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_oresult.buf, __pyx_t_42, __pyx_bstride_0_oresult);
              __Pyx_GOTREF(*__pyx_t_40);
              __Pyx_DECREF(*__pyx_t_40); __Pyx_INCREF(__pyx_t_33);
              *__pyx_t_40 = __pyx_t_33;
              __Pyx_GIVEREF(*__pyx_t_40);
              __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
            }
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L53_try_end;
            __pyx_L46_error:;
            __Pyx_XDECREF(__pyx_t_32); __pyx_t_32 = 0;
            __Pyx_XDECREF(__pyx_t_36); __pyx_t_36 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_33); __pyx_t_33 = 0;

            /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":714
 *                 try:
 *                     oresult[i] = parse(val, dayfirst=dayfirst)
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     if raise_:
 *                         raise
 */
            __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
            if (__pyx_t_11) {
              __Pyx_AddTraceback("pandas.lib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_33, &__pyx_t_3, &__pyx_t_36) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L48_except_error;}
              __Pyx_GOTREF(__pyx_t_33);
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GOTREF(__pyx_t_36);

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":715
 *                     oresult[i] = parse(val, dayfirst=dayfirst)
 *                 except Exception:
 *                     if raise_:             # <<<<<<<<<<<<<<
 *                         raise
 *                     return values
 */
              __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_raise_); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L48_except_error;}
              if (__pyx_t_4) {

                /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":716
 *                 except Exception:
 *                     if raise_:
 *                         raise             # <<<<<<<<<<<<<<
 *                     return values
 *                     # oresult[i] = val
 */
                __Pyx_GIVEREF(__pyx_t_33);
                __Pyx_GIVEREF(__pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_36);
                __Pyx_ErrRestore(__pyx_t_33, __pyx_t_3, __pyx_t_36);
                __pyx_t_33 = 0; __pyx_t_3 = 0; __pyx_t_36 = 0; 
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L48_except_error;}
                goto __pyx_L56;
              }
              __pyx_L56:;

              /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":717
 *                     if raise_:
 *                         raise
 *                     return values             # <<<<<<<<<<<<<<
 *                     # oresult[i] = val
 * 
 */
              __Pyx_XDECREF(__pyx_r);
              __Pyx_INCREF(((PyObject *)__pyx_v_values));
              __pyx_r = ((PyObject *)__pyx_v_values);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
              __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
              goto __pyx_L49_except_return;
              __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_36); __pyx_t_36 = 0;
              goto __pyx_L47_exception_handled;
            }
            __pyx_L48_except_error:;
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
            goto __pyx_L8_except_error;
            __pyx_L49_except_return:;
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
            goto __pyx_L9_except_return;
            __pyx_L47_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
            __pyx_L53_try_end:;
          }
        }
        __pyx_L44:;
        __pyx_L42_continue:;
      }

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":720
 *                     # oresult[i] = val
 * 
 *         return oresult             # <<<<<<<<<<<<<<
 * 
 * cdef inline _get_datetime64_nanos(object val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_oresult));
      __pyx_r = ((PyObject *)__pyx_v_oresult);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L9_except_return;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L7_exception_handled;
    }
    __pyx_L8_except_error:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L9_except_return:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L0;
    __pyx_L7_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L13_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_32);
  __Pyx_XDECREF(__pyx_t_33);
  __Pyx_XDECREF(__pyx_t_36);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_iresult);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_oresult);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.array_to_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_iresult);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_oresult);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_iresult);
  __Pyx_XDECREF((PyObject *)__pyx_v_oresult);
  __Pyx_XDECREF((PyObject *)__pyx_v__ts);
  __Pyx_XDECREF(__pyx_v_parse);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":722
 *         return oresult
 * 
 * cdef inline _get_datetime64_nanos(object val):             # <<<<<<<<<<<<<<
 *     cdef:
 *         pandas_datetimestruct dts
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__get_datetime64_nanos(PyObject *__pyx_v_val) {
  pandas_datetimestruct __pyx_v_dts;
  PANDAS_DATETIMEUNIT __pyx_v_unit;
  npy_datetime __pyx_v_ival;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_datetime64_nanos");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":728
 *         npy_datetime ival
 * 
 *     unit = get_datetime64_unit(val)             # <<<<<<<<<<<<<<
 *     if unit == 3:
 *         raise ValueError('NumPy 1.6.1 business freq not supported')
 */
  __pyx_v_unit = get_datetime64_unit(__pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":729
 * 
 *     unit = get_datetime64_unit(val)
 *     if unit == 3:             # <<<<<<<<<<<<<<
 *         raise ValueError('NumPy 1.6.1 business freq not supported')
 * 
 */
  __pyx_t_1 = (__pyx_v_unit == 3);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":730
 *     unit = get_datetime64_unit(val)
 *     if unit == 3:
 *         raise ValueError('NumPy 1.6.1 business freq not supported')             # <<<<<<<<<<<<<<
 * 
 *     ival = get_datetime64_value(val)
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":732
 *         raise ValueError('NumPy 1.6.1 business freq not supported')
 * 
 *     ival = get_datetime64_value(val)             # <<<<<<<<<<<<<<
 * 
 *     if unit != PANDAS_FR_ns:
 */
  __pyx_v_ival = get_datetime64_value(__pyx_v_val);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":734
 *     ival = get_datetime64_value(val)
 * 
 *     if unit != PANDAS_FR_ns:             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(ival, unit, &dts)
 *         return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 */
  __pyx_t_1 = (__pyx_v_unit != PANDAS_FR_ns);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":735
 * 
 *     if unit != PANDAS_FR_ns:
 *         pandas_datetime_to_datetimestruct(ival, unit, &dts)             # <<<<<<<<<<<<<<
 *         return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 *     else:
 */
    pandas_datetime_to_datetimestruct(__pyx_v_ival, __pyx_v_unit, (&__pyx_v_dts));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":736
 *     if unit != PANDAS_FR_ns:
 *         pandas_datetime_to_datetimestruct(ival, unit, &dts)
 *         return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *     else:
 *         return ival
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":738
 *         return pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 *     else:
 *         return ival             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_ival); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L4:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib._get_datetime64_nanos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":741
 * 
 * 
 * def cast_to_nanoseconds(ndarray arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = arr.size
 */

static PyObject *__pyx_pf_6pandas_3lib_39cast_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_39cast_to_nanoseconds = {__Pyx_NAMESTR("cast_to_nanoseconds"), (PyCFunction)__pyx_pf_6pandas_3lib_39cast_to_nanoseconds, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_39cast_to_nanoseconds(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_ivalues = 0;
  PyArrayObject *__pyx_v_iresult = 0;
  PANDAS_DATETIMEUNIT __pyx_v_unit;
  pandas_datetimestruct __pyx_v_dts;
  PyObject *__pyx_v_shape = NULL;
  PyObject *__pyx_v_result = NULL;
  Py_buffer __pyx_bstruct_iresult;
  Py_ssize_t __pyx_bstride_0_iresult = 0;
  Py_ssize_t __pyx_bshape_0_iresult = 0;
  Py_buffer __pyx_bstruct_ivalues;
  Py_ssize_t __pyx_bstride_0_ivalues = 0;
  Py_ssize_t __pyx_bshape_0_ivalues = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cast_to_nanoseconds");
  __pyx_self = __pyx_self;
  __pyx_bstruct_ivalues.buf = NULL;
  __pyx_bstruct_iresult.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":743
 * def cast_to_nanoseconds(ndarray arr):
 *     cdef:
 *         Py_ssize_t i, n = arr.size             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] ivalues, iresult
 *         PANDAS_DATETIMEUNIT unit
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":748
 *         pandas_datetimestruct dts
 * 
 *     shape = (<object> arr).shape             # <<<<<<<<<<<<<<
 * 
 *     ivalues = arr.view(np.int64).ravel()
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_shape = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":750
 *     shape = (<object> arr).shape
 * 
 *     ivalues = arr.view(np.int64).ravel()             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(shape, dtype='M8[ns]')
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ivalues);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ivalues, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ivalues, (PyObject*)__pyx_v_ivalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_ivalues = __pyx_bstruct_ivalues.strides[0];
    __pyx_bshape_0_ivalues = __pyx_bstruct_ivalues.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_ivalues = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":752
 *     ivalues = arr.view(np.int64).ravel()
 * 
 *     result = np.empty(shape, dtype='M8[ns]')             # <<<<<<<<<<<<<<
 *     iresult = result.ravel().view(np.int64)
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(__pyx_v_shape);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape);
  __Pyx_GIVEREF(__pyx_v_shape);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":753
 * 
 *     result = np.empty(shape, dtype='M8[ns]')
 *     iresult = result.ravel().view(np.int64)             # <<<<<<<<<<<<<<
 * 
 *     unit = get_datetime64_unit(arr.flat[0])
 */
  __pyx_t_10 = PyObject_GetAttr(__pyx_v_result, __pyx_n_s__ravel); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_iresult);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_iresult, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_iresult, (PyObject*)__pyx_v_iresult, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_iresult = __pyx_bstruct_iresult.strides[0];
    __pyx_bshape_0_iresult = __pyx_bstruct_iresult.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_iresult = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":755
 *     iresult = result.ravel().view(np.int64)
 * 
 *     unit = get_datetime64_unit(arr.flat[0])             # <<<<<<<<<<<<<<
 *     if unit == 3:
 *         raise ValueError('NumPy 1.6.1 business freq not supported')
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__flat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_unit = get_datetime64_unit(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":756
 * 
 *     unit = get_datetime64_unit(arr.flat[0])
 *     if unit == 3:             # <<<<<<<<<<<<<<
 *         raise ValueError('NumPy 1.6.1 business freq not supported')
 * 
 */
  __pyx_t_11 = (__pyx_v_unit == 3);
  if (__pyx_t_11) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":757
 *     unit = get_datetime64_unit(arr.flat[0])
 *     if unit == 3:
 *         raise ValueError('NumPy 1.6.1 business freq not supported')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":759
 *         raise ValueError('NumPy 1.6.1 business freq not supported')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts)
 *         iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":760
 * 
 *     for i in range(n):
 *         pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts)             # <<<<<<<<<<<<<<
 *         iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 * 
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_ivalues;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_ivalues)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_ivalues.buf, __pyx_t_13, __pyx_bstride_0_ivalues)), __pyx_v_unit, (&__pyx_v_dts));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":761
 *     for i in range(n):
 *         pandas_datetime_to_datetimestruct(ivalues[i], unit, &dts)
 *         iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_iresult;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_iresult)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_iresult.buf, __pyx_t_14, __pyx_bstride_0_iresult) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts));
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":763
 *         iresult[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_iresult);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ivalues);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.cast_to_nanoseconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_iresult);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ivalues);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ivalues);
  __Pyx_XDECREF((PyObject *)__pyx_v_iresult);
  __Pyx_XDECREF(__pyx_v_shape);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":769
 * 
 * 
 * def pydt_to_i8(object pydt):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert to int64 representation compatible with numpy datetime64; converts
 */

static PyObject *__pyx_pf_6pandas_3lib_40pydt_to_i8(PyObject *__pyx_self, PyObject *__pyx_v_pydt); /*proto*/
static char __pyx_doc_6pandas_3lib_40pydt_to_i8[] = "\n    Convert to int64 representation compatible with numpy datetime64; converts\n    to UTC\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_40pydt_to_i8 = {__Pyx_NAMESTR("pydt_to_i8"), (PyCFunction)__pyx_pf_6pandas_3lib_40pydt_to_i8, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_40pydt_to_i8)};
static PyObject *__pyx_pf_6pandas_3lib_40pydt_to_i8(PyObject *__pyx_self, PyObject *__pyx_v_pydt) {
  struct __pyx_obj_6pandas_3lib__TSObject *__pyx_v_ts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pydt_to_i8");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":777
 *         _TSObject ts
 * 
 *     ts = convert_to_tsobject(pydt)             # <<<<<<<<<<<<<<
 * 
 *     return ts.value
 */
  __pyx_t_1 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_v_pydt, 0, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_3lib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ts = ((struct __pyx_obj_6pandas_3lib__TSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":779
 *     ts = convert_to_tsobject(pydt)
 * 
 *     return ts.value             # <<<<<<<<<<<<<<
 * 
 * def i8_to_pydt(int64_t i8, object tzinfo = None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_ts->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.pydt_to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":781
 *     return ts.value
 * 
 * def i8_to_pydt(int64_t i8, object tzinfo = None):             # <<<<<<<<<<<<<<
 *     '''
 *     Inverse of pydt_to_i8
 */

static PyObject *__pyx_pf_6pandas_3lib_41i8_to_pydt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_41i8_to_pydt[] = "\n    Inverse of pydt_to_i8\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_41i8_to_pydt = {__Pyx_NAMESTR("i8_to_pydt"), (PyCFunction)__pyx_pf_6pandas_3lib_41i8_to_pydt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_41i8_to_pydt)};
static PyObject *__pyx_pf_6pandas_3lib_41i8_to_pydt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_5numpy_int64_t __pyx_v_i8;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__i8,&__pyx_n_s__tzinfo,0};
  __Pyx_RefNannySetupContext("i8_to_pydt");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i8);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tzinfo);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "i8_to_pydt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_i8 = __Pyx_PyInt_from_py_npy_int64(values[0]); if (unlikely((__pyx_v_i8 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_tzinfo = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("i8_to_pydt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.i8_to_pydt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":785
 *     Inverse of pydt_to_i8
 *     '''
 *     return Timestamp(i8)             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_i8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.i8_to_pydt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":797
 *     have_pytz = False
 * 
 * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ndarray[int64_t] utc_dates, result, trans, deltas
 */

static PyObject *__pyx_pf_6pandas_3lib_42tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_42tz_convert = {__Pyx_NAMESTR("tz_convert"), (PyCFunction)__pyx_pf_6pandas_3lib_42tz_convert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_42tz_convert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_vals = 0;
  PyObject *__pyx_v_tz1 = 0;
  PyObject *__pyx_v_tz2 = 0;
  PyArrayObject *__pyx_v_utc_dates = 0;
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_trans = 0;
  PyArrayObject *__pyx_v_deltas = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_pos;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int64_t __pyx_v_v;
  __pyx_t_5numpy_int64_t __pyx_v_offset;
  PyObject *__pyx_v_pytz = NULL;
  Py_buffer __pyx_bstruct_utc_dates;
  Py_ssize_t __pyx_bstride_0_utc_dates = 0;
  Py_ssize_t __pyx_bshape_0_utc_dates = 0;
  Py_buffer __pyx_bstruct_deltas;
  Py_ssize_t __pyx_bstride_0_deltas = 0;
  Py_ssize_t __pyx_bshape_0_deltas = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_vals;
  Py_ssize_t __pyx_bstride_0_vals = 0;
  Py_ssize_t __pyx_bshape_0_vals = 0;
  Py_buffer __pyx_bstruct_trans;
  Py_ssize_t __pyx_bstride_0_trans = 0;
  Py_ssize_t __pyx_bshape_0_trans = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  long __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vals,&__pyx_n_s__tz1,&__pyx_n_s__tz2,0};
  __Pyx_RefNannySetupContext("tz_convert");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vals);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz1);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz2);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tz_convert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_vals = ((PyArrayObject *)values[0]);
    __pyx_v_tz1 = values[1];
    __pyx_v_tz2 = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_convert", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_utc_dates.buf = NULL;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_trans.buf = NULL;
  __pyx_bstruct_deltas.buf = NULL;
  __pyx_bstruct_vals.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vals, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_vals = __pyx_bstruct_vals.strides[0];
  __pyx_bshape_0_vals = __pyx_bstruct_vals.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":800
 *     cdef:
 *         ndarray[int64_t] utc_dates, result, trans, deltas
 *         Py_ssize_t i, pos, n = len(vals)             # <<<<<<<<<<<<<<
 *         int64_t v, offset
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_vals)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":803
 *         int64_t v, offset
 * 
 *     if not have_pytz:             # <<<<<<<<<<<<<<
 *         import pytz
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__have_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":804
 * 
 *     if not have_pytz:
 *         import pytz             # <<<<<<<<<<<<<<
 * 
 *     # Convert to UTC
 */
    __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__pytz), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_pytz = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":808
 *     # Convert to UTC
 * 
 *     if tz1.zone != 'UTC':             # <<<<<<<<<<<<<<
 *         utc_dates = np.empty(n, dtype=np.int64)
 *         deltas = _get_deltas(tz1)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_tz1, __pyx_n_s__zone); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyString_Equals(__pyx_t_2, ((PyObject *)__pyx_n_s__UTC), Py_NE); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":809
 * 
 *     if tz1.zone != 'UTC':
 *         utc_dates = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         deltas = _get_deltas(tz1)
 *         trans = _get_transitions(tz1)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__int64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_utc_dates);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_utc_dates, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_utc_dates, (PyObject*)__pyx_v_utc_dates, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_bstride_0_utc_dates = __pyx_bstruct_utc_dates.strides[0];
      __pyx_bshape_0_utc_dates = __pyx_bstruct_utc_dates.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_utc_dates = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":810
 *     if tz1.zone != 'UTC':
 *         utc_dates = np.empty(n, dtype=np.int64)
 *         deltas = _get_deltas(tz1)             # <<<<<<<<<<<<<<
 *         trans = _get_transitions(tz1)
 *         pos = trans.searchsorted(vals[0]) - 1
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_deltas); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_tz1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tz1);
    __Pyx_GIVEREF(__pyx_v_tz1);
    __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_6);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        }
      }
      __pyx_bstride_0_deltas = __pyx_bstruct_deltas.strides[0];
      __pyx_bshape_0_deltas = __pyx_bstruct_deltas.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_deltas = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":811
 *         utc_dates = np.empty(n, dtype=np.int64)
 *         deltas = _get_deltas(tz1)
 *         trans = _get_transitions(tz1)             # <<<<<<<<<<<<<<
 *         pos = trans.searchsorted(vals[0]) - 1
 *         if pos < 0:
 */
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_transitions); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_tz1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tz1);
    __Pyx_GIVEREF(__pyx_v_tz1);
    __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        }
      }
      __pyx_bstride_0_trans = __pyx_bstruct_trans.strides[0];
      __pyx_bshape_0_trans = __pyx_bstruct_trans.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = 0;
    __pyx_v_trans = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":812
 *         deltas = _get_deltas(tz1)
 *         trans = _get_transitions(tz1)
 *         pos = trans.searchsorted(vals[0]) - 1             # <<<<<<<<<<<<<<
 *         if pos < 0:
 *             raise ValueError('First time before start of DST info')
 */
    __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_trans), __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_14 = 0;
    __pyx_t_10 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_vals;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_vals)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_14, __pyx_bstride_0_vals))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_pos = __pyx_t_1;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":813
 *         trans = _get_transitions(tz1)
 *         pos = trans.searchsorted(vals[0]) - 1
 *         if pos < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('First time before start of DST info')
 * 
 */
    __pyx_t_4 = (__pyx_v_pos < 0);
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":814
 *         pos = trans.searchsorted(vals[0]) - 1
 *         if pos < 0:
 *             raise ValueError('First time before start of DST info')             # <<<<<<<<<<<<<<
 * 
 *         offset = deltas[pos]
 */
      __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_56), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":816
 *             raise ValueError('First time before start of DST info')
 * 
 *         offset = deltas[pos]             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             v = vals[i]
 */
    __pyx_t_1 = __pyx_v_pos;
    __pyx_t_10 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_deltas;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_deltas)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_1, __pyx_bstride_0_deltas));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":817
 * 
 *         offset = deltas[pos]
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             v = vals[i]
 *             if v >= trans[pos + 1]:
 */
    __pyx_t_15 = __pyx_v_n;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_i = __pyx_t_16;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":818
 *         offset = deltas[pos]
 *         for i in range(n):
 *             v = vals[i]             # <<<<<<<<<<<<<<
 *             if v >= trans[pos + 1]:
 *                 pos += 1
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_vals;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_vals)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_17, __pyx_bstride_0_vals));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":819
 *         for i in range(n):
 *             v = vals[i]
 *             if v >= trans[pos + 1]:             # <<<<<<<<<<<<<<
 *                 pos += 1
 *                 offset = deltas[pos]
 */
      __pyx_t_18 = (__pyx_v_pos + 1);
      __pyx_t_10 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_trans;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_trans)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = (__pyx_v_v >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_trans.buf, __pyx_t_18, __pyx_bstride_0_trans)));
      if (__pyx_t_4) {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":820
 *             v = vals[i]
 *             if v >= trans[pos + 1]:
 *                 pos += 1             # <<<<<<<<<<<<<<
 *                 offset = deltas[pos]
 *             utc_dates[i] = v - offset
 */
        __pyx_v_pos = (__pyx_v_pos + 1);

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":821
 *             if v >= trans[pos + 1]:
 *                 pos += 1
 *                 offset = deltas[pos]             # <<<<<<<<<<<<<<
 *             utc_dates[i] = v - offset
 *     else:
 */
        __pyx_t_19 = __pyx_v_pos;
        __pyx_t_10 = -1;
        if (__pyx_t_19 < 0) {
          __pyx_t_19 += __pyx_bshape_0_deltas;
          if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
        } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_deltas)) __pyx_t_10 = 0;
        if (unlikely(__pyx_t_10 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_10);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_19, __pyx_bstride_0_deltas));
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":822
 *                 pos += 1
 *                 offset = deltas[pos]
 *             utc_dates[i] = v - offset             # <<<<<<<<<<<<<<
 *     else:
 *         utc_dates = vals
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_utc_dates;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_utc_dates)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_utc_dates.buf, __pyx_t_20, __pyx_bstride_0_utc_dates) = (__pyx_v_v - __pyx_v_offset);
    }
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":824
 *             utc_dates[i] = v - offset
 *     else:
 *         utc_dates = vals             # <<<<<<<<<<<<<<
 * 
 *     if tz2.zone == 'UTC':
 */
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_utc_dates);
      __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_utc_dates, (PyObject*)((PyArrayObject *)__pyx_v_vals), &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_10 < 0)) {
        PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_utc_dates, (PyObject*)__pyx_v_utc_dates, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        }
      }
      __pyx_bstride_0_utc_dates = __pyx_bstruct_utc_dates.strides[0];
      __pyx_bshape_0_utc_dates = __pyx_bstruct_utc_dates.shape[0];
      if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_vals));
    __pyx_v_utc_dates = ((PyArrayObject *)__pyx_v_vals);
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":826
 *         utc_dates = vals
 * 
 *     if tz2.zone == 'UTC':             # <<<<<<<<<<<<<<
 *         return utc_dates
 * 
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_tz2, __pyx_n_s__zone); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyString_Equals(__pyx_t_6, ((PyObject *)__pyx_n_s__UTC), Py_EQ); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":827
 * 
 *     if tz2.zone == 'UTC':
 *         return utc_dates             # <<<<<<<<<<<<<<
 * 
 *     # Convert UTC to other timezone
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_utc_dates));
    __pyx_r = ((PyObject *)__pyx_v_utc_dates);
    goto __pyx_L0;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":831
 *     # Convert UTC to other timezone
 * 
 *     result = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     trans = _get_transitions(tz2)
 *     deltas = _get_deltas(tz2)
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":832
 * 
 *     result = np.empty(n, dtype=np.int64)
 *     trans = _get_transitions(tz2)             # <<<<<<<<<<<<<<
 *     deltas = _get_deltas(tz2)
 *     pos = trans.searchsorted(utc_dates[0]) - 1
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_transitions); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(__pyx_v_tz2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_tz2);
  __Pyx_GIVEREF(__pyx_v_tz2);
  __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
      }
    }
    __pyx_bstride_0_trans = __pyx_bstruct_trans.strides[0];
    __pyx_bshape_0_trans = __pyx_bstruct_trans.shape[0];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __Pyx_XDECREF(((PyObject *)__pyx_v_trans));
  __pyx_v_trans = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":833
 *     result = np.empty(n, dtype=np.int64)
 *     trans = _get_transitions(tz2)
 *     deltas = _get_deltas(tz2)             # <<<<<<<<<<<<<<
 *     pos = trans.searchsorted(utc_dates[0]) - 1
 *     if pos < 0:
 */
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_deltas); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(__pyx_v_tz2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_tz2);
  __Pyx_GIVEREF(__pyx_v_tz2);
  __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_deltas = __pyx_bstruct_deltas.strides[0];
    __pyx_bshape_0_deltas = __pyx_bstruct_deltas.shape[0];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __Pyx_XDECREF(((PyObject *)__pyx_v_deltas));
  __pyx_v_deltas = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":834
 *     trans = _get_transitions(tz2)
 *     deltas = _get_deltas(tz2)
 *     pos = trans.searchsorted(utc_dates[0]) - 1             # <<<<<<<<<<<<<<
 *     if pos < 0:
 *         raise ValueError('First time before start of DST info')
 */
  __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_trans), __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_21 = 0;
  __pyx_t_10 = -1;
  if (__pyx_t_21 < 0) {
    __pyx_t_21 += __pyx_bshape_0_utc_dates;
    if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 0;
  } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_utc_dates)) __pyx_t_10 = 0;
  if (unlikely(__pyx_t_10 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_10);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_utc_dates.buf, __pyx_t_21, __pyx_bstride_0_utc_dates))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Subtract(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_pos = __pyx_t_15;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":835
 *     deltas = _get_deltas(tz2)
 *     pos = trans.searchsorted(utc_dates[0]) - 1
 *     if pos < 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('First time before start of DST info')
 * 
 */
  __pyx_t_4 = (__pyx_v_pos < 0);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":836
 *     pos = trans.searchsorted(utc_dates[0]) - 1
 *     if pos < 0:
 *         raise ValueError('First time before start of DST info')             # <<<<<<<<<<<<<<
 * 
 *     offset = deltas[pos]
 */
    __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":838
 *         raise ValueError('First time before start of DST info')
 * 
 *     offset = deltas[pos]             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         v = utc_dates[i]
 */
  __pyx_t_15 = __pyx_v_pos;
  __pyx_t_10 = -1;
  if (__pyx_t_15 < 0) {
    __pyx_t_15 += __pyx_bshape_0_deltas;
    if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
  } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_deltas)) __pyx_t_10 = 0;
  if (unlikely(__pyx_t_10 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_10);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_15, __pyx_bstride_0_deltas));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":839
 * 
 *     offset = deltas[pos]
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         v = utc_dates[i]
 *         if v >= trans[pos + 1]:
 */
  __pyx_t_16 = __pyx_v_n;
  for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_16; __pyx_t_22+=1) {
    __pyx_v_i = __pyx_t_22;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":840
 *     offset = deltas[pos]
 *     for i in range(n):
 *         v = utc_dates[i]             # <<<<<<<<<<<<<<
 *         if v >= trans[pos + 1]:
 *             pos += 1
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_23 < 0) {
      __pyx_t_23 += __pyx_bshape_0_utc_dates;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_utc_dates)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_utc_dates.buf, __pyx_t_23, __pyx_bstride_0_utc_dates));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":841
 *     for i in range(n):
 *         v = utc_dates[i]
 *         if v >= trans[pos + 1]:             # <<<<<<<<<<<<<<
 *             pos += 1
 *             offset = deltas[pos]
 */
    __pyx_t_24 = (__pyx_v_pos + 1);
    __pyx_t_10 = -1;
    if (__pyx_t_24 < 0) {
      __pyx_t_24 += __pyx_bshape_0_trans;
      if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_trans)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = (__pyx_v_v >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_trans.buf, __pyx_t_24, __pyx_bstride_0_trans)));
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":842
 *         v = utc_dates[i]
 *         if v >= trans[pos + 1]:
 *             pos += 1             # <<<<<<<<<<<<<<
 *             offset = deltas[pos]
 *         result[i] = v + offset
 */
      __pyx_v_pos = (__pyx_v_pos + 1);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":843
 *         if v >= trans[pos + 1]:
 *             pos += 1
 *             offset = deltas[pos]             # <<<<<<<<<<<<<<
 *         result[i] = v + offset
 * 
 */
      __pyx_t_25 = __pyx_v_pos;
      __pyx_t_10 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_bshape_0_deltas;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_deltas)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_25, __pyx_bstride_0_deltas));
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":844
 *             pos += 1
 *             offset = deltas[pos]
 *         result[i] = v + offset             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_26 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_26 < 0) {
      __pyx_t_26 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_26, __pyx_bstride_0_result) = (__pyx_v_v + __pyx_v_offset);
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":846
 *         result[i] = v + offset
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def tz_convert_single(int64_t val, object tz1, object tz2):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_utc_dates);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vals);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.tz_convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_utc_dates);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vals);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_utc_dates);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_trans);
  __Pyx_XDECREF((PyObject *)__pyx_v_deltas);
  __Pyx_XDECREF(__pyx_v_pytz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":848
 *     return result
 * 
 * def tz_convert_single(int64_t val, object tz1, object tz2):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ndarray[int64_t] trans, deltas
 */

static PyObject *__pyx_pf_6pandas_3lib_43tz_convert_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_43tz_convert_single = {__Pyx_NAMESTR("tz_convert_single"), (PyCFunction)__pyx_pf_6pandas_3lib_43tz_convert_single, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_43tz_convert_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_5numpy_int64_t __pyx_v_val;
  PyObject *__pyx_v_tz1 = 0;
  PyObject *__pyx_v_tz2 = 0;
  PyArrayObject *__pyx_v_trans = 0;
  PyArrayObject *__pyx_v_deltas = 0;
  Py_ssize_t __pyx_v_pos;
  __pyx_t_5numpy_int64_t __pyx_v_offset;
  __pyx_t_5numpy_int64_t __pyx_v_utc_date;
  PyObject *__pyx_v_pytz = NULL;
  Py_buffer __pyx_bstruct_deltas;
  Py_ssize_t __pyx_bstride_0_deltas = 0;
  Py_ssize_t __pyx_bshape_0_deltas = 0;
  Py_buffer __pyx_bstruct_trans;
  Py_ssize_t __pyx_bstride_0_trans = 0;
  Py_ssize_t __pyx_bshape_0_trans = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__val,&__pyx_n_s__tz1,&__pyx_n_s__tz2,0};
  __Pyx_RefNannySetupContext("tz_convert_single");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz1);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz2);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tz_convert_single") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_val = __Pyx_PyInt_from_py_npy_int64(values[0]); if (unlikely((__pyx_v_val == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_tz1 = values[1];
    __pyx_v_tz2 = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_convert_single", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.tz_convert_single", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_trans.buf = NULL;
  __pyx_bstruct_deltas.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":855
 * 
 * 
 *     if not have_pytz:             # <<<<<<<<<<<<<<
 *         import pytz
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__have_pytz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":856
 * 
 *     if not have_pytz:
 *         import pytz             # <<<<<<<<<<<<<<
 * 
 *     # Convert to UTC
 */
    __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__pytz), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_pytz = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":860
 *     # Convert to UTC
 * 
 *     if tz1.zone != 'UTC':             # <<<<<<<<<<<<<<
 *         deltas = _get_deltas(tz1)
 *         trans = _get_transitions(tz1)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_tz1, __pyx_n_s__zone); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_n_s__UTC), Py_NE); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":861
 * 
 *     if tz1.zone != 'UTC':
 *         deltas = _get_deltas(tz1)             # <<<<<<<<<<<<<<
 *         trans = _get_transitions(tz1)
 *         pos = trans.searchsorted(val) - 1
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_deltas); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_tz1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tz1);
    __Pyx_GIVEREF(__pyx_v_tz1);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      __pyx_bstride_0_deltas = __pyx_bstruct_deltas.strides[0];
      __pyx_bshape_0_deltas = __pyx_bstruct_deltas.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_deltas = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":862
 *     if tz1.zone != 'UTC':
 *         deltas = _get_deltas(tz1)
 *         trans = _get_transitions(tz1)             # <<<<<<<<<<<<<<
 *         pos = trans.searchsorted(val) - 1
 *         if pos < 0:
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_transitions); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_tz1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tz1);
    __Pyx_GIVEREF(__pyx_v_tz1);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_bstride_0_trans = __pyx_bstruct_trans.strides[0];
      __pyx_bshape_0_trans = __pyx_bstruct_trans.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_trans = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":863
 *         deltas = _get_deltas(tz1)
 *         trans = _get_transitions(tz1)
 *         pos = trans.searchsorted(val) - 1             # <<<<<<<<<<<<<<
 *         if pos < 0:
 *             raise ValueError('First time before start of DST info')
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_trans), __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_pos = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":864
 *         trans = _get_transitions(tz1)
 *         pos = trans.searchsorted(val) - 1
 *         if pos < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('First time before start of DST info')
 *         offset = deltas[pos]
 */
    __pyx_t_3 = (__pyx_v_pos < 0);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":865
 *         pos = trans.searchsorted(val) - 1
 *         if pos < 0:
 *             raise ValueError('First time before start of DST info')             # <<<<<<<<<<<<<<
 *         offset = deltas[pos]
 *         utc_date = val - offset
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_58), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":866
 *         if pos < 0:
 *             raise ValueError('First time before start of DST info')
 *         offset = deltas[pos]             # <<<<<<<<<<<<<<
 *         utc_date = val - offset
 *     else:
 */
    __pyx_t_11 = __pyx_v_pos;
    __pyx_t_7 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_bshape_0_deltas;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_deltas)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_11, __pyx_bstride_0_deltas));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":867
 *             raise ValueError('First time before start of DST info')
 *         offset = deltas[pos]
 *         utc_date = val - offset             # <<<<<<<<<<<<<<
 *     else:
 *         utc_date = val
 */
    __pyx_v_utc_date = (__pyx_v_val - __pyx_v_offset);
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":869
 *         utc_date = val - offset
 *     else:
 *         utc_date = val             # <<<<<<<<<<<<<<
 * 
 *     if tz2.zone == 'UTC':
 */
    __pyx_v_utc_date = __pyx_v_val;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":871
 *         utc_date = val
 * 
 *     if tz2.zone == 'UTC':             # <<<<<<<<<<<<<<
 *         return utc_date
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_tz2, __pyx_n_s__zone); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyString_Equals(__pyx_t_5, ((PyObject *)__pyx_n_s__UTC), Py_EQ); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":872
 * 
 *     if tz2.zone == 'UTC':
 *         return utc_date             # <<<<<<<<<<<<<<
 * 
 *     # Convert UTC to other timezone
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_utc_date); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":875
 * 
 *     # Convert UTC to other timezone
 *     trans = _get_transitions(tz2)             # <<<<<<<<<<<<<<
 *     deltas = _get_deltas(tz2)
 *     pos = trans.searchsorted(utc_date) - 1
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_transitions); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(__pyx_v_tz2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tz2);
  __Pyx_GIVEREF(__pyx_v_tz2);
  __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_trans = __pyx_bstruct_trans.strides[0];
    __pyx_bshape_0_trans = __pyx_bstruct_trans.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __Pyx_XDECREF(((PyObject *)__pyx_v_trans));
  __pyx_v_trans = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":876
 *     # Convert UTC to other timezone
 *     trans = _get_transitions(tz2)
 *     deltas = _get_deltas(tz2)             # <<<<<<<<<<<<<<
 *     pos = trans.searchsorted(utc_date) - 1
 *     if pos < 0:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_deltas); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(__pyx_v_tz2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tz2);
  __Pyx_GIVEREF(__pyx_v_tz2);
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_deltas = __pyx_bstruct_deltas.strides[0];
    __pyx_bshape_0_deltas = __pyx_bstruct_deltas.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __Pyx_XDECREF(((PyObject *)__pyx_v_deltas));
  __pyx_v_deltas = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":877
 *     trans = _get_transitions(tz2)
 *     deltas = _get_deltas(tz2)
 *     pos = trans.searchsorted(utc_date) - 1             # <<<<<<<<<<<<<<
 *     if pos < 0:
 *         raise ValueError('First time before start of DST info')
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_trans), __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_utc_date); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_pos = __pyx_t_12;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":878
 *     deltas = _get_deltas(tz2)
 *     pos = trans.searchsorted(utc_date) - 1
 *     if pos < 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('First time before start of DST info')
 * 
 */
  __pyx_t_3 = (__pyx_v_pos < 0);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":879
 *     pos = trans.searchsorted(utc_date) - 1
 *     if pos < 0:
 *         raise ValueError('First time before start of DST info')             # <<<<<<<<<<<<<<
 * 
 *     offset = deltas[pos]
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_59), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":881
 *         raise ValueError('First time before start of DST info')
 * 
 *     offset = deltas[pos]             # <<<<<<<<<<<<<<
 *     return utc_date + offset
 * 
 */
  __pyx_t_12 = __pyx_v_pos;
  __pyx_t_7 = -1;
  if (__pyx_t_12 < 0) {
    __pyx_t_12 += __pyx_bshape_0_deltas;
    if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_deltas)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_offset = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_12, __pyx_bstride_0_deltas));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":882
 * 
 *     offset = deltas[pos]
 *     return utc_date + offset             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64((__pyx_v_utc_date + __pyx_v_offset)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.tz_convert_single", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_trans);
  __Pyx_XDECREF((PyObject *)__pyx_v_deltas);
  __Pyx_XDECREF(__pyx_v_pytz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":888
 * utc_offset_cache = {}
 * 
 * def _get_transitions(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Get UTC times of DST transitions
 */

static PyObject *__pyx_pf_6pandas_3lib_44_get_transitions(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/
static char __pyx_doc_6pandas_3lib_44_get_transitions[] = "\n    Get UTC times of DST transitions\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_44_get_transitions = {__Pyx_NAMESTR("_get_transitions"), (PyCFunction)__pyx_pf_6pandas_3lib_44_get_transitions, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_44_get_transitions)};
static PyObject *__pyx_pf_6pandas_3lib_44_get_transitions(PyObject *__pyx_self, PyObject *__pyx_v_tz) {
  PyObject *__pyx_v_arr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_transitions");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":892
 *     Get UTC times of DST transitions
 *     """
 *     if tz not in trans_cache:             # <<<<<<<<<<<<<<
 *         arr = np.array(tz._utc_transition_times, dtype='M8[ns]')
 *         trans_cache[tz] = arr.view('i8')
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__trans_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_1, __pyx_v_tz))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":893
 *     """
 *     if tz not in trans_cache:
 *         arr = np.array(tz._utc_transition_times, dtype='M8[ns]')             # <<<<<<<<<<<<<<
 *         trans_cache[tz] = arr.view('i8')
 *     return trans_cache[tz]
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_tz, __pyx_n_s_60); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_arr = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":894
 *     if tz not in trans_cache:
 *         arr = np.array(tz._utc_transition_times, dtype='M8[ns]')
 *         trans_cache[tz] = arr.view('i8')             # <<<<<<<<<<<<<<
 *     return trans_cache[tz]
 * 
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_61), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__trans_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyObject_SetItem(__pyx_t_5, __pyx_v_tz, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":895
 *         arr = np.array(tz._utc_transition_times, dtype='M8[ns]')
 *         trans_cache[tz] = arr.view('i8')
 *     return trans_cache[tz]             # <<<<<<<<<<<<<<
 * 
 * def _get_deltas(tz):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__trans_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_tz); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib._get_transitions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":897
 *     return trans_cache[tz]
 * 
 * def _get_deltas(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Get UTC offsets in microseconds corresponding to DST transitions
 */

static PyObject *__pyx_pf_6pandas_3lib_45_get_deltas(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/
static char __pyx_doc_6pandas_3lib_45_get_deltas[] = "\n    Get UTC offsets in microseconds corresponding to DST transitions\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_45_get_deltas = {__Pyx_NAMESTR("_get_deltas"), (PyCFunction)__pyx_pf_6pandas_3lib_45_get_deltas, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_45_get_deltas)};
static PyObject *__pyx_pf_6pandas_3lib_45_get_deltas(PyObject *__pyx_self, PyObject *__pyx_v_tz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_deltas");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":901
 *     Get UTC offsets in microseconds corresponding to DST transitions
 *     """
 *     if tz not in utc_offset_cache:             # <<<<<<<<<<<<<<
 *         utc_offset_cache[tz] = _unbox_utcoffsets(tz._transition_info)
 *     return utc_offset_cache[tz]
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__utc_offset_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_t_1, __pyx_v_tz))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":902
 *     """
 *     if tz not in utc_offset_cache:
 *         utc_offset_cache[tz] = _unbox_utcoffsets(tz._transition_info)             # <<<<<<<<<<<<<<
 *     return utc_offset_cache[tz]
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_tz, __pyx_n_s___transition_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = ((PyObject *)__pyx_f_6pandas_3lib__unbox_utcoffsets(__pyx_t_1, 0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__utc_offset_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetItem(__pyx_t_1, __pyx_v_tz, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":903
 *     if tz not in utc_offset_cache:
 *         utc_offset_cache[tz] = _unbox_utcoffsets(tz._transition_info)
 *     return utc_offset_cache[tz]             # <<<<<<<<<<<<<<
 * 
 * cdef double total_seconds(object td): # Python 2.6 compat
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__utc_offset_cache); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_v_tz); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib._get_deltas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":905
 *     return utc_offset_cache[tz]
 * 
 * cdef double total_seconds(object td): # Python 2.6 compat             # <<<<<<<<<<<<<<
 *     return ((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) //
 *             10**6)
 */

static double __pyx_f_6pandas_3lib_total_seconds(PyObject *__pyx_v_td) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("total_seconds");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":906
 * 
 * cdef double total_seconds(object td): # Python 2.6 compat
 *     return ((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) //             # <<<<<<<<<<<<<<
 *             10**6)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_td, __pyx_n_s__microseconds); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_td, __pyx_n_s__seconds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_td, __pyx_n_s__days); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_int_24); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_3600); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_int_1000000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_4, __pyx_int_1000000); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pandas.lib.total_seconds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":909
 *             10**6)
 * 
 * cpdef ndarray _unbox_utcoffsets(object transinfo):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, sz
 */

static PyObject *__pyx_pf_6pandas_3lib_46_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo); /*proto*/
static PyArrayObject *__pyx_f_6pandas_3lib__unbox_utcoffsets(PyObject *__pyx_v_transinfo, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_sz;
  PyArrayObject *__pyx_v_arr = 0;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  PyArrayObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  __pyx_t_5numpy_int64_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unbox_utcoffsets");
  __pyx_bstruct_arr.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":914
 *         ndarray[int64_t] arr
 * 
 *     sz = len(transinfo)             # <<<<<<<<<<<<<<
 *     arr = np.empty(sz, dtype='i8')
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_transinfo); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_sz = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":915
 * 
 *     sz = len(transinfo)
 *     arr = np.empty(sz, dtype='i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(sz):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_sz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__i8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
    __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_arr = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":917
 *     arr = np.empty(sz, dtype='i8')
 * 
 *     for i in range(sz):             # <<<<<<<<<<<<<<
 *         arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000
 * 
 */
  __pyx_t_1 = __pyx_v_sz;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":918
 * 
 *     for i in range(sz):
 *         arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000             # <<<<<<<<<<<<<<
 * 
 *     return arr
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_transinfo, __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyFloat_FromDouble(__pyx_f_6pandas_3lib_total_seconds(__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_int_1000000000); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_12 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_2); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_arr)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_arr.buf, __pyx_t_13, __pyx_bstride_0_arr) = __pyx_t_12;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":920
 *         arr[i] = int(total_seconds(transinfo[i][0])) * 1000000000
 * 
 *     return arr             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyArrayObject *)__pyx_v_arr);
  goto __pyx_L0;

  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib._unbox_utcoffsets", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":909
 *             10**6)
 * 
 * cpdef ndarray _unbox_utcoffsets(object transinfo):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, sz
 */

static PyObject *__pyx_pf_6pandas_3lib_46_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_46_unbox_utcoffsets(PyObject *__pyx_self, PyObject *__pyx_v_transinfo) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unbox_utcoffsets");
  __pyx_self = __pyx_self;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pandas_3lib__unbox_utcoffsets(__pyx_v_transinfo, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._unbox_utcoffsets", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":923
 * 
 * 
 * def tz_localize_check(ndarray[int64_t] vals, object tz):             # <<<<<<<<<<<<<<
 *     """
 *     Localize tzinfo-naive DateRange to given time zone (using pytz). If
 */

static PyObject *__pyx_pf_6pandas_3lib_47tz_localize_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_47tz_localize_check[] = "\n    Localize tzinfo-naive DateRange to given time zone (using pytz). If\n    there are ambiguities in the values, raise AmbiguousTimeError.\n\n    Returns\n    -------\n    localized : DatetimeIndex\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_47tz_localize_check = {__Pyx_NAMESTR("tz_localize_check"), (PyCFunction)__pyx_pf_6pandas_3lib_47tz_localize_check, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_47tz_localize_check)};
static PyObject *__pyx_pf_6pandas_3lib_47tz_localize_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_vals = 0;
  PyObject *__pyx_v_tz = 0;
  PyArrayObject *__pyx_v_trans = 0;
  PyArrayObject *__pyx_v_deltas = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_pos;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int64_t __pyx_v_v;
  __pyx_t_5numpy_int64_t __pyx_v_dst_start;
  __pyx_t_5numpy_int64_t __pyx_v_dst_end;
  PyObject *__pyx_v_msg = NULL;
  Py_buffer __pyx_bstruct_deltas;
  Py_ssize_t __pyx_bstride_0_deltas = 0;
  Py_ssize_t __pyx_bshape_0_deltas = 0;
  Py_buffer __pyx_bstruct_vals;
  Py_ssize_t __pyx_bstride_0_vals = 0;
  Py_ssize_t __pyx_bshape_0_vals = 0;
  Py_buffer __pyx_bstruct_trans;
  Py_ssize_t __pyx_bstride_0_trans = 0;
  Py_ssize_t __pyx_bshape_0_trans = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  long __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  __pyx_t_5numpy_int64_t __pyx_t_25;
  __pyx_t_5numpy_int64_t __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vals,&__pyx_n_s__tz,0};
  __Pyx_RefNannySetupContext("tz_localize_check");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vals);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tz_localize_check", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tz_localize_check") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_vals = ((PyArrayObject *)values[0]);
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_localize_check", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.tz_localize_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_trans.buf = NULL;
  __pyx_bstruct_deltas.buf = NULL;
  __pyx_bstruct_vals.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vals, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_vals = __pyx_bstruct_vals.strides[0];
  __pyx_bshape_0_vals = __pyx_bstruct_vals.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":934
 *     cdef:
 *         ndarray[int64_t] trans, deltas
 *         Py_ssize_t i, pos, n = len(vals)             # <<<<<<<<<<<<<<
 *         int64_t v, dst_start, dst_end
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_vals)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":937
 *         int64_t v, dst_start, dst_end
 * 
 *     if not have_pytz:             # <<<<<<<<<<<<<<
 *         raise Exception("Could not find pytz module")
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__have_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":938
 * 
 *     if not have_pytz:
 *         raise Exception("Could not find pytz module")             # <<<<<<<<<<<<<<
 * 
 *     if tz == pytz.utc or tz is None:
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":940
 *         raise Exception("Could not find pytz module")
 * 
 *     if tz == pytz.utc or tz is None:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__utc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_tz, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
    __pyx_t_3 = (__pyx_v_tz == Py_None);
    __pyx_t_6 = __pyx_t_3;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":941
 * 
 *     if tz == pytz.utc or tz is None:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     trans = _get_transitions(tz)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":943
 *         return
 * 
 *     trans = _get_transitions(tz)             # <<<<<<<<<<<<<<
 *     deltas = _get_deltas(tz)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_transitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(__pyx_v_tz);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tz);
  __Pyx_GIVEREF(__pyx_v_tz);
  __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_trans = __pyx_bstruct_trans.strides[0];
    __pyx_bshape_0_trans = __pyx_bstruct_trans.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_trans = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":944
 * 
 *     trans = _get_transitions(tz)
 *     deltas = _get_deltas(tz)             # <<<<<<<<<<<<<<
 * 
 *     pos = np.searchsorted(trans, vals[0])
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_deltas); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(__pyx_v_tz);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tz);
  __Pyx_GIVEREF(__pyx_v_tz);
  __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
    }
    __pyx_bstride_0_deltas = __pyx_bstruct_deltas.strides[0];
    __pyx_bshape_0_deltas = __pyx_bstruct_deltas.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_deltas = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":946
 *     deltas = _get_deltas(tz)
 * 
 *     pos = np.searchsorted(trans, vals[0])             # <<<<<<<<<<<<<<
 *     dst_start = trans[pos] + deltas[pos - 1]
 *     dst_end = trans[pos] + deltas[pos]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_13 < 0) {
    __pyx_t_13 += __pyx_bshape_0_vals;
    if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_vals)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_13, __pyx_bstride_0_vals))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_INCREF(((PyObject *)__pyx_v_trans));
  PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_trans));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_trans));
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_pos = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":947
 * 
 *     pos = np.searchsorted(trans, vals[0])
 *     dst_start = trans[pos] + deltas[pos - 1]             # <<<<<<<<<<<<<<
 *     dst_end = trans[pos] + deltas[pos]
 * 
 */
  __pyx_t_1 = __pyx_v_pos;
  __pyx_t_9 = -1;
  if (__pyx_t_1 < 0) {
    __pyx_t_1 += __pyx_bshape_0_trans;
    if (unlikely(__pyx_t_1 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_trans)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = (__pyx_v_pos - 1);
  __pyx_t_9 = -1;
  if (__pyx_t_14 < 0) {
    __pyx_t_14 += __pyx_bshape_0_deltas;
    if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_deltas)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_dst_start = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_trans.buf, __pyx_t_1, __pyx_bstride_0_trans)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_14, __pyx_bstride_0_deltas)));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":948
 *     pos = np.searchsorted(trans, vals[0])
 *     dst_start = trans[pos] + deltas[pos - 1]
 *     dst_end = trans[pos] + deltas[pos]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_15 = __pyx_v_pos;
  __pyx_t_9 = -1;
  if (__pyx_t_15 < 0) {
    __pyx_t_15 += __pyx_bshape_0_trans;
    if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_trans)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = __pyx_v_pos;
  __pyx_t_9 = -1;
  if (__pyx_t_16 < 0) {
    __pyx_t_16 += __pyx_bshape_0_deltas;
    if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_deltas)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_dst_end = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_trans.buf, __pyx_t_15, __pyx_bstride_0_trans)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_16, __pyx_bstride_0_deltas)));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":950
 *     dst_end = trans[pos] + deltas[pos]
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         v = vals[i]
 *         if v >= trans[pos + 1]:
 */
  __pyx_t_17 = __pyx_v_n;
  for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
    __pyx_v_i = __pyx_t_18;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":951
 * 
 *     for i in range(n):
 *         v = vals[i]             # <<<<<<<<<<<<<<
 *         if v >= trans[pos + 1]:
 *             pos += 1
 */
    __pyx_t_19 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_bshape_0_vals;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_vals)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_v = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_19, __pyx_bstride_0_vals));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":952
 *     for i in range(n):
 *         v = vals[i]
 *         if v >= trans[pos + 1]:             # <<<<<<<<<<<<<<
 *             pos += 1
 *             dst_start = trans[pos] + deltas[pos - 1]
 */
    __pyx_t_20 = (__pyx_v_pos + 1);
    __pyx_t_9 = -1;
    if (__pyx_t_20 < 0) {
      __pyx_t_20 += __pyx_bshape_0_trans;
      if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_trans)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = (__pyx_v_v >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_trans.buf, __pyx_t_20, __pyx_bstride_0_trans)));
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":953
 *         v = vals[i]
 *         if v >= trans[pos + 1]:
 *             pos += 1             # <<<<<<<<<<<<<<
 *             dst_start = trans[pos] + deltas[pos - 1]
 *             dst_end = trans[pos] + deltas[pos]
 */
      __pyx_v_pos = (__pyx_v_pos + 1);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":954
 *         if v >= trans[pos + 1]:
 *             pos += 1
 *             dst_start = trans[pos] + deltas[pos - 1]             # <<<<<<<<<<<<<<
 *             dst_end = trans[pos] + deltas[pos]
 * 
 */
      __pyx_t_21 = __pyx_v_pos;
      __pyx_t_9 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_0_trans;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_trans)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_22 = (__pyx_v_pos - 1);
      __pyx_t_9 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_bshape_0_deltas;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_deltas)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_dst_start = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_trans.buf, __pyx_t_21, __pyx_bstride_0_trans)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_22, __pyx_bstride_0_deltas)));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":955
 *             pos += 1
 *             dst_start = trans[pos] + deltas[pos - 1]
 *             dst_end = trans[pos] + deltas[pos]             # <<<<<<<<<<<<<<
 * 
 *         if dst_start > dst_end:
 */
      __pyx_t_23 = __pyx_v_pos;
      __pyx_t_9 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_bshape_0_trans;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_trans)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_24 = __pyx_v_pos;
      __pyx_t_9 = -1;
      if (__pyx_t_24 < 0) {
        __pyx_t_24 += __pyx_bshape_0_deltas;
        if (unlikely(__pyx_t_24 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_deltas)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_dst_end = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_trans.buf, __pyx_t_23, __pyx_bstride_0_trans)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_24, __pyx_bstride_0_deltas)));
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":957
 *             dst_end = trans[pos] + deltas[pos]
 * 
 *         if dst_start > dst_end:             # <<<<<<<<<<<<<<
 *             dst_end, dst_start = dst_start, dst_end
 * 
 */
    __pyx_t_6 = (__pyx_v_dst_start > __pyx_v_dst_end);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":958
 * 
 *         if dst_start > dst_end:
 *             dst_end, dst_start = dst_start, dst_end             # <<<<<<<<<<<<<<
 * 
 *         if dst_start <= v and v <= dst_end:
 */
      __pyx_t_25 = __pyx_v_dst_start;
      __pyx_t_26 = __pyx_v_dst_end;
      __pyx_v_dst_end = __pyx_t_25;
      __pyx_v_dst_start = __pyx_t_26;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":960
 *             dst_end, dst_start = dst_start, dst_end
 * 
 *         if dst_start <= v and v <= dst_end:             # <<<<<<<<<<<<<<
 *             msg = "Cannot localize, ambiguous time %s found" % Timestamp(v)
 *             raise pytz.AmbiguousTimeError(msg)
 */
    __pyx_t_6 = (__pyx_v_dst_start <= __pyx_v_v);
    if (__pyx_t_6) {
      __pyx_t_4 = (__pyx_v_v <= __pyx_v_dst_end);
      __pyx_t_3 = __pyx_t_4;
    } else {
      __pyx_t_3 = __pyx_t_6;
    }
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":961
 * 
 *         if dst_start <= v and v <= dst_end:
 *             msg = "Cannot localize, ambiguous time %s found" % Timestamp(v)             # <<<<<<<<<<<<<<
 *             raise pytz.AmbiguousTimeError(msg)
 * 
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_v); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_64), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_msg = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":962
 *         if dst_start <= v and v <= dst_end:
 *             msg = "Cannot localize, ambiguous time %s found" % Timestamp(v)
 *             raise pytz.AmbiguousTimeError(msg)             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__AmbiguousTimeError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_msg);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg);
      __Pyx_GIVEREF(__pyx_v_msg);
      __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L12;
    }
    __pyx_L12:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vals);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.tz_localize_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vals);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_trans);
  __Pyx_XDECREF((PyObject *)__pyx_v_deltas);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":966
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def tz_localize_to_utc(ndarray[int64_t] vals, object tz):             # <<<<<<<<<<<<<<
 *     """
 *     Localize tzinfo-naive DateRange to given time zone (using pytz). If
 */

static PyObject *__pyx_pf_6pandas_3lib_48tz_localize_to_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_48tz_localize_to_utc[] = "\n    Localize tzinfo-naive DateRange to given time zone (using pytz). If\n    there are ambiguities in the values, raise AmbiguousTimeError.\n\n    Returns\n    -------\n    localized : DatetimeIndex\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_48tz_localize_to_utc = {__Pyx_NAMESTR("tz_localize_to_utc"), (PyCFunction)__pyx_pf_6pandas_3lib_48tz_localize_to_utc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_48tz_localize_to_utc)};
static PyObject *__pyx_pf_6pandas_3lib_48tz_localize_to_utc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_vals = 0;
  PyObject *__pyx_v_tz = 0;
  PyArrayObject *__pyx_v_trans = 0;
  PyArrayObject *__pyx_v_deltas = 0;
  PyArrayObject *__pyx_v_idx_shifted = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_pos;
  Py_ssize_t __pyx_v_ntrans;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int64_t *__pyx_v_tdata;
  __pyx_t_5numpy_int64_t __pyx_v_v;
  __pyx_t_5numpy_int64_t __pyx_v_left;
  __pyx_t_5numpy_int64_t __pyx_v_right;
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_result_a = 0;
  PyArrayObject *__pyx_v_result_b = 0;
  PyObject *__pyx_v_stamp = NULL;
  Py_buffer __pyx_bstruct_deltas;
  Py_ssize_t __pyx_bstride_0_deltas = 0;
  Py_ssize_t __pyx_bshape_0_deltas = 0;
  Py_buffer __pyx_bstruct_result_b;
  Py_ssize_t __pyx_bstride_0_result_b = 0;
  Py_ssize_t __pyx_bshape_0_result_b = 0;
  Py_buffer __pyx_bstruct_result_a;
  Py_ssize_t __pyx_bstride_0_result_a = 0;
  Py_ssize_t __pyx_bshape_0_result_a = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_vals;
  Py_ssize_t __pyx_bstride_0_vals = 0;
  Py_ssize_t __pyx_bshape_0_vals = 0;
  Py_buffer __pyx_bstruct_trans;
  Py_ssize_t __pyx_bstride_0_trans = 0;
  Py_ssize_t __pyx_bshape_0_trans = 0;
  Py_buffer __pyx_bstruct_idx_shifted;
  Py_ssize_t __pyx_bstride_0_idx_shifted = 0;
  Py_ssize_t __pyx_bshape_0_idx_shifted = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyArrayObject *__pyx_t_15 = NULL;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __pyx_t_5numpy_int64_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  __pyx_t_5numpy_int64_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vals,&__pyx_n_s__tz,0};
  __Pyx_RefNannySetupContext("tz_localize_to_utc");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vals);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tz);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tz_localize_to_utc", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tz_localize_to_utc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_vals = ((PyArrayObject *)values[0]);
    __pyx_v_tz = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tz_localize_to_utc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.tz_localize_to_utc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_trans.buf = NULL;
  __pyx_bstruct_deltas.buf = NULL;
  __pyx_bstruct_idx_shifted.buf = NULL;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_result_a.buf = NULL;
  __pyx_bstruct_result_b.buf = NULL;
  __pyx_bstruct_vals.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vals), __pyx_ptype_5numpy_ndarray, 1, "vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_vals, (PyObject*)__pyx_v_vals, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_vals = __pyx_bstruct_vals.strides[0];
  __pyx_bshape_0_vals = __pyx_bstruct_vals.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":977
 *     cdef:
 *         ndarray[int64_t] trans, deltas, idx_shifted
 *         Py_ssize_t i, idx, pos, ntrans, n = len(vals)             # <<<<<<<<<<<<<<
 *         int64_t *tdata
 *         int64_t v, left, right
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_vals)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":984
 *     # Vectorized version of DstTzInfo.localize
 * 
 *     if not have_pytz:             # <<<<<<<<<<<<<<
 *         raise Exception("Could not find pytz module")
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__have_pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":985
 * 
 *     if not have_pytz:
 *         raise Exception("Could not find pytz module")             # <<<<<<<<<<<<<<
 * 
 *     if tz == pytz.utc or tz is None:
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":987
 *         raise Exception("Could not find pytz module")
 * 
 *     if tz == pytz.utc or tz is None:             # <<<<<<<<<<<<<<
 *         return vals
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__utc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_tz, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_4) {
    __pyx_t_3 = (__pyx_v_tz == Py_None);
    __pyx_t_6 = __pyx_t_3;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":988
 * 
 *     if tz == pytz.utc or tz is None:
 *         return vals             # <<<<<<<<<<<<<<
 * 
 *     trans = _get_transitions(tz)  # transition dates
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_vals));
    __pyx_r = ((PyObject *)__pyx_v_vals);
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":990
 *         return vals
 * 
 *     trans = _get_transitions(tz)  # transition dates             # <<<<<<<<<<<<<<
 *     deltas = _get_deltas(tz)      # utc offsets
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_transitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(__pyx_v_tz);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tz);
  __Pyx_GIVEREF(__pyx_v_tz);
  __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_trans, (PyObject*)__pyx_v_trans, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_trans = __pyx_bstruct_trans.strides[0];
    __pyx_bshape_0_trans = __pyx_bstruct_trans.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_trans = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":991
 * 
 *     trans = _get_transitions(tz)  # transition dates
 *     deltas = _get_deltas(tz)      # utc offsets             # <<<<<<<<<<<<<<
 * 
 *     tdata = <int64_t*> trans.data
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_deltas); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(__pyx_v_tz);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tz);
  __Pyx_GIVEREF(__pyx_v_tz);
  __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_deltas, (PyObject*)__pyx_v_deltas, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
    }
    __pyx_bstride_0_deltas = __pyx_bstruct_deltas.strides[0];
    __pyx_bshape_0_deltas = __pyx_bstruct_deltas.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_deltas = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":993
 *     deltas = _get_deltas(tz)      # utc offsets
 * 
 *     tdata = <int64_t*> trans.data             # <<<<<<<<<<<<<<
 *     ntrans = len(trans)
 * 
 */
  __pyx_v_tdata = ((__pyx_t_5numpy_int64_t *)__pyx_v_trans->data);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":994
 * 
 *     tdata = <int64_t*> trans.data
 *     ntrans = len(trans)             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_trans)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ntrans = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":996
 *     ntrans = len(trans)
 * 
 *     result = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result_a = np.empty(n, dtype=np.int64)
 *     result_b = np.empty(n, dtype=np.int64)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__int64); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_14);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_14);
  __pyx_t_14 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":997
 * 
 *     result = np.empty(n, dtype=np.int64)
 *     result_a = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result_b = np.empty(n, dtype=np.int64)
 *     result_a.fill(NPY_NAT)
 */
  __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_14);
  __pyx_t_14 = 0;
  __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_14));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_13 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
  if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result_a);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result_a, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result_a, (PyObject*)__pyx_v_result_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result_a = __pyx_bstruct_result_a.strides[0];
    __pyx_bshape_0_result_a = __pyx_bstruct_result_a.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_result_a = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":998
 *     result = np.empty(n, dtype=np.int64)
 *     result_a = np.empty(n, dtype=np.int64)
 *     result_b = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     result_a.fill(NPY_NAT)
 *     result_b.fill(NPY_NAT)
 */
  __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;
  __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_13));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_14, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result_b);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result_b, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result_b, (PyObject*)__pyx_v_result_b, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_result_b = __pyx_bstruct_result_b.strides[0];
    __pyx_bshape_0_result_b = __pyx_bstruct_result_b.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_result_b = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":999
 *     result_a = np.empty(n, dtype=np.int64)
 *     result_b = np.empty(n, dtype=np.int64)
 *     result_a.fill(NPY_NAT)             # <<<<<<<<<<<<<<
 *     result_b.fill(NPY_NAT)
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_result_a), __pyx_n_s__fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_13 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_6pandas_3lib_NPY_NAT); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;
  __pyx_t_13 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1000
 *     result_b = np.empty(n, dtype=np.int64)
 *     result_a.fill(NPY_NAT)
 *     result_b.fill(NPY_NAT)             # <<<<<<<<<<<<<<
 * 
 *     # left side
 */
  __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_v_result_b), __pyx_n_s__fill); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_7 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_6pandas_3lib_NPY_NAT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1004
 *     # left side
 *     idx_shifted = _ensure_int64(
 *         np.maximum(0, trans.searchsorted(vals - DAY_NS, side='right') - 1))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__maximum); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_trans), __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_13 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_6pandas_3lib_DAY_NS); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyNumber_Subtract(((PyObject *)__pyx_v_vals), __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_13));
  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_14);
  __pyx_t_14 = 0;
  __pyx_t_14 = PyDict_New(); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_14));
  if (PyDict_SetItem(__pyx_t_14, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__right)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_t_13), ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
  __pyx_t_14 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_14);
  __pyx_t_14 = 0;
  __pyx_t_14 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_f_6pandas_3lib__ensure_int64(__pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_idx_shifted);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_idx_shifted, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_idx_shifted, (PyObject*)__pyx_v_idx_shifted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
    }
    __pyx_bstride_0_idx_shifted = __pyx_bstruct_idx_shifted.strides[0];
    __pyx_bshape_0_idx_shifted = __pyx_bstruct_idx_shifted.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_idx_shifted = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1006
 *         np.maximum(0, trans.searchsorted(vals - DAY_NS, side='right') - 1))
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         v = vals[i] - deltas[idx_shifted[i]]
 *         pos = bisect_right_i8(tdata, v, ntrans) - 1
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1007
 * 
 *     for i in range(n):
 *         v = vals[i] - deltas[idx_shifted[i]]             # <<<<<<<<<<<<<<
 *         pos = bisect_right_i8(tdata, v, ntrans) - 1
 * 
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_idx_shifted.buf, __pyx_t_18, __pyx_bstride_0_idx_shifted));
    __pyx_v_v = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_17, __pyx_bstride_0_vals)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_19, __pyx_bstride_0_deltas)));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1008
 *     for i in range(n):
 *         v = vals[i] - deltas[idx_shifted[i]]
 *         pos = bisect_right_i8(tdata, v, ntrans) - 1             # <<<<<<<<<<<<<<
 * 
 *         # timestamp falls to the left side of the DST transition
 */
    __pyx_t_2 = __pyx_f_6pandas_3lib_bisect_right_i8(__pyx_v_tdata, __pyx_v_v, __pyx_v_ntrans); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_v_pos = __pyx_t_20;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1011
 * 
 *         # timestamp falls to the left side of the DST transition
 *         if v + deltas[pos] == vals[i]:             # <<<<<<<<<<<<<<
 *             result_a[i] = v
 * 
 */
    __pyx_t_20 = __pyx_v_pos;
    __pyx_t_21 = __pyx_v_i;
    __pyx_t_6 = ((__pyx_v_v + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_20, __pyx_bstride_0_deltas))) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_21, __pyx_bstride_0_vals)));
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1012
 *         # timestamp falls to the left side of the DST transition
 *         if v + deltas[pos] == vals[i]:
 *             result_a[i] = v             # <<<<<<<<<<<<<<
 * 
 *     # right side
 */
      __pyx_t_22 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result_a.buf, __pyx_t_22, __pyx_bstride_0_result_a) = __pyx_v_v;
      goto __pyx_L10;
    }
    __pyx_L10:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1016
 *     # right side
 *     idx_shifted = _ensure_int64(
 *         np.maximum(0, trans.searchsorted(vals + DAY_NS, side='right') - 1))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__maximum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_trans), __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_5 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_6pandas_3lib_DAY_NS); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_13 = PyNumber_Add(((PyObject *)__pyx_v_vals), __pyx_t_5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;
  __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_13));
  if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__right)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_14, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
  __pyx_t_13 = PyNumber_Subtract(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;
  __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __pyx_t_7 = __pyx_f_6pandas_3lib__ensure_int64(__pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_idx_shifted);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_idx_shifted, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_idx_shifted, (PyObject*)__pyx_v_idx_shifted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_idx_shifted = __pyx_bstruct_idx_shifted.strides[0];
    __pyx_bshape_0_idx_shifted = __pyx_bstruct_idx_shifted.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_idx_shifted));
  __pyx_v_idx_shifted = ((PyArrayObject *)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1018
 *         np.maximum(0, trans.searchsorted(vals + DAY_NS, side='right') - 1))
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         v = vals[i] - deltas[idx_shifted[i]]
 *         pos = bisect_right_i8(tdata, v, ntrans) - 1
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1019
 * 
 *     for i in range(n):
 *         v = vals[i] - deltas[idx_shifted[i]]             # <<<<<<<<<<<<<<
 *         pos = bisect_right_i8(tdata, v, ntrans) - 1
 * 
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_24 = __pyx_v_i;
    __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_idx_shifted.buf, __pyx_t_24, __pyx_bstride_0_idx_shifted));
    __pyx_v_v = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_23, __pyx_bstride_0_vals)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_25, __pyx_bstride_0_deltas)));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1020
 *     for i in range(n):
 *         v = vals[i] - deltas[idx_shifted[i]]
 *         pos = bisect_right_i8(tdata, v, ntrans) - 1             # <<<<<<<<<<<<<<
 * 
 *         # timestamp falls to the right side of the DST transition
 */
    __pyx_t_7 = __pyx_f_6pandas_3lib_bisect_right_i8(__pyx_v_tdata, __pyx_v_v, __pyx_v_ntrans); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = PyNumber_Subtract(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_26 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_26 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_v_pos = __pyx_t_26;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1023
 * 
 *         # timestamp falls to the right side of the DST transition
 *         if v + deltas[pos] == vals[i]:             # <<<<<<<<<<<<<<
 *             result_b[i] = v
 * 
 */
    __pyx_t_26 = __pyx_v_pos;
    __pyx_t_27 = __pyx_v_i;
    __pyx_t_6 = ((__pyx_v_v + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_deltas.buf, __pyx_t_26, __pyx_bstride_0_deltas))) == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_27, __pyx_bstride_0_vals)));
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1024
 *         # timestamp falls to the right side of the DST transition
 *         if v + deltas[pos] == vals[i]:
 *             result_b[i] = v             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
      __pyx_t_28 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result_b.buf, __pyx_t_28, __pyx_bstride_0_result_b) = __pyx_v_v;
      goto __pyx_L13;
    }
    __pyx_L13:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1026
 *             result_b[i] = v
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         left = result_a[i]
 *         right = result_b[i]
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_1; __pyx_t_16+=1) {
    __pyx_v_i = __pyx_t_16;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1027
 * 
 *     for i in range(n):
 *         left = result_a[i]             # <<<<<<<<<<<<<<
 *         right = result_b[i]
 *         if left != NPY_NAT and right != NPY_NAT:
 */
    __pyx_t_29 = __pyx_v_i;
    __pyx_v_left = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result_a.buf, __pyx_t_29, __pyx_bstride_0_result_a));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1028
 *     for i in range(n):
 *         left = result_a[i]
 *         right = result_b[i]             # <<<<<<<<<<<<<<
 *         if left != NPY_NAT and right != NPY_NAT:
 *             if left == right:
 */
    __pyx_t_30 = __pyx_v_i;
    __pyx_v_right = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result_b.buf, __pyx_t_30, __pyx_bstride_0_result_b));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1029
 *         left = result_a[i]
 *         right = result_b[i]
 *         if left != NPY_NAT and right != NPY_NAT:             # <<<<<<<<<<<<<<
 *             if left == right:
 *                 result[i] = left
 */
    __pyx_t_6 = (__pyx_v_left != __pyx_v_6pandas_3lib_NPY_NAT);
    if (__pyx_t_6) {
      __pyx_t_4 = (__pyx_v_right != __pyx_v_6pandas_3lib_NPY_NAT);
      __pyx_t_3 = __pyx_t_4;
    } else {
      __pyx_t_3 = __pyx_t_6;
    }
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1030
 *         right = result_b[i]
 *         if left != NPY_NAT and right != NPY_NAT:
 *             if left == right:             # <<<<<<<<<<<<<<
 *                 result[i] = left
 *             else:
 */
      __pyx_t_3 = (__pyx_v_left == __pyx_v_right);
      if (__pyx_t_3) {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1031
 *         if left != NPY_NAT and right != NPY_NAT:
 *             if left == right:
 *                 result[i] = left             # <<<<<<<<<<<<<<
 *             else:
 *                 stamp = Timestamp(vals[i])
 */
        __pyx_t_31 = __pyx_v_i;
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_31, __pyx_bstride_0_result) = __pyx_v_left;
        goto __pyx_L17;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1033
 *                 result[i] = left
 *             else:
 *                 stamp = Timestamp(vals[i])             # <<<<<<<<<<<<<<
 *                 raise pytz.AmbiguousTimeError(stamp)
 *         elif left != NPY_NAT:
 */
        __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_7 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_32, __pyx_bstride_0_vals))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
        __pyx_v_stamp = __pyx_t_7;
        __pyx_t_7 = 0;

        /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1034
 *             else:
 *                 stamp = Timestamp(vals[i])
 *                 raise pytz.AmbiguousTimeError(stamp)             # <<<<<<<<<<<<<<
 *         elif left != NPY_NAT:
 *             result[i] = left
 */
        __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__AmbiguousTimeError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_7));
        __Pyx_INCREF(__pyx_v_stamp);
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_stamp);
        __Pyx_GIVEREF(__pyx_v_stamp);
        __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __Pyx_Raise(__pyx_t_13, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L17:;
      goto __pyx_L16;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1035
 *                 stamp = Timestamp(vals[i])
 *                 raise pytz.AmbiguousTimeError(stamp)
 *         elif left != NPY_NAT:             # <<<<<<<<<<<<<<
 *             result[i] = left
 *         elif right != NPY_NAT:
 */
    __pyx_t_3 = (__pyx_v_left != __pyx_v_6pandas_3lib_NPY_NAT);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1036
 *                 raise pytz.AmbiguousTimeError(stamp)
 *         elif left != NPY_NAT:
 *             result[i] = left             # <<<<<<<<<<<<<<
 *         elif right != NPY_NAT:
 *             result[i] = right
 */
      __pyx_t_33 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_33, __pyx_bstride_0_result) = __pyx_v_left;
      goto __pyx_L16;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1037
 *         elif left != NPY_NAT:
 *             result[i] = left
 *         elif right != NPY_NAT:             # <<<<<<<<<<<<<<
 *             result[i] = right
 *         else:
 */
    __pyx_t_3 = (__pyx_v_right != __pyx_v_6pandas_3lib_NPY_NAT);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1038
 *             result[i] = left
 *         elif right != NPY_NAT:
 *             result[i] = right             # <<<<<<<<<<<<<<
 *         else:
 *             stamp = Timestamp(vals[i])
 */
      __pyx_t_34 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_34, __pyx_bstride_0_result) = __pyx_v_right;
      goto __pyx_L16;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1040
 *             result[i] = right
 *         else:
 *             stamp = Timestamp(vals[i])             # <<<<<<<<<<<<<<
 *             raise pytz.NonExistentTimeError(stamp)
 * 
 */
      __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_35 = __pyx_v_i;
      __pyx_t_7 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_vals.buf, __pyx_t_35, __pyx_bstride_0_vals))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_v_stamp = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1041
 *         else:
 *             stamp = Timestamp(vals[i])
 *             raise pytz.NonExistentTimeError(stamp)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s_66); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_INCREF(__pyx_v_stamp);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_stamp);
      __Pyx_GIVEREF(__pyx_v_stamp);
      __pyx_t_13 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_13, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L16:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1043
 *             raise pytz.NonExistentTimeError(stamp)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * cdef _ensure_int64(object arr):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result_b);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result_a);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vals);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_idx_shifted);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.tz_localize_to_utc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_deltas);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result_b);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result_a);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_vals);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_trans);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_idx_shifted);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_trans);
  __Pyx_XDECREF((PyObject *)__pyx_v_deltas);
  __Pyx_XDECREF((PyObject *)__pyx_v_idx_shifted);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_result_a);
  __Pyx_XDECREF((PyObject *)__pyx_v_result_b);
  __Pyx_XDECREF(__pyx_v_stamp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1045
 *     return result
 * 
 * cdef _ensure_int64(object arr):             # <<<<<<<<<<<<<<
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT64:
 */

static PyObject *__pyx_f_6pandas_3lib__ensure_int64(PyObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_int64");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1046
 * 
 * cdef _ensure_int64(object arr):
 *     if util.is_array(arr):             # <<<<<<<<<<<<<<
 *         if (<ndarray> arr).descr.type_num == NPY_INT64:
 *             return arr
 */
  __pyx_t_1 = __pyx_f_4util_is_array(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1047
 * cdef _ensure_int64(object arr):
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT64:             # <<<<<<<<<<<<<<
 *             return arr
 *         else:
 */
    __pyx_t_2 = (((PyArrayObject *)__pyx_v_arr)->descr->type_num == NPY_INT64);
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1048
 *     if util.is_array(arr):
 *         if (<ndarray> arr).descr.type_num == NPY_INT64:
 *             return arr             # <<<<<<<<<<<<<<
 *         else:
 *             return arr.astype(np.int64)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1050
 *             return arr
 *         else:
 *             return arr.astype(np.int64)             # <<<<<<<<<<<<<<
 *     else:
 *         return np.array(arr, dtype=np.int64)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1052
 *             return arr.astype(np.int64)
 *     else:
 *         return np.array(arr, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib._ensure_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1055
 * 
 * 
 * cdef inline bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t pivot, left = 0, right = n
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_bisect_right_i8(__pyx_t_5numpy_int64_t *__pyx_v_data, __pyx_t_5numpy_int64_t __pyx_v_val, Py_ssize_t __pyx_v_n) {
  Py_ssize_t __pyx_v_pivot;
  Py_ssize_t __pyx_v_left;
  Py_ssize_t __pyx_v_right;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bisect_right_i8");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1056
 * 
 * cdef inline bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n):
 *     cdef Py_ssize_t pivot, left = 0, right = n             # <<<<<<<<<<<<<<
 * 
 *     # edge cases
 */
  __pyx_v_left = 0;
  __pyx_v_right = __pyx_v_n;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1059
 * 
 *     # edge cases
 *     if val > data[n - 1]:             # <<<<<<<<<<<<<<
 *         return n
 * 
 */
  __pyx_t_1 = (__pyx_v_val > (__pyx_v_data[(__pyx_v_n - 1)]));
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1060
 *     # edge cases
 *     if val > data[n - 1]:
 *         return n             # <<<<<<<<<<<<<<
 * 
 *     if val < data[0]:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1062
 *         return n
 * 
 *     if val < data[0]:             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_1 = (__pyx_v_val < (__pyx_v_data[0]));
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1063
 * 
 *     if val < data[0]:
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     while left < right:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1065
 *         return 0
 * 
 *     while left < right:             # <<<<<<<<<<<<<<
 *         pivot = left + (right - left) // 2
 * 
 */
  while (1) {
    __pyx_t_1 = (__pyx_v_left < __pyx_v_right);
    if (!__pyx_t_1) break;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1066
 * 
 *     while left < right:
 *         pivot = left + (right - left) // 2             # <<<<<<<<<<<<<<
 * 
 *         if data[pivot] <= val:
 */
    __pyx_v_pivot = (__pyx_v_left + __Pyx_div_Py_ssize_t((__pyx_v_right - __pyx_v_left), 2));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1068
 *         pivot = left + (right - left) // 2
 * 
 *         if data[pivot] <= val:             # <<<<<<<<<<<<<<
 *             left = pivot + 1
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_data[__pyx_v_pivot]) <= __pyx_v_val);
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1069
 * 
 *         if data[pivot] <= val:
 *             left = pivot + 1             # <<<<<<<<<<<<<<
 *         else:
 *             right = pivot
 */
      __pyx_v_left = (__pyx_v_pivot + 1);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1071
 *             left = pivot + 1
 *         else:
 *             right = pivot             # <<<<<<<<<<<<<<
 * 
 *     return left
 */
      __pyx_v_right = __pyx_v_pivot;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1073
 *             right = pivot
 * 
 *     return left             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_left); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.bisect_right_i8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1079
 * #----------------------------------------------------------------------
 * 
 * def build_field_sarray(ndarray[int64_t] dtindex):             # <<<<<<<<<<<<<<
 *     '''
 *     Datetime as int64 representation to a structured array of fields
 */

static PyObject *__pyx_pf_6pandas_3lib_49build_field_sarray(PyObject *__pyx_self, PyObject *__pyx_v_dtindex); /*proto*/
static char __pyx_doc_6pandas_3lib_49build_field_sarray[] = "\n    Datetime as int64 representation to a structured array of fields\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_49build_field_sarray = {__Pyx_NAMESTR("build_field_sarray"), (PyCFunction)__pyx_pf_6pandas_3lib_49build_field_sarray, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_49build_field_sarray)};
static PyObject *__pyx_pf_6pandas_3lib_49build_field_sarray(PyObject *__pyx_self, PyObject *__pyx_v_dtindex) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_count;
  pandas_datetimestruct __pyx_v_dts;
  PyArrayObject *__pyx_v_years = 0;
  PyArrayObject *__pyx_v_months = 0;
  PyArrayObject *__pyx_v_days = 0;
  PyArrayObject *__pyx_v_hours = 0;
  PyArrayObject *__pyx_v_minutes = 0;
  PyArrayObject *__pyx_v_seconds = 0;
  PyArrayObject *__pyx_v_mus = 0;
  PyObject *__pyx_v_sa_dtype = NULL;
  PyObject *__pyx_v_out = NULL;
  Py_buffer __pyx_bstruct_mus;
  Py_ssize_t __pyx_bstride_0_mus = 0;
  Py_ssize_t __pyx_bshape_0_mus = 0;
  Py_buffer __pyx_bstruct_months;
  Py_ssize_t __pyx_bstride_0_months = 0;
  Py_ssize_t __pyx_bshape_0_months = 0;
  Py_buffer __pyx_bstruct_seconds;
  Py_ssize_t __pyx_bstride_0_seconds = 0;
  Py_ssize_t __pyx_bshape_0_seconds = 0;
  Py_buffer __pyx_bstruct_days;
  Py_ssize_t __pyx_bstride_0_days = 0;
  Py_ssize_t __pyx_bshape_0_days = 0;
  Py_buffer __pyx_bstruct_years;
  Py_ssize_t __pyx_bstride_0_years = 0;
  Py_ssize_t __pyx_bshape_0_years = 0;
  Py_buffer __pyx_bstruct_hours;
  Py_ssize_t __pyx_bstride_0_hours = 0;
  Py_ssize_t __pyx_bshape_0_hours = 0;
  Py_buffer __pyx_bstruct_dtindex;
  Py_ssize_t __pyx_bstride_0_dtindex = 0;
  Py_ssize_t __pyx_bshape_0_dtindex = 0;
  Py_buffer __pyx_bstruct_minutes;
  Py_ssize_t __pyx_bstride_0_minutes = 0;
  Py_ssize_t __pyx_bshape_0_minutes = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_field_sarray");
  __pyx_self = __pyx_self;
  __pyx_bstruct_years.buf = NULL;
  __pyx_bstruct_months.buf = NULL;
  __pyx_bstruct_days.buf = NULL;
  __pyx_bstruct_hours.buf = NULL;
  __pyx_bstruct_minutes.buf = NULL;
  __pyx_bstruct_seconds.buf = NULL;
  __pyx_bstruct_mus.buf = NULL;
  __pyx_bstruct_dtindex.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_dtindex, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_dtindex = __pyx_bstruct_dtindex.strides[0];
  __pyx_bshape_0_dtindex = __pyx_bstruct_dtindex.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1084
 *     '''
 *     cdef:
 *         Py_ssize_t i, count = 0             # <<<<<<<<<<<<<<
 *         int isleap
 *         pandas_datetimestruct dts
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1089
 *         ndarray[int32_t] years, months, days, hours, minutes, seconds, mus
 * 
 *     count = len(dtindex)             # <<<<<<<<<<<<<<
 * 
 *     sa_dtype = [('Y', 'i4'), # year
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_dtindex); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_count = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1097
 *                 ('m', 'i4'), # min
 *                 ('s', 'i4'), # second
 *                 ('u', 'i4')] # microsecond             # <<<<<<<<<<<<<<
 * 
 *     out = np.empty(count, dtype=sa_dtype)
 */
  __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_67));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_k_tuple_67));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_68));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_k_tuple_68));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_69));
  PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_k_tuple_69));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_70));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_k_tuple_70));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_71));
  PyList_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_k_tuple_71));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_72));
  PyList_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_k_tuple_72));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));
  __Pyx_INCREF(((PyObject *)__pyx_k_tuple_73));
  PyList_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_k_tuple_73));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));
  __pyx_v_sa_dtype = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1099
 *                 ('u', 'i4')] # microsecond
 * 
 *     out = np.empty(count, dtype=sa_dtype)             # <<<<<<<<<<<<<<
 * 
 *     years = out['Y']
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_v_sa_dtype)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_out = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1101
 *     out = np.empty(count, dtype=sa_dtype)
 * 
 *     years = out['Y']             # <<<<<<<<<<<<<<
 *     months = out['M']
 *     days = out['D']
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_v_out, ((PyObject *)__pyx_n_s__Y)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_years);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_years, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_years, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_years = __pyx_bstruct_years.strides[0];
    __pyx_bshape_0_years = __pyx_bstruct_years.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_years = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1102
 * 
 *     years = out['Y']
 *     months = out['M']             # <<<<<<<<<<<<<<
 *     days = out['D']
 *     hours = out['h']
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_v_out, ((PyObject *)__pyx_n_s__M)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_months);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_months, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_months, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_months = __pyx_bstruct_months.strides[0];
    __pyx_bshape_0_months = __pyx_bstruct_months.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_months = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1103
 *     years = out['Y']
 *     months = out['M']
 *     days = out['D']             # <<<<<<<<<<<<<<
 *     hours = out['h']
 *     minutes = out['m']
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_v_out, ((PyObject *)__pyx_n_s__D)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_days);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_days, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_days, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_days = __pyx_bstruct_days.strides[0];
    __pyx_bshape_0_days = __pyx_bstruct_days.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_days = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1104
 *     months = out['M']
 *     days = out['D']
 *     hours = out['h']             # <<<<<<<<<<<<<<
 *     minutes = out['m']
 *     seconds = out['s']
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_v_out, ((PyObject *)__pyx_n_s__h)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_hours);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_hours, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_hours, (PyObject*)__pyx_v_hours, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_hours = __pyx_bstruct_hours.strides[0];
    __pyx_bshape_0_hours = __pyx_bstruct_hours.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_hours = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1105
 *     days = out['D']
 *     hours = out['h']
 *     minutes = out['m']             # <<<<<<<<<<<<<<
 *     seconds = out['s']
 *     mus = out['u']
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_v_out, ((PyObject *)__pyx_n_s__m)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minutes);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_minutes, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_minutes, (PyObject*)__pyx_v_minutes, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_minutes = __pyx_bstruct_minutes.strides[0];
    __pyx_bshape_0_minutes = __pyx_bstruct_minutes.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_minutes = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1106
 *     hours = out['h']
 *     minutes = out['m']
 *     seconds = out['s']             # <<<<<<<<<<<<<<
 *     mus = out['u']
 * 
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_v_out, ((PyObject *)__pyx_n_s__s)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_seconds);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_seconds, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_seconds, (PyObject*)__pyx_v_seconds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_seconds = __pyx_bstruct_seconds.strides[0];
    __pyx_bshape_0_seconds = __pyx_bstruct_seconds.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_seconds = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1107
 *     minutes = out['m']
 *     seconds = out['s']
 *     mus = out['u']             # <<<<<<<<<<<<<<
 * 
 *     for i in range(count):
 */
  __pyx_t_5 = PyObject_GetItem(__pyx_v_out, ((PyObject *)__pyx_n_s__u)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mus);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_mus, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mus, (PyObject*)__pyx_v_mus, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_mus = __pyx_bstruct_mus.strides[0];
    __pyx_bshape_0_mus = __pyx_bstruct_mus.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_mus = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1109
 *     mus = out['u']
 * 
 *     for i in range(count):             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *         years[i] = dts.year
 */
  __pyx_t_1 = __pyx_v_count;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1110
 * 
 *     for i in range(count):
 *         pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *         years[i] = dts.year
 *         months[i] = dts.month
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_dtindex;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_12, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1111
 *     for i in range(count):
 *         pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *         years[i] = dts.year             # <<<<<<<<<<<<<<
 *         months[i] = dts.month
 *         days[i] = dts.day
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_years;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_years)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_years.buf, __pyx_t_13, __pyx_bstride_0_years) = __pyx_v_dts.year;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1112
 *         pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *         years[i] = dts.year
 *         months[i] = dts.month             # <<<<<<<<<<<<<<
 *         days[i] = dts.day
 *         hours[i] = dts.hour
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_months;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_months)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_months.buf, __pyx_t_14, __pyx_bstride_0_months) = __pyx_v_dts.month;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1113
 *         years[i] = dts.year
 *         months[i] = dts.month
 *         days[i] = dts.day             # <<<<<<<<<<<<<<
 *         hours[i] = dts.hour
 *         minutes[i] = dts.min
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_bshape_0_days;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_days)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_days.buf, __pyx_t_15, __pyx_bstride_0_days) = __pyx_v_dts.day;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1114
 *         months[i] = dts.month
 *         days[i] = dts.day
 *         hours[i] = dts.hour             # <<<<<<<<<<<<<<
 *         minutes[i] = dts.min
 *         seconds[i] = dts.sec
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_bshape_0_hours;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_hours)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_hours.buf, __pyx_t_16, __pyx_bstride_0_hours) = __pyx_v_dts.hour;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1115
 *         days[i] = dts.day
 *         hours[i] = dts.hour
 *         minutes[i] = dts.min             # <<<<<<<<<<<<<<
 *         seconds[i] = dts.sec
 *         mus[i] = dts.us
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_bshape_0_minutes;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_minutes)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_minutes.buf, __pyx_t_17, __pyx_bstride_0_minutes) = __pyx_v_dts.min;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1116
 *         hours[i] = dts.hour
 *         minutes[i] = dts.min
 *         seconds[i] = dts.sec             # <<<<<<<<<<<<<<
 *         mus[i] = dts.us
 * 
 */
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_bshape_0_seconds;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_seconds)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_seconds.buf, __pyx_t_18, __pyx_bstride_0_seconds) = __pyx_v_dts.sec;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1117
 *         minutes[i] = dts.min
 *         seconds[i] = dts.sec
 *         mus[i] = dts.us             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
    __pyx_t_19 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_bshape_0_mus;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_mus)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_mus.buf, __pyx_t_19, __pyx_bstride_0_mus) = __pyx_v_dts.us;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1119
 *         mus[i] = dts.us
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * def get_time_micros(ndarray[int64_t] dtindex):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mus);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_months);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_seconds);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_days);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_years);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_hours);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dtindex);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minutes);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.build_field_sarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mus);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_months);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_seconds);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_days);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_years);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_hours);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dtindex);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minutes);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_years);
  __Pyx_XDECREF((PyObject *)__pyx_v_months);
  __Pyx_XDECREF((PyObject *)__pyx_v_days);
  __Pyx_XDECREF((PyObject *)__pyx_v_hours);
  __Pyx_XDECREF((PyObject *)__pyx_v_minutes);
  __Pyx_XDECREF((PyObject *)__pyx_v_seconds);
  __Pyx_XDECREF((PyObject *)__pyx_v_mus);
  __Pyx_XDECREF(__pyx_v_sa_dtype);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1121
 *     return out
 * 
 * def get_time_micros(ndarray[int64_t] dtindex):             # <<<<<<<<<<<<<<
 *     '''
 *     Datetime as int64 representation to a structured array of fields
 */

static PyObject *__pyx_pf_6pandas_3lib_50get_time_micros(PyObject *__pyx_self, PyObject *__pyx_v_dtindex); /*proto*/
static char __pyx_doc_6pandas_3lib_50get_time_micros[] = "\n    Datetime as int64 representation to a structured array of fields\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_50get_time_micros = {__Pyx_NAMESTR("get_time_micros"), (PyCFunction)__pyx_pf_6pandas_3lib_50get_time_micros, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_50get_time_micros)};
static PyObject *__pyx_pf_6pandas_3lib_50get_time_micros(PyObject *__pyx_self, PyObject *__pyx_v_dtindex) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  pandas_datetimestruct __pyx_v_dts;
  PyArrayObject *__pyx_v_micros = 0;
  Py_buffer __pyx_bstruct_dtindex;
  Py_ssize_t __pyx_bstride_0_dtindex = 0;
  Py_ssize_t __pyx_bshape_0_dtindex = 0;
  Py_buffer __pyx_bstruct_micros;
  Py_ssize_t __pyx_bstride_0_micros = 0;
  Py_ssize_t __pyx_bshape_0_micros = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_time_micros");
  __pyx_self = __pyx_self;
  __pyx_bstruct_micros.buf = NULL;
  __pyx_bstruct_dtindex.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_dtindex, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_dtindex = __pyx_bstruct_dtindex.strides[0];
  __pyx_bshape_0_dtindex = __pyx_bstruct_dtindex.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1126
 *     '''
 *     cdef:
 *         Py_ssize_t i, n = len(dtindex)             # <<<<<<<<<<<<<<
 *         pandas_datetimestruct dts
 *         ndarray[int64_t] micros
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_dtindex); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1130
 *         ndarray[int64_t] micros
 * 
 *     micros = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_micros);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_micros, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_micros, (PyObject*)__pyx_v_micros, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_micros = __pyx_bstruct_micros.strides[0];
    __pyx_bshape_0_micros = __pyx_bstruct_micros.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_micros = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1132
 *     micros = np.empty(n, dtype=np.int64)
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *         micros[i] = 1000000LL * (dts.hour * 60 * 60 +
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1133
 * 
 *     for i in range(n):
 *         pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *         micros[i] = 1000000LL * (dts.hour * 60 * 60 +
 *                                  60 * dts.min + dts.sec) + dts.us
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_dtindex;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_dtindex)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_13, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1134
 *     for i in range(n):
 *         pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *         micros[i] = 1000000LL * (dts.hour * 60 * 60 +             # <<<<<<<<<<<<<<
 *                                  60 * dts.min + dts.sec) + dts.us
 * 
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_micros;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_micros)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_micros.buf, __pyx_t_14, __pyx_bstride_0_micros) = ((1000000LL * ((((__pyx_v_dts.hour * 60) * 60) + (60 * __pyx_v_dts.min)) + __pyx_v_dts.sec)) + __pyx_v_dts.us);
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1137
 *                                  60 * dts.min + dts.sec) + dts.us
 * 
 *     return micros             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_micros));
  __pyx_r = ((PyObject *)__pyx_v_micros);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dtindex);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_micros);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.get_time_micros", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dtindex);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_micros);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_micros);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1140
 * 
 * @cython.wraparound(False)
 * def get_date_field(ndarray[int64_t] dtindex, object field):             # <<<<<<<<<<<<<<
 *     '''
 *     Given a int64-based datetime index, extract the year, month, etc.,
 */

static PyObject *__pyx_pf_6pandas_3lib_51get_date_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_51get_date_field[] = "\n    Given a int64-based datetime index, extract the year, month, etc.,\n    field and return an array of these values.\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_51get_date_field = {__Pyx_NAMESTR("get_date_field"), (PyCFunction)__pyx_pf_6pandas_3lib_51get_date_field, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_51get_date_field)};
static PyObject *__pyx_pf_6pandas_3lib_51get_date_field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_dtindex = 0;
  PyObject *__pyx_v_field = 0;
  struct __pyx_obj_6pandas_3lib__TSObject *__pyx_v_ts = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_count;
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v__month_offset = 0;
  int __pyx_v_isleap;
  pandas_datetimestruct __pyx_v_dts;
  Py_buffer __pyx_bstruct__month_offset;
  Py_ssize_t __pyx_bstride_0__month_offset = 0;
  Py_ssize_t __pyx_bstride_1__month_offset = 0;
  Py_ssize_t __pyx_bshape_0__month_offset = 0;
  Py_ssize_t __pyx_bshape_1__month_offset = 0;
  Py_buffer __pyx_bstruct_dtindex;
  Py_ssize_t __pyx_bstride_0_dtindex = 0;
  Py_ssize_t __pyx_bshape_0_dtindex = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyArrayObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  long __pyx_t_50;
  int __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  Py_ssize_t __pyx_t_53;
  Py_ssize_t __pyx_t_54;
  Py_ssize_t __pyx_t_55;
  Py_ssize_t __pyx_t_56;
  Py_ssize_t __pyx_t_57;
  Py_ssize_t __pyx_t_58;
  Py_ssize_t __pyx_t_59;
  long __pyx_t_60;
  int __pyx_t_61;
  Py_ssize_t __pyx_t_62;
  Py_ssize_t __pyx_t_63;
  Py_ssize_t __pyx_t_64;
  Py_ssize_t __pyx_t_65;
  Py_ssize_t __pyx_t_66;
  Py_ssize_t __pyx_t_67;
  Py_ssize_t __pyx_t_68;
  Py_ssize_t __pyx_t_69;
  Py_ssize_t __pyx_t_70;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dtindex,&__pyx_n_s__field,0};
  __Pyx_RefNannySetupContext("get_date_field");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dtindex);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__field);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_date_field", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_date_field") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_dtindex = ((PyArrayObject *)values[0]);
    __pyx_v_field = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_date_field", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.get_date_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct__month_offset.buf = NULL;
  __pyx_bstruct_dtindex.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtindex), __pyx_ptype_5numpy_ndarray, 1, "dtindex", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_dtindex, (PyObject*)__pyx_v_dtindex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_dtindex = __pyx_bstruct_dtindex.strides[0];
  __pyx_bshape_0_dtindex = __pyx_bstruct_dtindex.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1147
 *     cdef:
 *         _TSObject ts
 *         Py_ssize_t i, count = 0             # <<<<<<<<<<<<<<
 *         ndarray[int32_t] out
 *         ndarray[int32_t, ndim=2] _month_offset
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1153
 *         pandas_datetimestruct dts
 * 
 *     _month_offset = np.array(             # <<<<<<<<<<<<<<
 *         [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ],
 *          [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]],
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1154
 * 
 *     _month_offset = np.array(
 *         [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ],             # <<<<<<<<<<<<<<
 *          [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]],
 *          dtype=np.int32 )
 */
  __pyx_t_1 = PyList_New(13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_int_31);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_31);
  __Pyx_GIVEREF(__pyx_int_31);
  __Pyx_INCREF(__pyx_int_59);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_59);
  __Pyx_GIVEREF(__pyx_int_59);
  __Pyx_INCREF(__pyx_int_90);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_90);
  __Pyx_GIVEREF(__pyx_int_90);
  __Pyx_INCREF(__pyx_int_120);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_120);
  __Pyx_GIVEREF(__pyx_int_120);
  __Pyx_INCREF(__pyx_int_151);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_151);
  __Pyx_GIVEREF(__pyx_int_151);
  __Pyx_INCREF(__pyx_int_181);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_int_181);
  __Pyx_GIVEREF(__pyx_int_181);
  __Pyx_INCREF(__pyx_int_212);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_int_212);
  __Pyx_GIVEREF(__pyx_int_212);
  __Pyx_INCREF(__pyx_int_243);
  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_int_243);
  __Pyx_GIVEREF(__pyx_int_243);
  __Pyx_INCREF(__pyx_int_273);
  PyList_SET_ITEM(__pyx_t_1, 9, __pyx_int_273);
  __Pyx_GIVEREF(__pyx_int_273);
  __Pyx_INCREF(__pyx_int_304);
  PyList_SET_ITEM(__pyx_t_1, 10, __pyx_int_304);
  __Pyx_GIVEREF(__pyx_int_304);
  __Pyx_INCREF(__pyx_int_334);
  PyList_SET_ITEM(__pyx_t_1, 11, __pyx_int_334);
  __Pyx_GIVEREF(__pyx_int_334);
  __Pyx_INCREF(__pyx_int_365);
  PyList_SET_ITEM(__pyx_t_1, 12, __pyx_int_365);
  __Pyx_GIVEREF(__pyx_int_365);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1155
 *     _month_offset = np.array(
 *         [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ],
 *          [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]],             # <<<<<<<<<<<<<<
 *          dtype=np.int32 )
 * 
 */
  __pyx_t_3 = PyList_New(13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_int_31);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_31);
  __Pyx_GIVEREF(__pyx_int_31);
  __Pyx_INCREF(__pyx_int_60);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_60);
  __Pyx_GIVEREF(__pyx_int_60);
  __Pyx_INCREF(__pyx_int_91);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_int_91);
  __Pyx_GIVEREF(__pyx_int_91);
  __Pyx_INCREF(__pyx_int_121);
  PyList_SET_ITEM(__pyx_t_3, 4, __pyx_int_121);
  __Pyx_GIVEREF(__pyx_int_121);
  __Pyx_INCREF(__pyx_int_152);
  PyList_SET_ITEM(__pyx_t_3, 5, __pyx_int_152);
  __Pyx_GIVEREF(__pyx_int_152);
  __Pyx_INCREF(__pyx_int_182);
  PyList_SET_ITEM(__pyx_t_3, 6, __pyx_int_182);
  __Pyx_GIVEREF(__pyx_int_182);
  __Pyx_INCREF(__pyx_int_213);
  PyList_SET_ITEM(__pyx_t_3, 7, __pyx_int_213);
  __Pyx_GIVEREF(__pyx_int_213);
  __Pyx_INCREF(__pyx_int_244);
  PyList_SET_ITEM(__pyx_t_3, 8, __pyx_int_244);
  __Pyx_GIVEREF(__pyx_int_244);
  __Pyx_INCREF(__pyx_int_274);
  PyList_SET_ITEM(__pyx_t_3, 9, __pyx_int_274);
  __Pyx_GIVEREF(__pyx_int_274);
  __Pyx_INCREF(__pyx_int_305);
  PyList_SET_ITEM(__pyx_t_3, 10, __pyx_int_305);
  __Pyx_GIVEREF(__pyx_int_305);
  __Pyx_INCREF(__pyx_int_335);
  PyList_SET_ITEM(__pyx_t_3, 11, __pyx_int_335);
  __Pyx_GIVEREF(__pyx_int_335);
  __Pyx_INCREF(__pyx_int_366);
  PyList_SET_ITEM(__pyx_t_3, 12, __pyx_int_366);
  __Pyx_GIVEREF(__pyx_int_366);
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  PyList_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1153
 *         pandas_datetimestruct dts
 * 
 *     _month_offset = np.array(             # <<<<<<<<<<<<<<
 *         [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ],
 *          [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]],
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1156
 *         [[ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 ],
 *          [ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 ]],
 *          dtype=np.int32 )             # <<<<<<<<<<<<<<
 * 
 *     count = len(dtindex)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct__month_offset);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct__month_offset, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct__month_offset, (PyObject*)__pyx_v__month_offset, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0__month_offset = __pyx_bstruct__month_offset.strides[0]; __pyx_bstride_1__month_offset = __pyx_bstruct__month_offset.strides[1];
    __pyx_bshape_0__month_offset = __pyx_bstruct__month_offset.shape[0]; __pyx_bshape_1__month_offset = __pyx_bstruct__month_offset.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v__month_offset = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1158
 *          dtype=np.int32 )
 * 
 *     count = len(dtindex)             # <<<<<<<<<<<<<<
 *     out = np.empty(count, dtype='i4')
 * 
 */
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_dtindex)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_count = __pyx_t_11;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1159
 * 
 *     count = len(dtindex)
 *     out = np.empty(count, dtype='i4')             # <<<<<<<<<<<<<<
 * 
 *     if field == 'Y':
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__i4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_out = __pyx_bstruct_out.strides[0];
    __pyx_bshape_0_out = __pyx_bstruct_out.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1161
 *     out = np.empty(count, dtype='i4')
 * 
 *     if field == 'Y':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__Y), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1162
 * 
 *     if field == 'Y':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1163
 *     if field == 'Y':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_15, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_16, __pyx_bstride_0_out) = -1;
        goto __pyx_L7_continue;
        goto __pyx_L9;
      }
      __pyx_L9:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1165
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.year
 *         return out
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_17, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1166
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.year             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_18, __pyx_bstride_0_out) = __pyx_v_dts.year;
      __pyx_L7_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1167
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.year
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 'M':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1169
 *         return out
 * 
 *     elif field == 'M':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__M), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1170
 * 
 *     elif field == 'M':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1171
 *     elif field == 'M':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_19, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_20 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_20 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_20, __pyx_bstride_0_out) = -1;
        goto __pyx_L10_continue;
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1173
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.month
 *         return out
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_21, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1174
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.month             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_22, __pyx_bstride_0_out) = __pyx_v_dts.month;
      __pyx_L10_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1175
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.month
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 'D':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1177
 *         return out
 * 
 *     elif field == 'D':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__D), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1178
 * 
 *     elif field == 'D':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1179
 *     elif field == 'D':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_23, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_24 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_24, __pyx_bstride_0_out) = -1;
        goto __pyx_L13_continue;
        goto __pyx_L15;
      }
      __pyx_L15:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1181
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.day
 *         return out
 */
      __pyx_t_25 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_25, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1182
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.day             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_26, __pyx_bstride_0_out) = __pyx_v_dts.day;
      __pyx_L13_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1183
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.day
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 'h':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1185
 *         return out
 * 
 *     elif field == 'h':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__h), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1186
 * 
 *     elif field == 'h':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1187
 *     elif field == 'h':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_27, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_28 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_28, __pyx_bstride_0_out) = -1;
        goto __pyx_L16_continue;
        goto __pyx_L18;
      }
      __pyx_L18:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1189
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.hour
 *         return out
 */
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_29 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_29, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1190
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.hour             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_30 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_30 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_30 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_30, __pyx_bstride_0_out) = __pyx_v_dts.hour;
      __pyx_L16_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1191
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.hour
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 'm':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1193
 *         return out
 * 
 *     elif field == 'm':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__m), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1194
 * 
 *     elif field == 'm':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1195
 *     elif field == 'm':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_31 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_31 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_31, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_32, __pyx_bstride_0_out) = -1;
        goto __pyx_L19_continue;
        goto __pyx_L21;
      }
      __pyx_L21:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1197
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.min
 *         return out
 */
      __pyx_t_33 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_33 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_33 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_33, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1198
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.min             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_34 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_34 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_34 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_34, __pyx_bstride_0_out) = __pyx_v_dts.min;
      __pyx_L19_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1199
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.min
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 's':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1201
 *         return out
 * 
 *     elif field == 's':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__s), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1202
 * 
 *     elif field == 's':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1203
 *     elif field == 's':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_35 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_35 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_35 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_35, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_36 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_36 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_36 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_36, __pyx_bstride_0_out) = -1;
        goto __pyx_L22_continue;
        goto __pyx_L24;
      }
      __pyx_L24:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1205
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.sec
 *         return out
 */
      __pyx_t_37 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_37 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_37 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_37, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1206
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.sec             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_38 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_38 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_38 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_38, __pyx_bstride_0_out) = __pyx_v_dts.sec;
      __pyx_L22_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1207
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.sec
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 'us':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1209
 *         return out
 * 
 *     elif field == 'us':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__us), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1210
 * 
 *     elif field == 'us':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1211
 *     elif field == 'us':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_39 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_39 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_39 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_39, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_40 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_40 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_40, __pyx_bstride_0_out) = -1;
        goto __pyx_L25_continue;
        goto __pyx_L27;
      }
      __pyx_L27:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1213
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.us
 *         return out
 */
      __pyx_t_41 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_41 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_41 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_41, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1214
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.us             # <<<<<<<<<<<<<<
 *         return out
 *     elif field == 'ns':
 */
      __pyx_t_42 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_42 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_42 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_42, __pyx_bstride_0_out) = __pyx_v_dts.us;
      __pyx_L25_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1215
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.us
 *         return out             # <<<<<<<<<<<<<<
 *     elif field == 'ns':
 *         for i in range(count):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1216
 *             out[i] = dts.us
 *         return out
 *     elif field == 'ns':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__ns), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1217
 *         return out
 *     elif field == 'ns':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1218
 *     elif field == 'ns':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_43 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_43 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_43 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_43, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_44 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_44 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_44 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_44, __pyx_bstride_0_out) = -1;
        goto __pyx_L28_continue;
        goto __pyx_L30;
      }
      __pyx_L30:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1220
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.ps / 1000
 *         return out
 */
      __pyx_t_45 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_45 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_45 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_45, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1221
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.ps / 1000             # <<<<<<<<<<<<<<
 *         return out
 *     elif field == 'doy':
 */
      __pyx_t_46 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_46 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_46 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_46, __pyx_bstride_0_out) = __Pyx_div_long(__pyx_v_dts.ps, 1000);
      __pyx_L28_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1222
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.ps / 1000
 *         return out             # <<<<<<<<<<<<<<
 *     elif field == 'doy':
 *         for i in range(count):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1223
 *             out[i] = dts.ps / 1000
 *         return out
 *     elif field == 'doy':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__doy), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1224
 *         return out
 *     elif field == 'doy':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1225
 *     elif field == 'doy':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_47 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_47 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_47 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_47, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_48 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_48 < 0) {
          __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_48 >= __pyx_bshape_0_out)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_48, __pyx_bstride_0_out) = -1;
        goto __pyx_L31_continue;
        goto __pyx_L33;
      }
      __pyx_L33:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1227
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             isleap = is_leapyear(dts.year)
 *             out[i] = _month_offset[isleap, dts.month-1] + dts.day
 */
      __pyx_t_49 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_49 < 0) {
        __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_49 >= __pyx_bshape_0_dtindex)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_49, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1228
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             isleap = is_leapyear(dts.year)             # <<<<<<<<<<<<<<
 *             out[i] = _month_offset[isleap, dts.month-1] + dts.day
 *         return out
 */
      __pyx_v_isleap = is_leapyear(__pyx_v_dts.year);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1229
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             isleap = is_leapyear(dts.year)
 *             out[i] = _month_offset[isleap, dts.month-1] + dts.day             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_7 = __pyx_v_isleap;
      __pyx_t_50 = (__pyx_v_dts.month - 1);
      __pyx_t_51 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_51 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0__month_offset)) __pyx_t_51 = 0;
      if (__pyx_t_50 < 0) {
        __pyx_t_51 = 1;
      } else if (unlikely(__pyx_t_50 >= __pyx_bshape_1__month_offset)) __pyx_t_51 = 1;
      if (unlikely(__pyx_t_51 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_51);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_52 = __pyx_v_i;
      __pyx_t_51 = -1;
      if (__pyx_t_52 < 0) {
        __pyx_t_51 = 0;
      } else if (unlikely(__pyx_t_52 >= __pyx_bshape_0_out)) __pyx_t_51 = 0;
      if (unlikely(__pyx_t_51 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_51);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_52, __pyx_bstride_0_out) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_bstruct__month_offset.buf, __pyx_t_7, __pyx_bstride_0__month_offset, __pyx_t_50, __pyx_bstride_1__month_offset)) + __pyx_v_dts.day);
      __pyx_L31_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1230
 *             isleap = is_leapyear(dts.year)
 *             out[i] = _month_offset[isleap, dts.month-1] + dts.day
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 'dow':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1232
 *         return out
 * 
 *     elif field == 'dow':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__dow), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1233
 * 
 *     elif field == 'dow':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1234
 *     elif field == 'dow':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             ts = convert_to_tsobject(dtindex[i])
 */
      __pyx_t_53 = __pyx_v_i;
      __pyx_t_51 = -1;
      if (__pyx_t_53 < 0) {
        __pyx_t_51 = 0;
      } else if (unlikely(__pyx_t_53 >= __pyx_bshape_0_dtindex)) __pyx_t_51 = 0;
      if (unlikely(__pyx_t_51 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_51);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_53, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_54 = __pyx_v_i;
        __pyx_t_51 = -1;
        if (__pyx_t_54 < 0) {
          __pyx_t_51 = 0;
        } else if (unlikely(__pyx_t_54 >= __pyx_bshape_0_out)) __pyx_t_51 = 0;
        if (unlikely(__pyx_t_51 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_51);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_54, __pyx_bstride_0_out) = -1;
        goto __pyx_L34_continue;
        goto __pyx_L36;
      }
      __pyx_L36:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1236
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             ts = convert_to_tsobject(dtindex[i])             # <<<<<<<<<<<<<<
 *             out[i] = ts_dayofweek(ts)
 *         return out
 */
      __pyx_t_55 = __pyx_v_i;
      __pyx_t_51 = -1;
      if (__pyx_t_55 < 0) {
        __pyx_t_51 = 0;
      } else if (unlikely(__pyx_t_55 >= __pyx_bshape_0_dtindex)) __pyx_t_51 = 0;
      if (unlikely(__pyx_t_51 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_51);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_55, __pyx_bstride_0_dtindex))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_t_2, 0, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_6pandas_3lib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_ts));
      __pyx_v_ts = ((struct __pyx_obj_6pandas_3lib__TSObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1237
 * 
 *             ts = convert_to_tsobject(dtindex[i])
 *             out[i] = ts_dayofweek(ts)             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_56 = __pyx_v_i;
      __pyx_t_51 = -1;
      if (__pyx_t_56 < 0) {
        __pyx_t_51 = 0;
      } else if (unlikely(__pyx_t_56 >= __pyx_bshape_0_out)) __pyx_t_51 = 0;
      if (unlikely(__pyx_t_51 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_51);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_56, __pyx_bstride_0_out) = __pyx_f_6pandas_3lib_ts_dayofweek(__pyx_v_ts);
      __pyx_L34_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1238
 *             ts = convert_to_tsobject(dtindex[i])
 *             out[i] = ts_dayofweek(ts)
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 'woy':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1240
 *         return out
 * 
 *     elif field == 'woy':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__woy), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1241
 * 
 *     elif field == 'woy':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1242
 *     elif field == 'woy':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_57 = __pyx_v_i;
      __pyx_t_51 = -1;
      if (__pyx_t_57 < 0) {
        __pyx_t_51 = 0;
      } else if (unlikely(__pyx_t_57 >= __pyx_bshape_0_dtindex)) __pyx_t_51 = 0;
      if (unlikely(__pyx_t_51 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_51);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_57, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_58 = __pyx_v_i;
        __pyx_t_51 = -1;
        if (__pyx_t_58 < 0) {
          __pyx_t_51 = 0;
        } else if (unlikely(__pyx_t_58 >= __pyx_bshape_0_out)) __pyx_t_51 = 0;
        if (unlikely(__pyx_t_51 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_51);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_58, __pyx_bstride_0_out) = -1;
        goto __pyx_L37_continue;
        goto __pyx_L39;
      }
      __pyx_L39:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1244
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             isleap = is_leapyear(dts.year)
 *             out[i] = _month_offset[isleap, dts.month - 1] + dts.day
 */
      __pyx_t_59 = __pyx_v_i;
      __pyx_t_51 = -1;
      if (__pyx_t_59 < 0) {
        __pyx_t_51 = 0;
      } else if (unlikely(__pyx_t_59 >= __pyx_bshape_0_dtindex)) __pyx_t_51 = 0;
      if (unlikely(__pyx_t_51 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_51);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_59, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1245
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             isleap = is_leapyear(dts.year)             # <<<<<<<<<<<<<<
 *             out[i] = _month_offset[isleap, dts.month - 1] + dts.day
 *             out[i] = ((out[i] - 1) / 7) + 1
 */
      __pyx_v_isleap = is_leapyear(__pyx_v_dts.year);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1246
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             isleap = is_leapyear(dts.year)
 *             out[i] = _month_offset[isleap, dts.month - 1] + dts.day             # <<<<<<<<<<<<<<
 *             out[i] = ((out[i] - 1) / 7) + 1
 *         return out
 */
      __pyx_t_51 = __pyx_v_isleap;
      __pyx_t_60 = (__pyx_v_dts.month - 1);
      __pyx_t_61 = -1;
      if (__pyx_t_51 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_51 >= __pyx_bshape_0__month_offset)) __pyx_t_61 = 0;
      if (__pyx_t_60 < 0) {
        __pyx_t_61 = 1;
      } else if (unlikely(__pyx_t_60 >= __pyx_bshape_1__month_offset)) __pyx_t_61 = 1;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_62 = __pyx_v_i;
      __pyx_t_61 = -1;
      if (__pyx_t_62 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_62 >= __pyx_bshape_0_out)) __pyx_t_61 = 0;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_62, __pyx_bstride_0_out) = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_bstruct__month_offset.buf, __pyx_t_51, __pyx_bstride_0__month_offset, __pyx_t_60, __pyx_bstride_1__month_offset)) + __pyx_v_dts.day);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1247
 *             isleap = is_leapyear(dts.year)
 *             out[i] = _month_offset[isleap, dts.month - 1] + dts.day
 *             out[i] = ((out[i] - 1) / 7) + 1             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_63 = __pyx_v_i;
      __pyx_t_61 = -1;
      if (__pyx_t_63 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_63 >= __pyx_bshape_0_out)) __pyx_t_61 = 0;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_64 = __pyx_v_i;
      __pyx_t_61 = -1;
      if (__pyx_t_64 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_64 >= __pyx_bshape_0_out)) __pyx_t_61 = 0;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_64, __pyx_bstride_0_out) = (__Pyx_div_long(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_63, __pyx_bstride_0_out)) - 1), 7) + 1);
      __pyx_L37_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1248
 *             out[i] = _month_offset[isleap, dts.month - 1] + dts.day
 *             out[i] = ((out[i] - 1) / 7) + 1
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     elif field == 'q':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1250
 *         return out
 * 
 *     elif field == 'q':             # <<<<<<<<<<<<<<
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 */
  __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_field, ((PyObject *)__pyx_n_s__q), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1251
 * 
 *     elif field == 'q':
 *         for i in range(count):             # <<<<<<<<<<<<<<
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 */
    __pyx_t_11 = __pyx_v_count;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_11; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1252
 *     elif field == 'q':
 *         for i in range(count):
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue             # <<<<<<<<<<<<<<
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 */
      __pyx_t_65 = __pyx_v_i;
      __pyx_t_61 = -1;
      if (__pyx_t_65 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_65 >= __pyx_bshape_0_dtindex)) __pyx_t_61 = 0;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_65, __pyx_bstride_0_dtindex)) == __pyx_v_6pandas_3lib_NPY_NAT);
      if (__pyx_t_13) {
        __pyx_t_66 = __pyx_v_i;
        __pyx_t_61 = -1;
        if (__pyx_t_66 < 0) {
          __pyx_t_61 = 0;
        } else if (unlikely(__pyx_t_66 >= __pyx_bshape_0_out)) __pyx_t_61 = 0;
        if (unlikely(__pyx_t_61 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_61);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_66, __pyx_bstride_0_out) = -1;
        goto __pyx_L40_continue;
        goto __pyx_L42;
      }
      __pyx_L42:;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1254
 *             if dtindex[i] == NPY_NAT: out[i] = -1; continue
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *             out[i] = dts.month
 *             out[i] = ((out[i] - 1) / 3) + 1
 */
      __pyx_t_67 = __pyx_v_i;
      __pyx_t_61 = -1;
      if (__pyx_t_67 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_67 >= __pyx_bshape_0_dtindex)) __pyx_t_61 = 0;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_dtindex.buf, __pyx_t_67, __pyx_bstride_0_dtindex)), PANDAS_FR_ns, (&__pyx_v_dts));

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1255
 * 
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.month             # <<<<<<<<<<<<<<
 *             out[i] = ((out[i] - 1) / 3) + 1
 *         return out
 */
      __pyx_t_68 = __pyx_v_i;
      __pyx_t_61 = -1;
      if (__pyx_t_68 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_68 >= __pyx_bshape_0_out)) __pyx_t_61 = 0;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_68, __pyx_bstride_0_out) = __pyx_v_dts.month;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1256
 *             pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, &dts)
 *             out[i] = dts.month
 *             out[i] = ((out[i] - 1) / 3) + 1             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
      __pyx_t_69 = __pyx_v_i;
      __pyx_t_61 = -1;
      if (__pyx_t_69 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_69 >= __pyx_bshape_0_out)) __pyx_t_61 = 0;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_70 = __pyx_v_i;
      __pyx_t_61 = -1;
      if (__pyx_t_70 < 0) {
        __pyx_t_61 = 0;
      } else if (unlikely(__pyx_t_70 >= __pyx_bshape_0_out)) __pyx_t_61 = 0;
      if (unlikely(__pyx_t_61 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_61);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_70, __pyx_bstride_0_out) = (__Pyx_div_long(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_out.buf, __pyx_t_69, __pyx_bstride_0_out)) - 1), 3) + 1);
      __pyx_L40_continue:;
    }

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1257
 *             out[i] = dts.month
 *             out[i] = ((out[i] - 1) / 3) + 1
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     raise ValueError("Field %s not supported" % field)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_out));
    __pyx_r = ((PyObject *)__pyx_v_out);
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1259
 *         return out
 * 
 *     raise ValueError("Field %s not supported" % field)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_74), __pyx_v_field); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct__month_offset);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dtindex);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.get_date_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct__month_offset);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dtindex);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ts);
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XDECREF((PyObject *)__pyx_v__month_offset);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1262
 * 
 * 
 * cdef inline int m8_weekday(int64_t val):             # <<<<<<<<<<<<<<
 *     ts = convert_to_tsobject(val)
 *     return ts_dayofweek(ts)
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_m8_weekday(__pyx_t_5numpy_int64_t __pyx_v_val) {
  PyObject *__pyx_v_ts = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("m8_weekday");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1263
 * 
 * cdef inline int m8_weekday(int64_t val):
 *     ts = convert_to_tsobject(val)             # <<<<<<<<<<<<<<
 *     return ts_dayofweek(ts)
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ts = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1264
 * cdef inline int m8_weekday(int64_t val):
 *     ts = convert_to_tsobject(val)
 *     return ts_dayofweek(ts)             # <<<<<<<<<<<<<<
 * 
 * cdef int64_t DAY_NS = 86400000000000LL
 */
  if (!(likely(((__pyx_v_ts) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ts, __pyx_ptype_6pandas_3lib__TSObject))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __pyx_v_ts;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_r = __pyx_f_6pandas_3lib_ts_dayofweek(((struct __pyx_obj_6pandas_3lib__TSObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pandas.lib.m8_weekday", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ts);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1269
 * 
 * 
 * def date_normalize(ndarray[int64_t] stamps):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(stamps)
 */

static PyObject *__pyx_pf_6pandas_3lib_52date_normalize(PyObject *__pyx_self, PyObject *__pyx_v_stamps); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_52date_normalize = {__Pyx_NAMESTR("date_normalize"), (PyCFunction)__pyx_pf_6pandas_3lib_52date_normalize, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_52date_normalize(PyObject *__pyx_self, PyObject *__pyx_v_stamps) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  pandas_datetimestruct __pyx_v_dts;
  Py_buffer __pyx_bstruct_stamps;
  Py_ssize_t __pyx_bstride_0_stamps = 0;
  Py_ssize_t __pyx_bshape_0_stamps = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_normalize");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_stamps.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_stamps, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_stamps = __pyx_bstruct_stamps.strides[0];
  __pyx_bshape_0_stamps = __pyx_bstruct_stamps.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1271
 * def date_normalize(ndarray[int64_t] stamps):
 *     cdef:
 *         Py_ssize_t i, n = len(stamps)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] result = np.empty(n, dtype=np.int64)
 *         pandas_datetimestruct dts
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_stamps); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1272
 *     cdef:
 *         Py_ssize_t i, n = len(stamps)
 *         ndarray[int64_t] result = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         pandas_datetimestruct dts
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_result.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
      __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1275
 *         pandas_datetimestruct dts
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts)
 *         dts.hour = 0
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1276
 * 
 *     for i in range(n):
 *         pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *         dts.hour = 0
 *         dts.min = 0
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_stamps;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_stamps)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_stamps.buf, __pyx_t_9, __pyx_bstride_0_stamps)), PANDAS_FR_ns, (&__pyx_v_dts));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1277
 *     for i in range(n):
 *         pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts)
 *         dts.hour = 0             # <<<<<<<<<<<<<<
 *         dts.min = 0
 *         dts.sec = 0
 */
    __pyx_v_dts.hour = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1278
 *         pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts)
 *         dts.hour = 0
 *         dts.min = 0             # <<<<<<<<<<<<<<
 *         dts.sec = 0
 *         dts.us = 0
 */
    __pyx_v_dts.min = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1279
 *         dts.hour = 0
 *         dts.min = 0
 *         dts.sec = 0             # <<<<<<<<<<<<<<
 *         dts.us = 0
 *         result[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 */
    __pyx_v_dts.sec = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1280
 *         dts.min = 0
 *         dts.sec = 0
 *         dts.us = 0             # <<<<<<<<<<<<<<
 *         result[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 * 
 */
    __pyx_v_dts.us = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1281
 *         dts.sec = 0
 *         dts.us = 0
 *         result[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_11, __pyx_bstride_0_result) = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, (&__pyx_v_dts));
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1283
 *         result[i] = pandas_datetimestruct_to_datetime(PANDAS_FR_ns, &dts)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def dates_normalized(ndarray[int64_t] stamps):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_stamps);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.date_normalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_stamps);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1285
 *     return result
 * 
 * def dates_normalized(ndarray[int64_t] stamps):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(stamps)
 */

static PyObject *__pyx_pf_6pandas_3lib_53dates_normalized(PyObject *__pyx_self, PyObject *__pyx_v_stamps); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_53dates_normalized = {__Pyx_NAMESTR("dates_normalized"), (PyCFunction)__pyx_pf_6pandas_3lib_53dates_normalized, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_53dates_normalized(PyObject *__pyx_self, PyObject *__pyx_v_stamps) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  pandas_datetimestruct __pyx_v_dts;
  Py_buffer __pyx_bstruct_stamps;
  Py_ssize_t __pyx_bstride_0_stamps = 0;
  Py_ssize_t __pyx_bshape_0_stamps = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dates_normalized");
  __pyx_self = __pyx_self;
  __pyx_bstruct_stamps.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stamps), __pyx_ptype_5numpy_ndarray, 1, "stamps", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_stamps, (PyObject*)__pyx_v_stamps, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_stamps = __pyx_bstruct_stamps.strides[0];
  __pyx_bshape_0_stamps = __pyx_bstruct_stamps.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1287
 * def dates_normalized(ndarray[int64_t] stamps):
 *     cdef:
 *         Py_ssize_t i, n = len(stamps)             # <<<<<<<<<<<<<<
 *         pandas_datetimestruct dts
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_stamps); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1290
 *         pandas_datetimestruct dts
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts)
 *         if (dts.hour + dts.min + dts.sec + dts.us) > 0:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1291
 * 
 *     for i in range(n):
 *         pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts)             # <<<<<<<<<<<<<<
 *         if (dts.hour + dts.min + dts.sec + dts.us) > 0:
 *             return False
 */
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_3 < 0) {
      __pyx_t_3 += __pyx_bshape_0_stamps;
      if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_stamps)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    pandas_datetime_to_datetimestruct((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_stamps.buf, __pyx_t_3, __pyx_bstride_0_stamps)), PANDAS_FR_ns, (&__pyx_v_dts));

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1292
 *     for i in range(n):
 *         pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts)
 *         if (dts.hour + dts.min + dts.sec + dts.us) > 0:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_5 = ((((__pyx_v_dts.hour + __pyx_v_dts.min) + __pyx_v_dts.sec) + __pyx_v_dts.us) > 0);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1293
 *         pandas_datetime_to_datetimestruct(stamps[i], PANDAS_FR_ns, &dts)
 *         if (dts.hour + dts.min + dts.sec + dts.us) > 0:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     return True
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1295
 *             return False
 * 
 *     return True             # <<<<<<<<<<<<<<
 * 
 * # Some general helper functions
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_stamps);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.dates_normalized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_stamps);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1300
 * #----------------------------------------------------------------------
 * 
 * def isleapyear(int64_t year):             # <<<<<<<<<<<<<<
 *     return is_leapyear(year)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_54isleapyear(PyObject *__pyx_self, PyObject *__pyx_arg_year); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_54isleapyear = {__Pyx_NAMESTR("isleapyear"), (PyCFunction)__pyx_pf_6pandas_3lib_54isleapyear, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_54isleapyear(PyObject *__pyx_self, PyObject *__pyx_arg_year) {
  __pyx_t_5numpy_int64_t __pyx_v_year;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isleapyear");
  __pyx_self = __pyx_self;
  assert(__pyx_arg_year); {
    __pyx_v_year = __Pyx_PyInt_from_py_npy_int64(__pyx_arg_year); if (unlikely((__pyx_v_year == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.isleapyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1301
 * 
 * def isleapyear(int64_t year):
 *     return is_leapyear(year)             # <<<<<<<<<<<<<<
 * 
 * def monthrange(int64_t year, int64_t month):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(is_leapyear(__pyx_v_year)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.isleapyear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1303
 *     return is_leapyear(year)
 * 
 * def monthrange(int64_t year, int64_t month):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int64_t days
 */

static PyObject *__pyx_pf_6pandas_3lib_55monthrange(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_55monthrange = {__Pyx_NAMESTR("monthrange"), (PyCFunction)__pyx_pf_6pandas_3lib_55monthrange, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_55monthrange(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_5numpy_int64_t __pyx_v_year;
  __pyx_t_5numpy_int64_t __pyx_v_month;
  __pyx_t_5numpy_int64_t __pyx_v_days;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__year,&__pyx_n_s__month,0};
  __Pyx_RefNannySetupContext("monthrange");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__year);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__month);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("monthrange", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "monthrange") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_year = __Pyx_PyInt_from_py_npy_int64(values[0]); if (unlikely((__pyx_v_year == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_month = __Pyx_PyInt_from_py_npy_int64(values[1]); if (unlikely((__pyx_v_month == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("monthrange", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.monthrange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1308
 *         int64_t day_of_week
 * 
 *     if month < 1 or month > 12:             # <<<<<<<<<<<<<<
 *         raise ValueError("bad month number 0; must be 1-12")
 * 
 */
  __pyx_t_1 = (__pyx_v_month < 1);
  if (!__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_month > 12);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1309
 * 
 *     if month < 1 or month > 12:
 *         raise ValueError("bad month number 0; must be 1-12")             # <<<<<<<<<<<<<<
 * 
 *     days = _days_per_month_table[is_leapyear(year)][month-1]
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1311
 *         raise ValueError("bad month number 0; must be 1-12")
 * 
 *     days = _days_per_month_table[is_leapyear(year)][month-1]             # <<<<<<<<<<<<<<
 * 
 *     return (dayofweek(year, month, 1), days)
 */
  __pyx_v_days = ((_days_per_month_table[is_leapyear(__pyx_v_year)])[(__pyx_v_month - 1)]);

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1313
 *     days = _days_per_month_table[is_leapyear(year)][month-1]
 * 
 *     return (dayofweek(year, month, 1), days)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int64_t ts_dayofweek(_TSObject ts):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyInt_FromLong(dayofweek(__pyx_v_year, __pyx_v_month, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_days); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.monthrange", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1315
 *     return (dayofweek(year, month, 1), days)
 * 
 * cdef inline int64_t ts_dayofweek(_TSObject ts):             # <<<<<<<<<<<<<<
 *     return dayofweek(ts.dts.year, ts.dts.month, ts.dts.day)
 * 
 */

static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_6pandas_3lib_ts_dayofweek(struct __pyx_obj_6pandas_3lib__TSObject *__pyx_v_ts) {
  __pyx_t_5numpy_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ts_dayofweek");

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1316
 * 
 * cdef inline int64_t ts_dayofweek(_TSObject ts):
 *     return dayofweek(ts.dts.year, ts.dts.month, ts.dts.day)             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_r = dayofweek(__pyx_v_ts->dts.year, __pyx_v_ts->dts.month, __pyx_v_ts->dts.day);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":18
 * # MSVC does not have log2!
 * 
 * cdef double Log2(double x):             # <<<<<<<<<<<<<<
 *     return log(x) / log(2.)
 * 
 */

static double __pyx_f_6pandas_3lib_Log2(double __pyx_v_x) {
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  double __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Log2");

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":19
 * 
 * cdef double Log2(double x):
 *     return log(x) / log(2.)             # <<<<<<<<<<<<<<
 * 
 * cimport numpy as np
 */
  __pyx_t_1 = log(__pyx_v_x);
  __pyx_t_2 = log(2.);
  if (unlikely(__pyx_t_2 == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_r = (__pyx_t_1 / __pyx_t_2);
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pandas.lib.Log2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":38
 *         list width
 * 
 *     def __init__(self, double_t value, list next, list width):             # <<<<<<<<<<<<<<
 *         self.value = value
 *         self.next = next
 */

static int __pyx_pf_6pandas_3lib_4Node___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_4Node___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  __pyx_t_5numpy_double_t __pyx_v_value;
  PyObject *__pyx_v_next = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__value,&__pyx_n_s__next,&__pyx_n_s__width,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__width);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_value = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_value == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_next = ((PyObject*)values[1]);
    __pyx_v_width = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Node.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_next), (&PyList_Type), 1, "next", 1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), (&PyList_Type), 1, "width", 1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":39
 * 
 *     def __init__(self, double_t value, list next, list width):
 *         self.value = value             # <<<<<<<<<<<<<<
 *         self.next = next
 *         self.width = width
 */
  ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->value = __pyx_v_value;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":40
 *     def __init__(self, double_t value, list next, list width):
 *         self.value = value
 *         self.next = next             # <<<<<<<<<<<<<<
 *         self.width = width
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_next));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_next));
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next));
  ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next = __pyx_v_next;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":41
 *         self.value = value
 *         self.next = next
 *         self.width = width             # <<<<<<<<<<<<<<
 * 
 * # Singleton terminator node
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_width));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_width));
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width));
  ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width = __pyx_v_width;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Node.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":34
 * cdef class Node:
 *     cdef public:
 *         double_t value             # <<<<<<<<<<<<<<
 *         list next
 *         list width
 */

static PyObject *__pyx_pf_6pandas_3lib_4Node_5value___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_4Node_5value___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Node.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_4Node_5value_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_4Node_5value_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_5numpy_double_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->value = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Node.value.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":35
 *     cdef public:
 *         double_t value
 *         list next             # <<<<<<<<<<<<<<
 *         list width
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_4Node_4next___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_4Node_4next___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_4Node_4next_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_4Node_4next_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next));
  ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Node.next.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_4Node_4next_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_4Node_4next_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next));
  ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->next = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":36
 *         double_t value
 *         list next
 *         list width             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, double_t value, list next, list width):
 */

static PyObject *__pyx_pf_6pandas_3lib_4Node_5width___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_4Node_5width___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_4Node_5width_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_4Node_5width_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width));
  ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.Node.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_4Node_5width_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_4Node_5width_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width));
  ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_v_self)->width = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":55
 *         Node head
 * 
 *     def __init__(self, expected_size=100):             # <<<<<<<<<<<<<<
 *         self.size = 0
 *         self.maxlevels = int(1 + Log2(expected_size))
 */

static int __pyx_pf_6pandas_3lib_17IndexableSkiplist___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_17IndexableSkiplist___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_expected_size = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__expected_size,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_100);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__expected_size);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_expected_size = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":56
 * 
 *     def __init__(self, expected_size=100):
 *         self.size = 0             # <<<<<<<<<<<<<<
 *         self.maxlevels = int(1 + Log2(expected_size))
 *         self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels)
 */
  ((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->size = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":57
 *     def __init__(self, expected_size=100):
 *         self.size = 0
 *         self.maxlevels = int(1 + Log2(expected_size))             # <<<<<<<<<<<<<<
 *         self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels)
 * 
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_expected_size); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->maxlevels = ((Py_ssize_t)(1.0 + __pyx_f_6pandas_3lib_Log2(__pyx_t_1)));

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":58
 *         self.size = 0
 *         self.maxlevels = int(1 + Log2(expected_size))
 *         self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__NaN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__NIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->maxlevels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Multiply(((PyObject *)__pyx_t_4), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __pyx_t_4 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->maxlevels); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyNumber_Multiply(((PyObject *)__pyx_t_2), __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Node)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->head);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->head));
  ((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->head = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_6);
  __pyx_t_6 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":60
 *         self.head = Node(np.NaN, [NIL] * self.maxlevels, [1] * self.maxlevels)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.size
 * 
 */

static Py_ssize_t __pyx_pf_6pandas_3lib_17IndexableSkiplist_1__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6pandas_3lib_17IndexableSkiplist_1__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__");

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":61
 * 
 *     def __len__(self):
 *         return self.size             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
 */
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->size;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":63
 *         return self.size
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self.get(i)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_2__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_2__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__");

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":64
 * 
 *     def __getitem__(self, i):
 *         return self.get(i)             # <<<<<<<<<<<<<<
 * 
 *     cpdef get(self, Py_ssize_t i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->__pyx_vtab)->get(((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self), __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":66
 *         return self.get(i)
 * 
 *     cpdef get(self, Py_ssize_t i):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t level
 *         cdef Node node
 */

static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_3get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_17IndexableSkiplist_get(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *__pyx_v_self, Py_ssize_t __pyx_v_i, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_level;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_node = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_17IndexableSkiplist_3get)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":70
 *         cdef Node node
 * 
 *         node = self.head             # <<<<<<<<<<<<<<
 *         i += 1
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self->head));
  __pyx_v_node = __pyx_v_self->head;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":71
 * 
 *         node = self.head
 *         i += 1             # <<<<<<<<<<<<<<
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):
 */
  __pyx_v_i = (__pyx_v_i + 1);

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":73
 *         i += 1
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             while node.width[level] <= i:
 *                 i -= node.width[level]
 */
  for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) {
    __pyx_v_level = __pyx_t_4;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":74
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):
 *             while node.width[level] <= i:             # <<<<<<<<<<<<<<
 *                 i -= node.width[level]
 *                 node = node.next[level]
 */
    while (1) {
      __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_node->width), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_5) break;

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":75
 *         for level in range(self.maxlevels - 1, -1, -1):
 *             while node.width[level] <= i:
 *                 i -= node.width[level]             # <<<<<<<<<<<<<<
 *                 node = node.next[level]
 * 
 */
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_node->width), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_i = __pyx_t_6;

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":76
 *             while node.width[level] <= i:
 *                 i -= node.width[level]
 *                 node = node.next[level]             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_node->next), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":79
 * 
 * 
 *         return node.value             # <<<<<<<<<<<<<<
 * 
 *     cpdef insert(self, double value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_node->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":66
 *         return self.get(i)
 * 
 *     cpdef get(self, Py_ssize_t i):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t level
 *         cdef Node node
 */

static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_3get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_3get(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get");
  assert(__pyx_arg_i); {
    __pyx_v_i = __Pyx_PyIndex_AsSsize_t(__pyx_arg_i); if (unlikely((__pyx_v_i == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->__pyx_vtab)->get(((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self), __pyx_v_i, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":81
 *         return node.value
 * 
 *     cpdef insert(self, double value):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t level, steps, d
 *         cdef Node node, prevnode, newnode, next_at_level, tmp
 */

static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_4insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_17IndexableSkiplist_insert(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *__pyx_v_self, double __pyx_v_value, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_level;
  Py_ssize_t __pyx_v_steps;
  Py_ssize_t __pyx_v_d;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_node = 0;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_prevnode = 0;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_newnode = 0;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_next_at_level = 0;
  PyObject *__pyx_v_chain = 0;
  PyObject *__pyx_v_steps_at_level = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  double __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("insert");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__insert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_17IndexableSkiplist_4insert)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":87
 * 
 *         # find first node on each level where node.next[levels].value > value
 *         chain = [None] * self.maxlevels             # <<<<<<<<<<<<<<
 *         steps_at_level = [0] * self.maxlevels
 *         node = self.head
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->maxlevels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_t_1), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_chain = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":88
 *         # find first node on each level where node.next[levels].value > value
 *         chain = [None] * self.maxlevels
 *         steps_at_level = [0] * self.maxlevels             # <<<<<<<<<<<<<<
 *         node = self.head
 * 
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->maxlevels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_t_3), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_steps_at_level = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":89
 *         chain = [None] * self.maxlevels
 *         steps_at_level = [0] * self.maxlevels
 *         node = self.head             # <<<<<<<<<<<<<<
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self->head));
  __pyx_v_node = __pyx_v_self->head;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":91
 *         node = self.head
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             next_at_level = node.next[level]
 * 
 */
  for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) {
    __pyx_v_level = __pyx_t_4;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":92
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):
 *             next_at_level = node.next[level]             # <<<<<<<<<<<<<<
 * 
 *             while next_at_level.value <= value:
 */
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_node->next), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_next_at_level));
    __pyx_v_next_at_level = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":94
 *             next_at_level = node.next[level]
 * 
 *             while next_at_level.value <= value:             # <<<<<<<<<<<<<<
 *                 steps_at_level[level] = (steps_at_level[level] +
 *                                          node.width[level])
 */
    while (1) {
      __pyx_t_5 = (__pyx_v_next_at_level->value <= __pyx_v_value);
      if (!__pyx_t_5) break;

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":95
 * 
 *             while next_at_level.value <= value:
 *                 steps_at_level[level] = (steps_at_level[level] +             # <<<<<<<<<<<<<<
 *                                          node.width[level])
 *                 node = next_at_level
 */
      __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_steps_at_level), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":96
 *             while next_at_level.value <= value:
 *                 steps_at_level[level] = (steps_at_level[level] +
 *                                          node.width[level])             # <<<<<<<<<<<<<<
 *                 node = next_at_level
 *                 next_at_level = node.next[level]
 */
      __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_node->width), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":95
 * 
 *             while next_at_level.value <= value:
 *                 steps_at_level[level] = (steps_at_level[level] +             # <<<<<<<<<<<<<<
 *                                          node.width[level])
 *                 node = next_at_level
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_steps_at_level), __pyx_v_level, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":97
 *                 steps_at_level[level] = (steps_at_level[level] +
 *                                          node.width[level])
 *                 node = next_at_level             # <<<<<<<<<<<<<<
 *                 next_at_level = node.next[level]
 * 
 */
      __Pyx_INCREF(((PyObject *)__pyx_v_next_at_level));
      __Pyx_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = __pyx_v_next_at_level;

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":98
 *                                          node.width[level])
 *                 node = next_at_level
 *                 next_at_level = node.next[level]             # <<<<<<<<<<<<<<
 * 
 *             chain[level] = node
 */
      __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_node->next), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_next_at_level));
      __pyx_v_next_at_level = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_3);
      __pyx_t_3 = 0;
    }

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":100
 *                 next_at_level = node.next[level]
 * 
 *             chain[level] = node             # <<<<<<<<<<<<<<
 * 
 *         # insert a link to the newnode at each level
 */
    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_chain), __pyx_v_level, ((PyObject *)__pyx_v_node), sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":103
 * 
 *         # insert a link to the newnode at each level
 *         d = min(self.maxlevels, 1 - int(Log2(random())))             # <<<<<<<<<<<<<<
 *         newnode = Node(value, [None] * d, [None] * d)
 *         steps = 0
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__random); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_6pandas_3lib_Log2(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Subtract(__pyx_int_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_v_self->maxlevels;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_5) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
  } else {
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = __pyx_t_7;
    __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_d = __pyx_t_4;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":104
 *         # insert a link to the newnode at each level
 *         d = min(self.maxlevels, 1 - int(Log2(random())))
 *         newnode = Node(value, [None] * d, [None] * d)             # <<<<<<<<<<<<<<
 *         steps = 0
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_d); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_t_3), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_7, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = PyNumber_Multiply(((PyObject *)__pyx_t_7), __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Node)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_newnode = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":105
 *         d = min(self.maxlevels, 1 - int(Log2(random())))
 *         newnode = Node(value, [None] * d, [None] * d)
 *         steps = 0             # <<<<<<<<<<<<<<
 * 
 *         for level in range(d):
 */
  __pyx_v_steps = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":107
 *         steps = 0
 * 
 *         for level in range(d):             # <<<<<<<<<<<<<<
 *             prevnode = chain[level]
 *             newnode.next[level] = prevnode.next[level]
 */
  __pyx_t_4 = __pyx_v_d;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_4; __pyx_t_9+=1) {
    __pyx_v_level = __pyx_t_9;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":108
 * 
 *         for level in range(d):
 *             prevnode = chain[level]             # <<<<<<<<<<<<<<
 *             newnode.next[level] = prevnode.next[level]
 *             prevnode.next[level] = newnode
 */
    __pyx_t_8 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_chain), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_8) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_prevnode));
    __pyx_v_prevnode = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":109
 *         for level in range(d):
 *             prevnode = chain[level]
 *             newnode.next[level] = prevnode.next[level]             # <<<<<<<<<<<<<<
 *             prevnode.next[level] = newnode
 *             newnode.width[level] = (prevnode.width[level] - steps)
 */
    __pyx_t_8 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_prevnode->next), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_8) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_newnode->next), __pyx_v_level, __pyx_t_8, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":110
 *             prevnode = chain[level]
 *             newnode.next[level] = prevnode.next[level]
 *             prevnode.next[level] = newnode             # <<<<<<<<<<<<<<
 *             newnode.width[level] = (prevnode.width[level] - steps)
 *             prevnode.width[level] = steps + 1
 */
    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_prevnode->next), __pyx_v_level, ((PyObject *)__pyx_v_newnode), sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":111
 *             newnode.next[level] = prevnode.next[level]
 *             prevnode.next[level] = newnode
 *             newnode.width[level] = (prevnode.width[level] - steps)             # <<<<<<<<<<<<<<
 *             prevnode.width[level] = steps + 1
 *             steps += steps_at_level[level]
 */
    __pyx_t_8 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_prevnode->width), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_8) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_steps); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_newnode->width), __pyx_v_level, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":112
 *             prevnode.next[level] = newnode
 *             newnode.width[level] = (prevnode.width[level] - steps)
 *             prevnode.width[level] = steps + 1             # <<<<<<<<<<<<<<
 *             steps += steps_at_level[level]
 * 
 */
    __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_steps + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_prevnode->width), __pyx_v_level, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":113
 *             newnode.width[level] = (prevnode.width[level] - steps)
 *             prevnode.width[level] = steps + 1
 *             steps += steps_at_level[level]             # <<<<<<<<<<<<<<
 * 
 *         for level in range(d, self.maxlevels):
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_steps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_steps_at_level), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_steps = __pyx_t_10;
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":115
 *             steps += steps_at_level[level]
 * 
 *         for level in range(d, self.maxlevels):             # <<<<<<<<<<<<<<
 *             (<Node> chain[level]).width[level] += 1
 * 
 */
  __pyx_t_4 = __pyx_v_self->maxlevels;
  for (__pyx_t_9 = __pyx_v_d; __pyx_t_9 < __pyx_t_4; __pyx_t_9+=1) {
    __pyx_v_level = __pyx_t_9;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":116
 * 
 *         for level in range(d, self.maxlevels):
 *             (<Node> chain[level]).width[level] += 1             # <<<<<<<<<<<<<<
 * 
 *         self.size += 1
 */
    __pyx_t_8 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_chain), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_8) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_8)->width));
    __pyx_t_11 = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_8)->width;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_10 = __pyx_v_level;
    __pyx_t_8 = __Pyx_GetItemInt_List(((PyObject *)__pyx_t_11), __pyx_t_10, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_8) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__Pyx_SetItemInt(((PyObject *)__pyx_t_11), __pyx_t_10, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":118
 *             (<Node> chain[level]).width[level] += 1
 * 
 *         self.size += 1             # <<<<<<<<<<<<<<
 * 
 *     cpdef remove(self, double value):
 */
  __pyx_v_self->size = (__pyx_v_self->size + 1);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(((PyObject *)__pyx_t_11));
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_node);
  __Pyx_XDECREF((PyObject *)__pyx_v_prevnode);
  __Pyx_XDECREF((PyObject *)__pyx_v_newnode);
  __Pyx_XDECREF((PyObject *)__pyx_v_next_at_level);
  __Pyx_XDECREF(__pyx_v_chain);
  __Pyx_XDECREF(__pyx_v_steps_at_level);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":81
 *         return node.value
 * 
 *     cpdef insert(self, double value):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t level, steps, d
 *         cdef Node node, prevnode, newnode, next_at_level, tmp
 */

static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_4insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_4insert(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("insert");
  assert(__pyx_arg_value); {
    __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->__pyx_vtab)->insert(((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self), __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":120
 *         self.size += 1
 * 
 *     cpdef remove(self, double value):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t level, d
 *         cdef Node node, prevnode, tmpnode, next_at_level
 */

static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_5remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_17IndexableSkiplist_remove(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *__pyx_v_self, double __pyx_v_value, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_level;
  Py_ssize_t __pyx_v_d;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_node = 0;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_prevnode = 0;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_tmpnode = 0;
  struct __pyx_obj_6pandas_3lib_Node *__pyx_v_next_at_level = 0;
  PyObject *__pyx_v_chain = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__remove); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_17IndexableSkiplist_5remove)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":126
 * 
 *         # find first node on each level where node.next[levels].value >= value
 *         chain = [None] * self.maxlevels             # <<<<<<<<<<<<<<
 *         node = self.head
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->maxlevels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_t_1), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_chain = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":127
 *         # find first node on each level where node.next[levels].value >= value
 *         chain = [None] * self.maxlevels
 *         node = self.head             # <<<<<<<<<<<<<<
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self->head));
  __pyx_v_node = __pyx_v_self->head;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":129
 *         node = self.head
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             next_at_level = node.next[level]
 *             while next_at_level.value < value:
 */
  for (__pyx_t_4 = (__pyx_v_self->maxlevels - 1); __pyx_t_4 > -1; __pyx_t_4-=1) {
    __pyx_v_level = __pyx_t_4;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":130
 * 
 *         for level in range(self.maxlevels - 1, -1, -1):
 *             next_at_level = node.next[level]             # <<<<<<<<<<<<<<
 *             while next_at_level.value < value:
 *                 node = next_at_level
 */
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_node->next), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_next_at_level));
    __pyx_v_next_at_level = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":131
 *         for level in range(self.maxlevels - 1, -1, -1):
 *             next_at_level = node.next[level]
 *             while next_at_level.value < value:             # <<<<<<<<<<<<<<
 *                 node = next_at_level
 *                 next_at_level = node.next[level]
 */
    while (1) {
      __pyx_t_5 = (__pyx_v_next_at_level->value < __pyx_v_value);
      if (!__pyx_t_5) break;

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":132
 *             next_at_level = node.next[level]
 *             while next_at_level.value < value:
 *                 node = next_at_level             # <<<<<<<<<<<<<<
 *                 next_at_level = node.next[level]
 * 
 */
      __Pyx_INCREF(((PyObject *)__pyx_v_next_at_level));
      __Pyx_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = __pyx_v_next_at_level;

      /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":133
 *             while next_at_level.value < value:
 *                 node = next_at_level
 *                 next_at_level = node.next[level]             # <<<<<<<<<<<<<<
 * 
 *             chain[level] = node
 */
      __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_node->next), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_next_at_level));
      __pyx_v_next_at_level = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_3);
      __pyx_t_3 = 0;
    }

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":135
 *                 next_at_level = node.next[level]
 * 
 *             chain[level] = node             # <<<<<<<<<<<<<<
 * 
 *         if value != (<Node> (<Node> (<Node> chain[0]).next)[0]).value:
 */
    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_chain), __pyx_v_level, ((PyObject *)__pyx_v_node), sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":137
 *             chain[level] = node
 * 
 *         if value != (<Node> (<Node> (<Node> chain[0]).next)[0]).value:             # <<<<<<<<<<<<<<
 *             raise KeyError('Not Found')
 * 
 */
  __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_chain), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_3)->next), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (__pyx_v_value != ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_2)->value);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":138
 * 
 *         if value != (<Node> (<Node> (<Node> chain[0]).next)[0]).value:
 *             raise KeyError('Not Found')             # <<<<<<<<<<<<<<
 * 
 *         # remove one link at each level
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_k_tuple_78), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":141
 * 
 *         # remove one link at each level
 *         d = len((<Node> (<Node> (<Node> chain[0]).next)[0]).next)             # <<<<<<<<<<<<<<
 * 
 *         for level in range(d):
 */
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_chain), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_2)->next), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_3)->next);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_d = __pyx_t_4;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":143
 *         d = len((<Node> (<Node> (<Node> chain[0]).next)[0]).next)
 * 
 *         for level in range(d):             # <<<<<<<<<<<<<<
 *             prevnode = chain[level]
 *             tmpnode = prevnode.next[level]
 */
  __pyx_t_4 = __pyx_v_d;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_4; __pyx_t_6+=1) {
    __pyx_v_level = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":144
 * 
 *         for level in range(d):
 *             prevnode = chain[level]             # <<<<<<<<<<<<<<
 *             tmpnode = prevnode.next[level]
 *             prevnode.width[level] += tmpnode.width[level] - 1
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_chain), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_prevnode));
    __pyx_v_prevnode = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":145
 *         for level in range(d):
 *             prevnode = chain[level]
 *             tmpnode = prevnode.next[level]             # <<<<<<<<<<<<<<
 *             prevnode.width[level] += tmpnode.width[level] - 1
 *             prevnode.next[level] = tmpnode.next[level]
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_prevnode->next), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_tmpnode));
    __pyx_v_tmpnode = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":146
 *             prevnode = chain[level]
 *             tmpnode = prevnode.next[level]
 *             prevnode.width[level] += tmpnode.width[level] - 1             # <<<<<<<<<<<<<<
 *             prevnode.next[level] = tmpnode.next[level]
 * 
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_prevnode->width));
    __pyx_t_7 = __pyx_v_prevnode->width;
    __pyx_t_8 = __pyx_v_level;
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_t_7), __pyx_t_8, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_tmpnode->width), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__Pyx_SetItemInt(((PyObject *)__pyx_t_7), __pyx_t_8, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":147
 *             tmpnode = prevnode.next[level]
 *             prevnode.width[level] += tmpnode.width[level] - 1
 *             prevnode.next[level] = tmpnode.next[level]             # <<<<<<<<<<<<<<
 * 
 *         for level in range(d, self.maxlevels):
 */
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_tmpnode->next), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_SetItemInt(((PyObject *)__pyx_v_prevnode->next), __pyx_v_level, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":149
 *             prevnode.next[level] = tmpnode.next[level]
 * 
 *         for level in range(d, self.maxlevels):             # <<<<<<<<<<<<<<
 *             tmpnode = chain[level]
 *             tmpnode.width[level] -= 1
 */
  __pyx_t_4 = __pyx_v_self->maxlevels;
  for (__pyx_t_6 = __pyx_v_d; __pyx_t_6 < __pyx_t_4; __pyx_t_6+=1) {
    __pyx_v_level = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":150
 * 
 *         for level in range(d, self.maxlevels):
 *             tmpnode = chain[level]             # <<<<<<<<<<<<<<
 *             tmpnode.width[level] -= 1
 * 
 */
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_chain), __pyx_v_level, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_3lib_Node))))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_tmpnode));
    __pyx_v_tmpnode = ((struct __pyx_obj_6pandas_3lib_Node *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":151
 *         for level in range(d, self.maxlevels):
 *             tmpnode = chain[level]
 *             tmpnode.width[level] -= 1             # <<<<<<<<<<<<<<
 * 
 *         self.size -= 1
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_tmpnode->width));
    __pyx_t_7 = __pyx_v_tmpnode->width;
    __pyx_t_8 = __pyx_v_level;
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_t_7), __pyx_t_8, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__Pyx_SetItemInt(((PyObject *)__pyx_t_7), __pyx_t_8, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":153
 *             tmpnode.width[level] -= 1
 * 
 *         self.size -= 1             # <<<<<<<<<<<<<<
 */
  __pyx_v_self->size = (__pyx_v_self->size - 1);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_node);
  __Pyx_XDECREF((PyObject *)__pyx_v_prevnode);
  __Pyx_XDECREF((PyObject *)__pyx_v_tmpnode);
  __Pyx_XDECREF((PyObject *)__pyx_v_next_at_level);
  __Pyx_XDECREF(__pyx_v_chain);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":120
 *         self.size += 1
 * 
 *     cpdef remove(self, double value):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t level, d
 *         cdef Node node, prevnode, tmpnode, next_at_level
 */

static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_5remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_17IndexableSkiplist_5remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  double __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("remove");
  assert(__pyx_arg_value); {
    __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self)->__pyx_vtab)->remove(((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_self), __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexableSkiplist.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":5
 * 
 * @cython.boundscheck(False)
 * def arrmap(ndarray[object] index, object func):             # <<<<<<<<<<<<<<
 *     cdef int length = index.shape[0]
 *     cdef int i = 0
 */

static PyObject *__pyx_pf_6pandas_3lib_56arrmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_56arrmap = {__Pyx_NAMESTR("arrmap"), (PyCFunction)__pyx_pf_6pandas_3lib_56arrmap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_56arrmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyObject *__pyx_v_func = 0;
  int __pyx_v_length;
  int __pyx_v_i;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_index;
  Py_ssize_t __pyx_bstride_0_index = 0;
  Py_ssize_t __pyx_bshape_0_index = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject **__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__func,0};
  __Pyx_RefNannySetupContext("arrmap");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arrmap", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "arrmap") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_index = ((PyArrayObject *)values[0]);
    __pyx_v_func = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arrmap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.arrmap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_index.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_index, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_index = __pyx_bstruct_index.strides[0];
  __pyx_bshape_0_index = __pyx_bstruct_index.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":6
 * @cython.boundscheck(False)
 * def arrmap(ndarray[object] index, object func):
 *     cdef int length = index.shape[0]             # <<<<<<<<<<<<<<
 *     cdef int i = 0
 * 
 */
  __pyx_v_length = (__pyx_v_index->dimensions[0]);

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":7
 * def arrmap(ndarray[object] index, object func):
 *     cdef int length = index.shape[0]
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 */
  __pyx_v_i = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":9
 *     cdef int i = 0
 * 
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < length:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__object_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_result.buf = NULL;
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
      __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":11
 *     cdef ndarray[object] result = np.empty(length, dtype=np.object_)
 * 
 *     for i from 0 <= i < length:             # <<<<<<<<<<<<<<
 *         result[i] = func(index[i])
 * 
 */
  __pyx_t_7 = __pyx_v_length;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":12
 * 
 *     for i from 0 <= i < length:
 *         result[i] = func(index[i])             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_8 = __pyx_v_i;
    if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_bshape_0_index;
    __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_index.buf, __pyx_t_8, __pyx_bstride_0_index);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_v_func, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_9 = __pyx_v_i;
    if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_bshape_0_result;
    __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_9, __pyx_bstride_0_result);
    __Pyx_GOTREF(*__pyx_t_10);
    __Pyx_DECREF(*__pyx_t_10); __Pyx_INCREF(__pyx_t_5);
    *__pyx_t_10 = __pyx_t_5;
    __Pyx_GIVEREF(*__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":14
 *         result[i] = func(index[i])
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.arrmap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":17
 * 
 * @cython.boundscheck(False)
 * def groupby_func(object index, object mapper):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef ndarray[object] mapped_index
 */

static PyObject *__pyx_pf_6pandas_3lib_57groupby_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_57groupby_func = {__Pyx_NAMESTR("groupby_func"), (PyCFunction)__pyx_pf_6pandas_3lib_57groupby_func, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_57groupby_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_mapper = 0;
  PyObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_mapped_index = 0;
  PyArrayObject *__pyx_v_index_buf = 0;
  PyArrayObject *__pyx_v_mask = 0;
  int __pyx_v_i;
  int __pyx_v_length;
  PyObject *__pyx_v_members = 0;
  PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_v_key = 0;
  Py_buffer __pyx_bstruct_index_buf;
  Py_ssize_t __pyx_bstride_0_index_buf = 0;
  Py_ssize_t __pyx_bshape_0_index_buf = 0;
  Py_buffer __pyx_bstruct_mask;
  Py_ssize_t __pyx_bstride_0_mask = 0;
  Py_ssize_t __pyx_bshape_0_mask = 0;
  Py_buffer __pyx_bstruct_mapped_index;
  Py_ssize_t __pyx_bstride_0_mapped_index = 0;
  Py_ssize_t __pyx_bshape_0_mapped_index = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyArrayObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __pyx_t_5numpy_int8_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__mapper,0};
  __Pyx_RefNannySetupContext("groupby_func");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mapper);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby_func", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "groupby_func") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_index = values[0];
    __pyx_v_mapper = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby_func", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.groupby_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_mapped_index.buf = NULL;
  __pyx_bstruct_index_buf.buf = NULL;
  __pyx_bstruct_mask.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":18
 * @cython.boundscheck(False)
 * def groupby_func(object index, object mapper):
 *     cdef dict result = {}             # <<<<<<<<<<<<<<
 *     cdef ndarray[object] mapped_index
 *     cdef ndarray[object] index_buf
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":26
 *     cdef object idx, key
 * 
 *     length = len(index)             # <<<<<<<<<<<<<<
 * 
 *     index_buf = np.asarray(index)
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_2;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":28
 *     length = len(index)
 * 
 *     index_buf = np.asarray(index)             # <<<<<<<<<<<<<<
 *     mapped_index = arrmap(index_buf, mapper)
 *     mask = isnullobj(mapped_index)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index_buf);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_index_buf, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_index_buf, (PyObject*)__pyx_v_index_buf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_index_buf = __pyx_bstruct_index_buf.strides[0];
    __pyx_bshape_0_index_buf = __pyx_bstruct_index_buf.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_index_buf = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":29
 * 
 *     index_buf = np.asarray(index)
 *     mapped_index = arrmap(index_buf, mapper)             # <<<<<<<<<<<<<<
 *     mask = isnullobj(mapped_index)
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__arrmap); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_index_buf));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_index_buf));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_index_buf));
  __Pyx_INCREF(__pyx_v_mapper);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_mapper);
  __Pyx_GIVEREF(__pyx_v_mapper);
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mapped_index);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_mapped_index, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mapped_index, (PyObject*)__pyx_v_mapped_index, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_mapped_index = __pyx_bstruct_mapped_index.strides[0];
    __pyx_bshape_0_mapped_index = __pyx_bstruct_mapped_index.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = 0;
  __pyx_v_mapped_index = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":30
 *     index_buf = np.asarray(index)
 *     mapped_index = arrmap(index_buf, mapper)
 *     mask = isnullobj(mapped_index)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < length:
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__isnullobj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_mapped_index));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_mapped_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_mapped_index));
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_mask = __pyx_bstruct_mask.strides[0];
    __pyx_bshape_0_mask = __pyx_bstruct_mask.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":32
 *     mask = isnullobj(mapped_index)
 * 
 *     for i from 0 <= i < length:             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             continue
 */
  __pyx_t_6 = __pyx_v_length;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":33
 * 
 *     for i from 0 <= i < length:
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_12 = __pyx_v_i;
    if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_bshape_0_mask;
    __pyx_t_13 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_bstruct_mask.buf, __pyx_t_12, __pyx_bstride_0_mask));
    if (__pyx_t_13) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":34
 *     for i from 0 <= i < length:
 *         if mask[i]:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         key = mapped_index[i]
 */
      goto __pyx_L6_continue;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":36
 *             continue
 * 
 *         key = mapped_index[i]             # <<<<<<<<<<<<<<
 *         idx = index_buf[i]
 *         if key in result:
 */
    __pyx_t_14 = __pyx_v_i;
    if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_bshape_0_mapped_index;
    __pyx_t_4 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_mapped_index.buf, __pyx_t_14, __pyx_bstride_0_mapped_index);
    __Pyx_INCREF((PyObject*)__pyx_t_4);
    __Pyx_XDECREF(__pyx_v_key);
    __pyx_v_key = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":37
 * 
 *         key = mapped_index[i]
 *         idx = index_buf[i]             # <<<<<<<<<<<<<<
 *         if key in result:
 *             members = result[key]
 */
    __pyx_t_15 = __pyx_v_i;
    if (__pyx_t_15 < 0) __pyx_t_15 += __pyx_bshape_0_index_buf;
    __pyx_t_4 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_index_buf.buf, __pyx_t_15, __pyx_bstride_0_index_buf);
    __Pyx_INCREF((PyObject*)__pyx_t_4);
    __Pyx_XDECREF(__pyx_v_idx);
    __pyx_v_idx = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":38
 *         key = mapped_index[i]
 *         idx = index_buf[i]
 *         if key in result:             # <<<<<<<<<<<<<<
 *             members = result[key]
 *             members.append(idx)
 */
    if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_16 = ((PyDict_Contains(((PyObject *)__pyx_v_result), __pyx_v_key))); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_16) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":39
 *         idx = index_buf[i]
 *         if key in result:
 *             members = result[key]             # <<<<<<<<<<<<<<
 *             members.append(idx)
 *         else:
 */
      __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_members));
      __pyx_v_members = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":40
 *         if key in result:
 *             members = result[key]
 *             members.append(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             result[key] = [idx]
 */
      if (unlikely(((PyObject *)__pyx_v_members) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_17 = PyList_Append(__pyx_v_members, __pyx_v_idx); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":42
 *             members.append(idx)
 *         else:
 *             result[key] = [idx]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_INCREF(__pyx_v_idx);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_idx);
      __Pyx_GIVEREF(__pyx_v_idx);
      if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_v_key, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    }
    __pyx_L9:;
    __pyx_L6_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":44
 *             result[key] = [idx]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index_buf);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mapped_index);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.groupby_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index_buf);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mapped_index);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_mapped_index);
  __Pyx_XDECREF((PyObject *)__pyx_v_index_buf);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_members);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":47
 * 
 * 
 * def func_groupby_indices(object index, object mapper):             # <<<<<<<<<<<<<<
 *     return groupby_indices_naive(arrmap(index, mapper))
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_58func_groupby_indices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_58func_groupby_indices = {__Pyx_NAMESTR("func_groupby_indices"), (PyCFunction)__pyx_pf_6pandas_3lib_58func_groupby_indices, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_58func_groupby_indices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_mapper = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__mapper,0};
  __Pyx_RefNannySetupContext("func_groupby_indices");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mapper);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("func_groupby_indices", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "func_groupby_indices") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_index = values[0];
    __pyx_v_mapper = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("func_groupby_indices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.func_groupby_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":48
 * 
 * def func_groupby_indices(object index, object mapper):
 *     return groupby_indices_naive(arrmap(index, mapper))             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__arrmap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  __Pyx_INCREF(__pyx_v_mapper);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mapper);
  __Pyx_GIVEREF(__pyx_v_mapper);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __pyx_f_6pandas_3lib_groupby_indices_naive(((PyArrayObject *)__pyx_t_3), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.func_groupby_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":51
 * 
 * @cython.boundscheck(False)
 * cpdef groupby_indices_naive(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef dict result
 *     cdef ndarray[int8_t] mask
 */

static PyObject *__pyx_pf_6pandas_3lib_59groupby_indices_naive(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_groupby_indices_naive(PyArrayObject *__pyx_v_values, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_mask = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_v_key = 0;
  Py_buffer __pyx_bstruct_mask;
  Py_ssize_t __pyx_bstride_0_mask = 0;
  Py_ssize_t __pyx_bshape_0_mask = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  __pyx_t_5numpy_int8_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("groupby_indices_naive");
  __pyx_bstruct_mask.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":54
 *     cdef dict result
 *     cdef ndarray[int8_t] mask
 *     cdef Py_ssize_t i, length = len(values)             # <<<<<<<<<<<<<<
 *     cdef object key
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":57
 *     cdef object key
 * 
 *     result = {}             # <<<<<<<<<<<<<<
 *     mask = isnullobj(values)
 *     for i from 0 <= i < length:
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":58
 * 
 *     result = {}
 *     mask = isnullobj(values)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < length:
 *         if mask[i]:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__isnullobj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_mask = __pyx_bstruct_mask.strides[0];
    __pyx_bshape_0_mask = __pyx_bstruct_mask.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":59
 *     result = {}
 *     mask = isnullobj(values)
 *     for i from 0 <= i < length:             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             continue
 */
  __pyx_t_1 = __pyx_v_length;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":60
 *     mask = isnullobj(values)
 *     for i from 0 <= i < length:
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_10 = __pyx_v_i;
    if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_bshape_0_mask;
    __pyx_t_11 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int8_t *, __pyx_bstruct_mask.buf, __pyx_t_10, __pyx_bstride_0_mask));
    if (__pyx_t_11) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":61
 *     for i from 0 <= i < length:
 *         if mask[i]:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         key = values[i]
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":63
 *             continue
 * 
 *         key = values[i]             # <<<<<<<<<<<<<<
 *         if key in result:
 *             (<list> result[key]).append(i)
 */
    __pyx_t_12 = __pyx_v_i;
    if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_bshape_0_values;
    __pyx_t_4 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_12, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_4);
    __Pyx_XDECREF(__pyx_v_key);
    __pyx_v_key = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":64
 * 
 *         key = values[i]
 *         if key in result:             # <<<<<<<<<<<<<<
 *             (<list> result[key]).append(i)
 *         else:
 */
    if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_13 = ((PyDict_Contains(((PyObject *)__pyx_v_result), __pyx_v_key))); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_13) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":65
 *         key = values[i]
 *         if key in result:
 *             (<list> result[key]).append(i)             # <<<<<<<<<<<<<<
 *         else:
 *             result[key] = [i]
 */
      __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_result), __pyx_v_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__pyx_t_4 == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_14 = PyList_Append(((PyObject*)__pyx_t_4), __pyx_t_3); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":67
 *             (<list> result[key]).append(i)
 *         else:
 *             result[key] = [i]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_v_key, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    }
    __pyx_L6:;
    __pyx_L3_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":69
 *             result[key] = [i]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.groupby_indices_naive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":51
 * 
 * @cython.boundscheck(False)
 * cpdef groupby_indices_naive(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef dict result
 *     cdef ndarray[int8_t] mask
 */

static PyObject *__pyx_pf_6pandas_3lib_59groupby_indices_naive(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_59groupby_indices_naive(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("groupby_indices_naive");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib_groupby_indices_naive(((PyArrayObject *)__pyx_v_values), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.groupby_indices_naive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":72
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_60groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_60groupby_indices = {__Pyx_NAMESTR("groupby_indices"), (PyCFunction)__pyx_pf_6pandas_3lib_60groupby_indices, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_60groupby_indices(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_seen = 0;
  __pyx_t_5numpy_int64_t __pyx_v_loc;
  PyObject *__pyx_v_ids = 0;
  __pyx_t_5numpy_int64_t __pyx_v_k;
  __pyx_t_5numpy_int64_t **__pyx_v_vecs;
  PyObject *__pyx_v_result = NULL;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_seen;
  Py_ssize_t __pyx_bstride_0_seen = 0;
  Py_ssize_t __pyx_bshape_0_seen = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  __pyx_t_5numpy_int64_t __pyx_t_16;
  __pyx_t_5numpy_int64_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("groupby_indices");
  __pyx_self = __pyx_self;
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_arr.buf = NULL;
  __pyx_bstruct_seen.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":74
 * def groupby_indices(ndarray values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] labels, counts, arr, seen
 *         int64_t loc
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":77
 *         ndarray[int64_t] labels, counts, arr, seen
 *         int64_t loc
 *         dict ids = {}             # <<<<<<<<<<<<<<
 *         object val
 *         int64_t k
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_ids = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":81
 *         int64_t k
 * 
 *     ids, labels, counts = group_labels(values)             # <<<<<<<<<<<<<<
 *     seen = np.zeros_like(counts)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__group_labels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) {
        if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 3)) {
        if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  if (!(likely(PyDict_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_v_ids));
  __pyx_v_ids = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
    __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":82
 * 
 *     ids, labels, counts = group_labels(values)
 *     seen = np.zeros_like(counts)             # <<<<<<<<<<<<<<
 * 
 *     # try not to get in trouble here...
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_counts));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_counts));
  __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_seen);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_seen, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_seen, (PyObject*)__pyx_v_seen, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_seen = __pyx_bstruct_seen.strides[0];
    __pyx_bshape_0_seen = __pyx_bstruct_seen.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_seen = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":85
 * 
 *     # try not to get in trouble here...
 *     cdef int64_t **vecs = <int64_t **> malloc(len(ids) * sizeof(int64_t*))             # <<<<<<<<<<<<<<
 *     result = {}
 *     for i from 0 <= i < len(counts):
 */
  if (unlikely(((PyObject *)__pyx_v_ids) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyDict_Size(((PyObject *)__pyx_v_ids)); 
  __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_t_1 * (sizeof(__pyx_t_5numpy_int64_t *)))));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":86
 *     # try not to get in trouble here...
 *     cdef int64_t **vecs = <int64_t **> malloc(len(ids) * sizeof(int64_t*))
 *     result = {}             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < len(counts):
 *         arr = np.empty(counts[i], dtype=np.int64)
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":87
 *     cdef int64_t **vecs = <int64_t **> malloc(len(ids) * sizeof(int64_t*))
 *     result = {}
 *     for i from 0 <= i < len(counts):             # <<<<<<<<<<<<<<
 *         arr = np.empty(counts[i], dtype=np.int64)
 *         result[ids[i]] = arr
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":88
 *     result = {}
 *     for i from 0 <= i < len(counts):
 *         arr = np.empty(counts[i], dtype=np.int64)             # <<<<<<<<<<<<<<
 *         result[ids[i]] = arr
 *         vecs[i] = <int64_t *> arr.data
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = __pyx_v_i;
    if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_bshape_0_counts;
    __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_13, __pyx_bstride_0_counts))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = ((PyArrayObject *)__pyx_t_6);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
      __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_9 < 0)) {
        PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
        }
      }
      __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
      __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];
      if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_arr));
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":89
 *     for i from 0 <= i < len(counts):
 *         arr = np.empty(counts[i], dtype=np.int64)
 *         result[ids[i]] = arr             # <<<<<<<<<<<<<<
 *         vecs[i] = <int64_t *> arr.data
 * 
 */
    __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_ids), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_t_6, ((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":90
 *         arr = np.empty(counts[i], dtype=np.int64)
 *         result[ids[i]] = arr
 *         vecs[i] = <int64_t *> arr.data             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    (__pyx_v_vecs[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)__pyx_v_arr->data);
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":92
 *         vecs[i] = <int64_t *> arr.data
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         k = labels[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":93
 * 
 *     for i from 0 <= i < n:
 *         k = labels[i]             # <<<<<<<<<<<<<<
 * 
 *         # was NaN
 */
    __pyx_t_14 = __pyx_v_i;
    if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_bshape_0_labels;
    __pyx_v_k = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_14, __pyx_bstride_0_labels));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":96
 * 
 *         # was NaN
 *         if k == -1:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_15 = (__pyx_v_k == -1);
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":97
 *         # was NaN
 *         if k == -1:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         loc = seen[k]
 */
      goto __pyx_L9_continue;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":99
 *             continue
 * 
 *         loc = seen[k]             # <<<<<<<<<<<<<<
 *         vecs[k][loc] = i
 *         seen[k] = loc + 1
 */
    __pyx_t_16 = __pyx_v_k;
    if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_bshape_0_seen;
    __pyx_v_loc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_seen.buf, __pyx_t_16, __pyx_bstride_0_seen));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":100
 * 
 *         loc = seen[k]
 *         vecs[k][loc] = i             # <<<<<<<<<<<<<<
 *         seen[k] = loc + 1
 * 
 */
    ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_loc]) = __pyx_v_i;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":101
 *         loc = seen[k]
 *         vecs[k][loc] = i
 *         seen[k] = loc + 1             # <<<<<<<<<<<<<<
 * 
 *     free(vecs)
 */
    __pyx_t_17 = __pyx_v_k;
    if (__pyx_t_17 < 0) __pyx_t_17 += __pyx_bshape_0_seen;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_seen.buf, __pyx_t_17, __pyx_bstride_0_seen) = (__pyx_v_loc + 1);
    __pyx_L9_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":103
 *         seen[k] = loc + 1
 * 
 *     free(vecs)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  free(__pyx_v_vecs);

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":105
 *     free(vecs)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_seen);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.groupby_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_seen);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_seen);
  __Pyx_XDECREF(__pyx_v_ids);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":109
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */

static PyObject *__pyx_pf_6pandas_3lib_61is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_61is_lexsorted = {__Pyx_NAMESTR("is_lexsorted"), (PyCFunction)__pyx_pf_6pandas_3lib_61is_lexsorted, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_61is_lexsorted(PyObject *__pyx_self, PyObject *__pyx_v_list_of_arrays) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_nlevels;
  __pyx_t_5numpy_int64_t __pyx_v_k;
  __pyx_t_5numpy_int64_t __pyx_v_cur;
  __pyx_t_5numpy_int64_t __pyx_v_pre;
  PyArrayObject *__pyx_v_arr = 0;
  __pyx_t_5numpy_int64_t **__pyx_v_vecs;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_lexsorted");
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_list_of_arrays), (&PyList_Type), 1, "list_of_arrays", 1))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":116
 *         ndarray arr
 * 
 *     nlevels = len(list_of_arrays)             # <<<<<<<<<<<<<<
 *     n = len(list_of_arrays[0])
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_list_of_arrays) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_list_of_arrays)); 
  __pyx_v_nlevels = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":117
 * 
 *     nlevels = len(list_of_arrays)
 *     n = len(list_of_arrays[0])             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t **vecs = <int64_t**> malloc(nlevels * sizeof(int64_t*))
 */
  __pyx_t_2 = PyList_GET_ITEM(__pyx_v_list_of_arrays, 0);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":119
 *     n = len(list_of_arrays[0])
 * 
 *     cdef int64_t **vecs = <int64_t**> malloc(nlevels * sizeof(int64_t*))             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < nlevels:
 *         # vecs[i] = <int64_t *> (<ndarray> list_of_arrays[i]).data
 */
  __pyx_v_vecs = ((__pyx_t_5numpy_int64_t **)malloc((__pyx_v_nlevels * (sizeof(__pyx_t_5numpy_int64_t *)))));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":120
 * 
 *     cdef int64_t **vecs = <int64_t**> malloc(nlevels * sizeof(int64_t*))
 *     for i from 0 <= i < nlevels:             # <<<<<<<<<<<<<<
 *         # vecs[i] = <int64_t *> (<ndarray> list_of_arrays[i]).data
 * 
 */
  __pyx_t_1 = __pyx_v_nlevels;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":123
 *         # vecs[i] = <int64_t *> (<ndarray> list_of_arrays[i]).data
 * 
 *         arr = list_of_arrays[i]             # <<<<<<<<<<<<<<
 *         vecs[i] = <int64_t *> arr.data
 *     # assume uniqueness??
 */
    if (!(likely(((PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i), __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i));
    __Pyx_XDECREF(((PyObject *)__pyx_v_arr));
    __pyx_v_arr = ((PyArrayObject *)PyList_GET_ITEM(__pyx_v_list_of_arrays, __pyx_v_i));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":124
 * 
 *         arr = list_of_arrays[i]
 *         vecs[i] = <int64_t *> arr.data             # <<<<<<<<<<<<<<
 *     # assume uniqueness??
 * 
 */
    (__pyx_v_vecs[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t *)__pyx_v_arr->data);
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":127
 *     # assume uniqueness??
 * 
 *     for i from 1 <= i < n:             # <<<<<<<<<<<<<<
 *         for k from 0 <= k < nlevels:
 *             cur = vecs[k][i]
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":128
 * 
 *     for i from 1 <= i < n:
 *         for k from 0 <= k < nlevels:             # <<<<<<<<<<<<<<
 *             cur = vecs[k][i]
 *             pre = vecs[k][i-1]
 */
    __pyx_t_3 = __pyx_v_nlevels;
    for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":129
 *     for i from 1 <= i < n:
 *         for k from 0 <= k < nlevels:
 *             cur = vecs[k][i]             # <<<<<<<<<<<<<<
 *             pre = vecs[k][i-1]
 *             if cur == pre:
 */
      __pyx_v_cur = ((__pyx_v_vecs[__pyx_v_k])[__pyx_v_i]);

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":130
 *         for k from 0 <= k < nlevels:
 *             cur = vecs[k][i]
 *             pre = vecs[k][i-1]             # <<<<<<<<<<<<<<
 *             if cur == pre:
 *                 continue
 */
      __pyx_v_pre = ((__pyx_v_vecs[__pyx_v_k])[(__pyx_v_i - 1)]);

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":131
 *             cur = vecs[k][i]
 *             pre = vecs[k][i-1]
 *             if cur == pre:             # <<<<<<<<<<<<<<
 *                 continue
 *             elif cur > pre:
 */
      __pyx_t_4 = (__pyx_v_cur == __pyx_v_pre);
      if (__pyx_t_4) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":132
 *             pre = vecs[k][i-1]
 *             if cur == pre:
 *                 continue             # <<<<<<<<<<<<<<
 *             elif cur > pre:
 *                 break
 */
        goto __pyx_L9_continue;
        goto __pyx_L11;
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":133
 *             if cur == pre:
 *                 continue
 *             elif cur > pre:             # <<<<<<<<<<<<<<
 *                 break
 *             else:
 */
      __pyx_t_4 = (__pyx_v_cur > __pyx_v_pre);
      if (__pyx_t_4) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":134
 *                 continue
 *             elif cur > pre:
 *                 break             # <<<<<<<<<<<<<<
 *             else:
 *                 return False
 */
        goto __pyx_L10_break;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":136
 *                 break
 *             else:
 *                 return False             # <<<<<<<<<<<<<<
 *     free(vecs)
 *     return True
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;
      }
      __pyx_L11:;
      __pyx_L9_continue:;
    }
    __pyx_L10_break:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":137
 *             else:
 *                 return False
 *     free(vecs)             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
  free(__pyx_v_vecs);

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":138
 *                 return False
 *     free(vecs)
 *     return True             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.is_lexsorted", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":142
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_labels(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute label vector from input values and associated useful data
 */

static PyObject *__pyx_pf_6pandas_3lib_62group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static char __pyx_doc_6pandas_3lib_62group_labels[] = "\n    Compute label vector from input values and associated useful data\n\n    Returns\n    -------\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_62group_labels = {__Pyx_NAMESTR("group_labels"), (PyCFunction)__pyx_pf_6pandas_3lib_62group_labels, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_62group_labels)};
static PyObject *__pyx_pf_6pandas_3lib_62group_labels(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyObject *__pyx_v_ids = 0;
  PyObject *__pyx_v_reverse = 0;
  __pyx_t_5numpy_int64_t __pyx_v_idx;
  PyObject *__pyx_v_val = 0;
  __pyx_t_5numpy_int64_t __pyx_v_count;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  __pyx_t_5numpy_int64_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __pyx_t_5numpy_int64_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_5numpy_int64_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("group_labels");
  __pyx_self = __pyx_self;
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":150
 *     '''
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *         ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":151
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 *         ndarray[int64_t] labels = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 *         dict ids = {}, reverse = {}
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_labels = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_labels.buf = NULL;
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
      __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_labels = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":152
 *         Py_ssize_t i, n = len(values)
 *         ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *         ndarray[int64_t] counts = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         dict ids = {}, reverse = {}
 *         int64_t idx
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_counts = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_counts.buf = NULL;
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
      __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    }
  }
  __pyx_t_8 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":153
 *         ndarray[int64_t] labels = np.empty(n, dtype=np.int64)
 *         ndarray[int64_t] counts = np.empty(n, dtype=np.int64)
 *         dict ids = {}, reverse = {}             # <<<<<<<<<<<<<<
 *         int64_t idx
 *         object val
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_v_ids = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_v_reverse = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":156
 *         int64_t idx
 *         object val
 *         int64_t count = 0             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":158
 *         int64_t count = 0
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         val = values[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":159
 * 
 *     for i from 0 <= i < n:
 *         val = values[i]             # <<<<<<<<<<<<<<
 * 
 *         # is NaN
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":162
 * 
 *         # is NaN
 *         if val != val:             # <<<<<<<<<<<<<<
 *             labels[i] = -1
 *             continue
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":163
 *         # is NaN
 *         if val != val:
 *             labels[i] = -1             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_t_11 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_11, __pyx_bstride_0_labels) = -1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":164
 *         if val != val:
 *             labels[i] = -1
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         # for large number of groups, not doing try: except: makes a big
 */
      goto __pyx_L5_continue;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":168
 *         # for large number of groups, not doing try: except: makes a big
 *         # difference
 *         if val in ids:             # <<<<<<<<<<<<<<
 *             idx = ids[val]
 *             labels[i] = idx
 */
    if (unlikely(((PyObject *)__pyx_v_ids) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_10 = ((PyDict_Contains(((PyObject *)__pyx_v_ids), __pyx_v_val))); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":169
 *         # difference
 *         if val in ids:
 *             idx = ids[val]             # <<<<<<<<<<<<<<
 *             labels[i] = idx
 *             counts[idx] = counts[idx] + 1
 */
      __pyx_t_5 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_ids), __pyx_v_val); if (!__pyx_t_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_idx = __pyx_t_12;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":170
 *         if val in ids:
 *             idx = ids[val]
 *             labels[i] = idx             # <<<<<<<<<<<<<<
 *             counts[idx] = counts[idx] + 1
 *         else:
 */
      __pyx_t_13 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_13, __pyx_bstride_0_labels) = __pyx_v_idx;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":171
 *             idx = ids[val]
 *             labels[i] = idx
 *             counts[idx] = counts[idx] + 1             # <<<<<<<<<<<<<<
 *         else:
 *             ids[val] = count
 */
      __pyx_t_12 = __pyx_v_idx;
      __pyx_t_14 = __pyx_v_idx;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_14, __pyx_bstride_0_counts) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_12, __pyx_bstride_0_counts)) + 1);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":173
 *             counts[idx] = counts[idx] + 1
 *         else:
 *             ids[val] = count             # <<<<<<<<<<<<<<
 *             reverse[count] = val
 *             labels[i] = count
 */
      __pyx_t_5 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(((PyObject *)__pyx_v_ids), __pyx_v_val, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":174
 *         else:
 *             ids[val] = count
 *             reverse[count] = val             # <<<<<<<<<<<<<<
 *             labels[i] = count
 *             counts[count] = 1
 */
      if (__Pyx_SetItemInt(((PyObject *)__pyx_v_reverse), __pyx_v_count, __pyx_v_val, sizeof(__pyx_t_5numpy_int64_t), __Pyx_PyInt_to_py_npy_int64) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":175
 *             ids[val] = count
 *             reverse[count] = val
 *             labels[i] = count             # <<<<<<<<<<<<<<
 *             counts[count] = 1
 *             count += 1
 */
      __pyx_t_15 = __pyx_v_i;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_15, __pyx_bstride_0_labels) = __pyx_v_count;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":176
 *             reverse[count] = val
 *             labels[i] = count
 *             counts[count] = 1             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
      __pyx_t_16 = __pyx_v_count;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_16, __pyx_bstride_0_counts) = 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":177
 *             labels[i] = count
 *             counts[count] = 1
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *     return reverse, labels, counts[:count].copy()
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __pyx_L8:;
    __pyx_L5_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":179
 *             count += 1
 * 
 *     return reverse, labels, counts[:count].copy()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_counts), 0, __pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_reverse));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_reverse));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_reverse));
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_ids);
  __Pyx_XDECREF(__pyx_v_reverse);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":184
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def get_unique_labels(ndarray[object] values, dict idMap):             # <<<<<<<<<<<<<<
 *     cdef int i, length
 *     cdef object idx
 */

static PyObject *__pyx_pf_6pandas_3lib_63get_unique_labels(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_63get_unique_labels = {__Pyx_NAMESTR("get_unique_labels"), (PyCFunction)__pyx_pf_6pandas_3lib_63get_unique_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_63get_unique_labels(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_idMap = 0;
  int __pyx_v_i;
  int __pyx_v_length;
  PyObject *__pyx_v_idx = 0;
  PyArrayObject *__pyx_v_fillVec = 0;
  Py_buffer __pyx_bstruct_fillVec;
  Py_ssize_t __pyx_bstride_0_fillVec = 0;
  Py_ssize_t __pyx_bshape_0_fillVec = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __pyx_t_5numpy_int64_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__idMap,0};
  __Pyx_RefNannySetupContext("get_unique_labels");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__idMap);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_unique_labels", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_unique_labels") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_idMap = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_unique_labels", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.get_unique_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_fillVec.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idMap), (&PyDict_Type), 1, "idMap", 1))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":188
 *     cdef object idx
 *     cdef ndarray[int64_t] fillVec
 *     length = len(values)             # <<<<<<<<<<<<<<
 *     fillVec = np.empty(length, dtype=np.int64)
 *     for i from 0 <= i < length:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_length = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":189
 *     cdef ndarray[int64_t] fillVec
 *     length = len(values)
 *     fillVec = np.empty(length, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < length:
 *         idx = values[i]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fillVec);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_fillVec, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_fillVec, (PyObject*)__pyx_v_fillVec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_fillVec = __pyx_bstruct_fillVec.strides[0];
    __pyx_bshape_0_fillVec = __pyx_bstruct_fillVec.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_fillVec = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":190
 *     length = len(values)
 *     fillVec = np.empty(length, dtype=np.int64)
 *     for i from 0 <= i < length:             # <<<<<<<<<<<<<<
 *         idx = values[i]
 *         fillVec[i] = idMap[idx]
 */
  __pyx_t_8 = __pyx_v_length;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":191
 *     fillVec = np.empty(length, dtype=np.int64)
 *     for i from 0 <= i < length:
 *         idx = values[i]             # <<<<<<<<<<<<<<
 *         fillVec[i] = idMap[idx]
 * 
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_12, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_idx);
    __pyx_v_idx = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":192
 *     for i from 0 <= i < length:
 *         idx = values[i]
 *         fillVec[i] = idMap[idx]             # <<<<<<<<<<<<<<
 * 
 *     return fillVec
 */
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_idMap), __pyx_v_idx); if (!__pyx_t_6) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_13 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_13 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_14 = __pyx_v_i;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_fillVec.buf, __pyx_t_14, __pyx_bstride_0_fillVec) = __pyx_t_13;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":194
 *         fillVec[i] = idMap[idx]
 * 
 *     return fillVec             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_fillVec));
  __pyx_r = ((PyObject *)__pyx_v_fillVec);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fillVec);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.get_unique_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_fillVec);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF((PyObject *)__pyx_v_fillVec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, loc, label, n
 */

static PyObject *__pyx_pf_6pandas_3lib_64groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_64groupsort_indexer = {__Pyx_NAMESTR("groupsort_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_64groupsort_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_64groupsort_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_label;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_where = 0;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_index;
  Py_ssize_t __pyx_bstride_0_index = 0;
  Py_ssize_t __pyx_bshape_0_index = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_where;
  Py_ssize_t __pyx_bstride_0_where = 0;
  Py_ssize_t __pyx_bshape_0_where = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  __pyx_t_5numpy_int64_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __pyx_t_5numpy_int64_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__ngroups,0};
  __Pyx_RefNannySetupContext("groupsort_indexer");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ngroups);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupsort_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "groupsort_indexer") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_index = ((PyArrayObject *)values[0]);
    __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupsort_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.groupsort_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_where.buf = NULL;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_index.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_index, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_index = __pyx_bstruct_index.strides[0];
  __pyx_bshape_0_index = __pyx_bstruct_index.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":204
 * 
 *     # count group sizes, location 0 for NA
 *     counts = np.zeros(ngroups + 1, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     n = len(index)
 *     for i from 0 <= i < n:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_ngroups + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":205
 *     # count group sizes, location 0 for NA
 *     counts = np.zeros(ngroups + 1, dtype=np.int64)
 *     n = len(index)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         counts[index[i] + 1] += 1
 */
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_11;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":206
 *     counts = np.zeros(ngroups + 1, dtype=np.int64)
 *     n = len(index)
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         counts[index[i] + 1] += 1
 * 
 */
  __pyx_t_11 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":207
 *     n = len(index)
 *     for i from 0 <= i < n:
 *         counts[index[i] + 1] += 1             # <<<<<<<<<<<<<<
 * 
 *     # mark the start of each contiguous group of like-indexed data
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_index.buf, __pyx_t_12, __pyx_bstride_0_index)) + 1);
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_13, __pyx_bstride_0_counts) += 1;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":210
 * 
 *     # mark the start of each contiguous group of like-indexed data
 *     where = np.zeros(ngroups + 1, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     for i from 1 <= i < ngroups + 1:
 *         where[i] = where[i - 1] + counts[i - 1]
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_ngroups + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_where);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_where, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_where, (PyObject*)__pyx_v_where, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_where = __pyx_bstruct_where.strides[0];
    __pyx_bshape_0_where = __pyx_bstruct_where.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_where = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":211
 *     # mark the start of each contiguous group of like-indexed data
 *     where = np.zeros(ngroups + 1, dtype=np.int64)
 *     for i from 1 <= i < ngroups + 1:             # <<<<<<<<<<<<<<
 *         where[i] = where[i - 1] + counts[i - 1]
 * 
 */
  __pyx_t_11 = (__pyx_v_ngroups + 1);
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":212
 *     where = np.zeros(ngroups + 1, dtype=np.int64)
 *     for i from 1 <= i < ngroups + 1:
 *         where[i] = where[i - 1] + counts[i - 1]             # <<<<<<<<<<<<<<
 * 
 *     # this is our indexer
 */
    __pyx_t_14 = (__pyx_v_i - 1);
    __pyx_t_15 = (__pyx_v_i - 1);
    __pyx_t_16 = __pyx_v_i;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_where.buf, __pyx_t_16, __pyx_bstride_0_where) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_where.buf, __pyx_t_14, __pyx_bstride_0_where)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts)));
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":215
 * 
 *     # this is our indexer
 *     result = np.zeros(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         label = index[i] + 1
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":216
 *     # this is our indexer
 *     result = np.zeros(n, dtype=np.int64)
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         label = index[i] + 1
 *         result[where[label]] = i
 */
  __pyx_t_11 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":217
 *     result = np.zeros(n, dtype=np.int64)
 *     for i from 0 <= i < n:
 *         label = index[i] + 1             # <<<<<<<<<<<<<<
 *         result[where[label]] = i
 *         where[label] += 1
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_label = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_index.buf, __pyx_t_17, __pyx_bstride_0_index)) + 1);

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":218
 *     for i from 0 <= i < n:
 *         label = index[i] + 1
 *         result[where[label]] = i             # <<<<<<<<<<<<<<
 *         where[label] += 1
 * 
 */
    __pyx_t_18 = __pyx_v_label;
    __pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_where.buf, __pyx_t_18, __pyx_bstride_0_where));
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_19, __pyx_bstride_0_result) = __pyx_v_i;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":219
 *         label = index[i] + 1
 *         result[where[label]] = i
 *         where[label] += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, counts
 */
    __pyx_t_20 = __pyx_v_label;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_where.buf, __pyx_t_20, __pyx_bstride_0_where) += 1;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":221
 *         where[label] += 1
 * 
 *     return result, counts             # <<<<<<<<<<<<<<
 * 
 * # TODO: aggregate multiple columns in single pass
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_counts));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_counts));
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_where);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.groupsort_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_where);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF((PyObject *)__pyx_v_where);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":227
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_65group_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_65group_add[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_65group_add = {__Pyx_NAMESTR("group_add"), (PyCFunction)__pyx_pf_6pandas_3lib_65group_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_65group_add)};
static PyObject *__pyx_pf_6pandas_3lib_65group_add(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_sumx;
  Py_ssize_t __pyx_bstride_0_sumx = 0;
  Py_ssize_t __pyx_bstride_1_sumx = 0;
  Py_ssize_t __pyx_bshape_0_sumx = 0;
  Py_ssize_t __pyx_bshape_1_sumx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  long __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  long __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  long __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("group_add");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_add") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_add", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_sumx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":239
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":240
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_sumx = __pyx_bstruct_sumx.strides[0]; __pyx_bstride_1_sumx = __pyx_bstruct_sumx.strides[1];
    __pyx_bshape_0_sumx = __pyx_bstruct_sumx.shape[0]; __pyx_bshape_1_sumx = __pyx_bstruct_sumx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":242
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":244
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_13 = (__pyx_v_K > 1);
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":245
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":246
 *     if K > 1:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_14, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":247
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":248
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L9_continue;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":250
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_15 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":251
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_16 = __pyx_v_K;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_j = __pyx_t_17;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":252
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":255
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":256
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[lab, j] += val
 *     else:
 */
          __pyx_t_20 = __pyx_v_lab;
          __pyx_t_21 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_20, __pyx_bstride_0_nobs, __pyx_t_21, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":257
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_22 = __pyx_v_lab;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_22, __pyx_bstride_0_sumx, __pyx_t_23, __pyx_bstride_1_sumx) += __pyx_v_val;
          goto __pyx_L14;
        }
        __pyx_L14:;
      }
      __pyx_L9_continue:;
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":259
 *                     sumx[lab, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":260
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":261
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":262
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L15_continue;
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":264
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":265
 * 
 *             counts[lab] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_25 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_24, __pyx_bstride_0_values, __pyx_t_25, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":268
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":269
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[lab, 0] += val
 * 
 */
        __pyx_t_26 = __pyx_v_lab;
        __pyx_t_27 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_26, __pyx_bstride_0_nobs, __pyx_t_27, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":270
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
        __pyx_t_28 = __pyx_v_lab;
        __pyx_t_29 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_28, __pyx_bstride_0_sumx, __pyx_t_29, __pyx_bstride_1_sumx) += __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_L15_continue:;
    }
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":272
 *                 sumx[lab, 0] += val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":273
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_30 = __pyx_v_K;
    for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
      __pyx_v_j = __pyx_t_31;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":274
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_32 = __pyx_v_i;
      __pyx_t_33 = __pyx_v_j;
      __pyx_t_13 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_32, __pyx_bstride_0_nobs, __pyx_t_33, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":275
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = sumx[i, j]
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_35 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_34, __pyx_bstride_0_out, __pyx_t_35, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":277
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_36 = __pyx_v_i;
        __pyx_t_37 = __pyx_v_j;
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_38, __pyx_bstride_0_out, __pyx_t_39, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_36, __pyx_bstride_0_sumx, __pyx_t_37, __pyx_bstride_1_sumx));
      }
      __pyx_L23:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":282
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_66group_prod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_66group_prod[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_66group_prod = {__Pyx_NAMESTR("group_prod"), (PyCFunction)__pyx_pf_6pandas_3lib_66group_prod, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_66group_prod)};
static PyObject *__pyx_pf_6pandas_3lib_66group_prod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_prodx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_prodx;
  Py_ssize_t __pyx_bstride_0_prodx = 0;
  Py_ssize_t __pyx_bstride_1_prodx = 0;
  Py_ssize_t __pyx_bshape_0_prodx = 0;
  Py_ssize_t __pyx_bshape_1_prodx = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  long __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  long __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  long __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("group_prod");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_prod") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_prod", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_prod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_prodx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":294
 *         ndarray[float64_t, ndim=2] prodx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":295
 * 
 *     nobs = np.zeros_like(out)
 *     prodx = np.ones_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ones_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_prodx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_prodx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_prodx, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_prodx = __pyx_bstruct_prodx.strides[0]; __pyx_bstride_1_prodx = __pyx_bstruct_prodx.strides[1];
    __pyx_bshape_0_prodx = __pyx_bstruct_prodx.shape[0]; __pyx_bshape_1_prodx = __pyx_bstruct_prodx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":297
 *     prodx = np.ones_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":299
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_13 = (__pyx_v_K > 1);
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":300
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":301
 *     if K > 1:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_14, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":302
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":303
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L9_continue;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":305
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_15 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":306
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_16 = __pyx_v_K;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_j = __pyx_t_17;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":307
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":310
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     prodx[lab, j] *= val
 */
        __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":311
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     prodx[lab, j] *= val
 *     else:
 */
          __pyx_t_20 = __pyx_v_lab;
          __pyx_t_21 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_20, __pyx_bstride_0_nobs, __pyx_t_21, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":312
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     prodx[lab, j] *= val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_22 = __pyx_v_lab;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_prodx.buf, __pyx_t_22, __pyx_bstride_0_prodx, __pyx_t_23, __pyx_bstride_1_prodx) *= __pyx_v_val;
          goto __pyx_L14;
        }
        __pyx_L14:;
      }
      __pyx_L9_continue:;
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":314
 *                     prodx[lab, j] *= val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":315
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":316
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":317
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L15_continue;
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":319
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":320
 * 
 *             counts[lab] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_25 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_24, __pyx_bstride_0_values, __pyx_t_25, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":323
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 prodx[lab, 0] *= val
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":324
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 prodx[lab, 0] *= val
 * 
 */
        __pyx_t_26 = __pyx_v_lab;
        __pyx_t_27 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_26, __pyx_bstride_0_nobs, __pyx_t_27, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":325
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 prodx[lab, 0] *= val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
        __pyx_t_28 = __pyx_v_lab;
        __pyx_t_29 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_prodx.buf, __pyx_t_28, __pyx_bstride_0_prodx, __pyx_t_29, __pyx_bstride_1_prodx) *= __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_L15_continue:;
    }
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":327
 *                 prodx[lab, 0] *= val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":328
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_30 = __pyx_v_K;
    for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
      __pyx_v_j = __pyx_t_31;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":329
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_32 = __pyx_v_i;
      __pyx_t_33 = __pyx_v_j;
      __pyx_t_13 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_32, __pyx_bstride_0_nobs, __pyx_t_33, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":330
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = prodx[i, j]
 */
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_35 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_34, __pyx_bstride_0_out, __pyx_t_35, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":332
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = prodx[i, j]             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
        __pyx_t_36 = __pyx_v_i;
        __pyx_t_37 = __pyx_v_j;
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_38, __pyx_bstride_0_out, __pyx_t_39, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_prodx.buf, __pyx_t_36, __pyx_bstride_0_prodx, __pyx_t_37, __pyx_bstride_1_prodx));
      }
      __pyx_L23:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_prodx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_prod", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_prodx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_prodx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":339
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_67group_nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_67group_nth[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_67group_nth = {__Pyx_NAMESTR("group_nth"), (PyCFunction)__pyx_pf_6pandas_3lib_67group_nth, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_67group_nth)};
static PyObject *__pyx_pf_6pandas_3lib_67group_nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  __pyx_t_5numpy_int64_t __pyx_v_rank;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_resx;
  Py_ssize_t __pyx_bstride_0_resx = 0;
  Py_ssize_t __pyx_bstride_1_resx = 0;
  Py_ssize_t __pyx_bshape_0_resx = 0;
  Py_ssize_t __pyx_bshape_1_resx = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,&__pyx_n_s__rank,0};
  __Pyx_RefNannySetupContext("group_nth");
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth", 1, 5, 5, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth", 1, 5, 5, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth", 1, 5, 5, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rank);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth", 1, 5, 5, 4); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_nth") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
    __pyx_v_rank = __Pyx_PyInt_from_py_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_nth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_resx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":352
 *         ndarray[int64_t, ndim=2] nobs
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_out), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":353
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_resx, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_resx, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_resx = __pyx_bstruct_resx.strides[0]; __pyx_bstride_1_resx = __pyx_bstruct_resx.strides[1];
    __pyx_bshape_0_resx = __pyx_bstruct_resx.shape[0]; __pyx_bshape_1_resx = __pyx_bstruct_resx.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":355
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_1 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_13;
  __pyx_v_K = __pyx_t_14;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":357
 *     N, K = (<object> values).shape
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 0:
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":358
 * 
 *     for i in range(N):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if lab < 0:
 *             continue
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_15, __pyx_bstride_0_labels));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":359
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_16 = (__pyx_v_lab < 0);
    if (__pyx_t_16) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":360
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L8_continue;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":362
 *             continue
 * 
 *         counts[lab] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_lab;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) += 1;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":363
 * 
 *         counts[lab] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_18 = __pyx_v_K;
    for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
      __pyx_v_j = __pyx_t_19;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":364
 *         counts[lab] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_21 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_20, __pyx_bstride_0_values, __pyx_t_21, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":367
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, j] += 1
 *                 if nobs[lab, j] == rank:
 */
      __pyx_t_16 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":368
 *             # not nan
 *             if val == val:
 *                 nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                 if nobs[lab, j] == rank:
 *                     resx[lab, j] = val
 */
        __pyx_t_22 = __pyx_v_lab;
        __pyx_t_23 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_nobs.buf, __pyx_t_22, __pyx_bstride_0_nobs, __pyx_t_23, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":369
 *             if val == val:
 *                 nobs[lab, j] += 1
 *                 if nobs[lab, j] == rank:             # <<<<<<<<<<<<<<
 *                     resx[lab, j] = val
 * 
 */
        __pyx_t_24 = __pyx_v_lab;
        __pyx_t_25 = __pyx_v_j;
        __pyx_t_16 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_nobs.buf, __pyx_t_24, __pyx_bstride_0_nobs, __pyx_t_25, __pyx_bstride_1_nobs)) == __pyx_v_rank);
        if (__pyx_t_16) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":370
 *                 nobs[lab, j] += 1
 *                 if nobs[lab, j] == rank:
 *                     resx[lab, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
          __pyx_t_26 = __pyx_v_lab;
          __pyx_t_27 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_resx.buf, __pyx_t_26, __pyx_bstride_0_resx, __pyx_t_27, __pyx_bstride_1_resx) = __pyx_v_val;
          goto __pyx_L14;
        }
        __pyx_L14:;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }
    __pyx_L8_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":372
 *                     resx[lab, j] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":373
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_18 = __pyx_v_K;
    for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
      __pyx_v_j = __pyx_t_19;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":374
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_29 = __pyx_v_j;
      __pyx_t_16 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_nobs.buf, __pyx_t_28, __pyx_bstride_0_nobs, __pyx_t_29, __pyx_bstride_1_nobs)) == 0);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":375
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_30 = __pyx_v_i;
        __pyx_t_31 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_30, __pyx_bstride_0_out, __pyx_t_31, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":377
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_33 = __pyx_v_j;
        __pyx_t_34 = __pyx_v_i;
        __pyx_t_35 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_34, __pyx_bstride_0_out, __pyx_t_35, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_resx.buf, __pyx_t_32, __pyx_bstride_0_resx, __pyx_t_33, __pyx_bstride_1_resx));
      }
      __pyx_L19:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_nth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":382
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_68group_nth_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_68group_nth_bin[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_68group_nth_bin = {__Pyx_NAMESTR("group_nth_bin"), (PyCFunction)__pyx_pf_6pandas_3lib_68group_nth_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_68group_nth_bin)};
static PyObject *__pyx_pf_6pandas_3lib_68group_nth_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  __pyx_t_5numpy_int64_t __pyx_v_rank;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_resx;
  Py_ssize_t __pyx_bstride_0_resx = 0;
  Py_ssize_t __pyx_bstride_1_resx = 0;
  Py_ssize_t __pyx_bshape_0_resx = 0;
  Py_ssize_t __pyx_bshape_1_resx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,&__pyx_n_s__rank,0};
  __Pyx_RefNannySetupContext("group_nth_bin");
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin", 1, 5, 5, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin", 1, 5, 5, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin", 1, 5, 5, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rank);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_nth_bin", 1, 5, 5, 4); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_nth_bin") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
    __pyx_v_rank = __Pyx_PyInt_from_py_npy_int64(values[4]); if (unlikely((__pyx_v_rank == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_nth_bin", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_nth_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_resx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":394
 *         ndarray[float64_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":395
 * 
 *     nobs = np.zeros_like(out)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_resx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_resx, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_resx = __pyx_bstruct_resx.strides[0]; __pyx_bstride_1_resx = __pyx_bstruct_resx.strides[1];
    __pyx_bshape_0_resx = __pyx_bstruct_resx.shape[0]; __pyx_bshape_1_resx = __pyx_bstruct_resx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":397
 *     resx = np.empty_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_10, __pyx_bstride_0_bins)) == __pyx_t_11);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":398
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":400
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":402
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":404
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":405
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_9 = __pyx_v_N;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":406
 *     b = 0
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_12 = (__pyx_v_b < (__pyx_v_ngroups - 1));
      if (__pyx_t_12) {
        __pyx_t_15 = __pyx_v_b;
        __pyx_t_16 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_15, __pyx_bstride_0_bins)));
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_12;
      }
      if (!__pyx_t_17) break;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":407
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1             # <<<<<<<<<<<<<<
 * 
 *         counts[b] += 1
 */
      __pyx_v_b = (__pyx_v_b + 1);
    }

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":409
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_18 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) += 1;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":410
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_19 = __pyx_v_K;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_j = __pyx_t_20;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":411
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_22 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":414
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 */
      __pyx_t_17 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_17) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":415
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val
 */
        __pyx_t_23 = __pyx_v_b;
        __pyx_t_24 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_23, __pyx_bstride_0_nobs, __pyx_t_24, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":416
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:             # <<<<<<<<<<<<<<
 *                     resx[b, j] = val
 * 
 */
        __pyx_t_25 = __pyx_v_b;
        __pyx_t_26 = __pyx_v_j;
        __pyx_t_17 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_25, __pyx_bstride_0_nobs, __pyx_t_26, __pyx_bstride_1_nobs)) == __pyx_v_rank);
        if (__pyx_t_17) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":417
 *                 nobs[b, j] += 1
 *                 if nobs[b, j] == rank:
 *                     resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_27 = __pyx_v_b;
          __pyx_t_28 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_resx.buf, __pyx_t_27, __pyx_bstride_0_resx, __pyx_t_28, __pyx_bstride_1_resx) = __pyx_v_val;
          goto __pyx_L16;
        }
        __pyx_L16:;
        goto __pyx_L15;
      }
      __pyx_L15:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":419
 *                     resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_9 = __pyx_v_ngroups;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":420
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_19 = __pyx_v_K;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_j = __pyx_t_20;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":421
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_30 = __pyx_v_j;
      __pyx_t_17 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_29, __pyx_bstride_0_nobs, __pyx_t_30, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_17) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":422
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_31 = __pyx_v_i;
        __pyx_t_32 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_31, __pyx_bstride_0_out, __pyx_t_32, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L21;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":424
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_34 = __pyx_v_j;
        __pyx_t_35 = __pyx_v_i;
        __pyx_t_36 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_35, __pyx_bstride_0_out, __pyx_t_36, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_resx.buf, __pyx_t_33, __pyx_bstride_0_resx, __pyx_t_34, __pyx_bstride_1_resx));
      }
      __pyx_L21:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_nth_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":428
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_69group_last(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_69group_last[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_69group_last = {__Pyx_NAMESTR("group_last"), (PyCFunction)__pyx_pf_6pandas_3lib_69group_last, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_69group_last)};
static PyObject *__pyx_pf_6pandas_3lib_69group_last(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_resx;
  Py_ssize_t __pyx_bstride_0_resx = 0;
  Py_ssize_t __pyx_bstride_1_resx = 0;
  Py_ssize_t __pyx_bshape_0_resx = 0;
  Py_ssize_t __pyx_bshape_1_resx = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("group_last");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_last") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_last", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_last", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_resx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":441
 *         ndarray[int64_t, ndim=2] nobs
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_out), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":442
 * 
 *     nobs = np.zeros((<object> out).shape, dtype=np.int64)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_resx, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_resx, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_resx = __pyx_bstruct_resx.strides[0]; __pyx_bstride_1_resx = __pyx_bstruct_resx.strides[1];
    __pyx_bshape_0_resx = __pyx_bstruct_resx.shape[0]; __pyx_bshape_1_resx = __pyx_bstruct_resx.shape[1];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":444
 *     resx = np.empty_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     for i in range(N):
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_1 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_13;
  __pyx_v_K = __pyx_t_14;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":446
 *     N, K = (<object> values).shape
 * 
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if lab < 0:
 */
  __pyx_t_14 = __pyx_v_N;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":447
 * 
 *     for i in range(N):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if lab < 0:
 *             continue
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_15, __pyx_bstride_0_labels));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":448
 *     for i in range(N):
 *         lab = labels[i]
 *         if lab < 0:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_16 = (__pyx_v_lab < 0);
    if (__pyx_t_16) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":449
 *         lab = labels[i]
 *         if lab < 0:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         counts[lab] += 1
 */
      goto __pyx_L8_continue;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":451
 *             continue
 * 
 *         counts[lab] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_17 = __pyx_v_lab;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) += 1;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":452
 * 
 *         counts[lab] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_18 = __pyx_v_K;
    for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
      __pyx_v_j = __pyx_t_19;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":453
 *         counts[lab] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_21 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_20, __pyx_bstride_0_values, __pyx_t_21, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":456
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, j] += 1
 *                 resx[lab, j] = val
 */
      __pyx_t_16 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":457
 *             # not nan
 *             if val == val:
 *                 nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                 resx[lab, j] = val
 * 
 */
        __pyx_t_22 = __pyx_v_lab;
        __pyx_t_23 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_nobs.buf, __pyx_t_22, __pyx_bstride_0_nobs, __pyx_t_23, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":458
 *             if val == val:
 *                 nobs[lab, j] += 1
 *                 resx[lab, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
        __pyx_t_24 = __pyx_v_lab;
        __pyx_t_25 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_resx.buf, __pyx_t_24, __pyx_bstride_0_resx, __pyx_t_25, __pyx_bstride_1_resx) = __pyx_v_val;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }
    __pyx_L8_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":460
 *                 resx[lab, j] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_14 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":461
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_18 = __pyx_v_K;
    for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
      __pyx_v_j = __pyx_t_19;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":462
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_27 = __pyx_v_j;
      __pyx_t_16 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_nobs.buf, __pyx_t_26, __pyx_bstride_0_nobs, __pyx_t_27, __pyx_bstride_1_nobs)) == 0);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":463
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_28 = __pyx_v_i;
        __pyx_t_29 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_28, __pyx_bstride_0_out, __pyx_t_29, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L18;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":465
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_30 = __pyx_v_i;
        __pyx_t_31 = __pyx_v_j;
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_33 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_32, __pyx_bstride_0_out, __pyx_t_33, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_resx.buf, __pyx_t_30, __pyx_bstride_0_resx, __pyx_t_31, __pyx_bstride_1_resx));
      }
      __pyx_L18:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_last", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":470
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_70group_last_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_70group_last_bin[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_70group_last_bin = {__Pyx_NAMESTR("group_last_bin"), (PyCFunction)__pyx_pf_6pandas_3lib_70group_last_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_70group_last_bin)};
static PyObject *__pyx_pf_6pandas_3lib_70group_last_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_resx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_resx;
  Py_ssize_t __pyx_bstride_0_resx = 0;
  Py_ssize_t __pyx_bstride_1_resx = 0;
  Py_ssize_t __pyx_bshape_0_resx = 0;
  Py_ssize_t __pyx_bshape_1_resx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,0};
  __Pyx_RefNannySetupContext("group_last_bin");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_last_bin", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_last_bin") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_last_bin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_last_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_resx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":482
 *         ndarray[float64_t, ndim=2] resx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     resx = np.empty_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":483
 * 
 *     nobs = np.zeros_like(out)
 *     resx = np.empty_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_resx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_resx, (PyObject*)__pyx_v_resx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_resx = __pyx_bstruct_resx.strides[0]; __pyx_bstride_1_resx = __pyx_bstruct_resx.strides[1];
    __pyx_bshape_0_resx = __pyx_bstruct_resx.shape[0]; __pyx_bshape_1_resx = __pyx_bstruct_resx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_resx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":485
 *     resx = np.empty_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_10, __pyx_bstride_0_bins)) == __pyx_t_11);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":486
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":488
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":490
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":492
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":493
 * 
 *     b = 0
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1
 */
  __pyx_t_9 = __pyx_v_N;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":494
 *     b = 0
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *             b += 1
 * 
 */
    while (1) {
      __pyx_t_12 = (__pyx_v_b < (__pyx_v_ngroups - 1));
      if (__pyx_t_12) {
        __pyx_t_15 = __pyx_v_b;
        __pyx_t_16 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_15, __pyx_bstride_0_bins)));
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_12;
      }
      if (!__pyx_t_17) break;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":495
 *     for i in range(N):
 *         while b < ngroups - 1 and i >= bins[b]:
 *             b += 1             # <<<<<<<<<<<<<<
 * 
 *         counts[b] += 1
 */
      __pyx_v_b = (__pyx_v_b + 1);
    }

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":497
 *             b += 1
 * 
 *         counts[b] += 1             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             val = values[i, j]
 */
    __pyx_t_18 = __pyx_v_b;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) += 1;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":498
 * 
 *         counts[b] += 1
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 * 
 */
    __pyx_t_19 = __pyx_v_K;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_j = __pyx_t_20;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":499
 *         counts[b] += 1
 *         for j in range(K):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_22 = __pyx_v_j;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":502
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val
 */
      __pyx_t_17 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_17) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":503
 *             # not nan
 *             if val == val:
 *                 nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                 resx[b, j] = val
 * 
 */
        __pyx_t_23 = __pyx_v_b;
        __pyx_t_24 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_23, __pyx_bstride_0_nobs, __pyx_t_24, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":504
 *             if val == val:
 *                 nobs[b, j] += 1
 *                 resx[b, j] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_25 = __pyx_v_b;
        __pyx_t_26 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_resx.buf, __pyx_t_25, __pyx_bstride_0_resx, __pyx_t_26, __pyx_bstride_1_resx) = __pyx_v_val;
        goto __pyx_L15;
      }
      __pyx_L15:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":506
 *                 resx[b, j] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_9 = __pyx_v_ngroups;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":507
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_19 = __pyx_v_K;
    for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
      __pyx_v_j = __pyx_t_20;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":508
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = __pyx_v_j;
      __pyx_t_17 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_27, __pyx_bstride_0_nobs, __pyx_t_28, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_17) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":509
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = resx[i, j]
 */
        __pyx_t_29 = __pyx_v_i;
        __pyx_t_30 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_29, __pyx_bstride_0_out, __pyx_t_30, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L20;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":511
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = resx[i, j]             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
        __pyx_t_31 = __pyx_v_i;
        __pyx_t_32 = __pyx_v_j;
        __pyx_t_33 = __pyx_v_i;
        __pyx_t_34 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_33, __pyx_bstride_0_out, __pyx_t_34, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_resx.buf, __pyx_t_31, __pyx_bstride_0_resx, __pyx_t_32, __pyx_bstride_1_resx));
      }
      __pyx_L20:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_last_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_resx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_resx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":519
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_min(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_71group_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_71group_min[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_71group_min = {__Pyx_NAMESTR("group_min"), (PyCFunction)__pyx_pf_6pandas_3lib_71group_min, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_71group_min)};
static PyObject *__pyx_pf_6pandas_3lib_71group_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_minx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_minx;
  Py_ssize_t __pyx_bstride_0_minx = 0;
  Py_ssize_t __pyx_bstride_1_minx = 0;
  Py_ssize_t __pyx_bshape_0_minx = 0;
  Py_ssize_t __pyx_bshape_1_minx = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  long __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  long __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  long __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  long __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("group_min");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_min") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_min", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_minx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":531
 *         ndarray[float64_t, ndim=2] minx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":533
 *     nobs = np.zeros_like(out)
 * 
 *     minx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     minx.fill(np.inf)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_minx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_minx, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_minx = __pyx_bstruct_minx.strides[0]; __pyx_bstride_1_minx = __pyx_bstruct_minx.strides[1];
    __pyx_bshape_0_minx = __pyx_bstruct_minx.shape[0]; __pyx_bshape_1_minx = __pyx_bstruct_minx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":534
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_minx), __pyx_n_s__fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":536
 *     minx.fill(np.inf)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":538
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_13 = (__pyx_v_K > 1);
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":539
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":540
 *     if K > 1:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_14, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":541
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":542
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L9_continue;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":544
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_15 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":545
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_16 = __pyx_v_K;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_j = __pyx_t_17;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":546
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":549
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:
 */
        __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":550
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     if val < minx[lab, j]:
 *                         minx[lab, j] = val
 */
          __pyx_t_20 = __pyx_v_lab;
          __pyx_t_21 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_20, __pyx_bstride_0_nobs, __pyx_t_21, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":551
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:             # <<<<<<<<<<<<<<
 *                         minx[lab, j] = val
 *     else:
 */
          __pyx_t_22 = __pyx_v_lab;
          __pyx_t_23 = __pyx_v_j;
          __pyx_t_13 = (__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_22, __pyx_bstride_0_minx, __pyx_t_23, __pyx_bstride_1_minx)));
          if (__pyx_t_13) {

            /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":552
 *                     nobs[lab, j] += 1
 *                     if val < minx[lab, j]:
 *                         minx[lab, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_24 = __pyx_v_lab;
            __pyx_t_25 = __pyx_v_j;
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_24, __pyx_bstride_0_minx, __pyx_t_25, __pyx_bstride_1_minx) = __pyx_v_val;
            goto __pyx_L15;
          }
          __pyx_L15:;
          goto __pyx_L14;
        }
        __pyx_L14:;
      }
      __pyx_L9_continue:;
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":554
 *                         minx[lab, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":555
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":556
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":557
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L16_continue;
        goto __pyx_L18;
      }
      __pyx_L18:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":559
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":560
 * 
 *             counts[lab] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_27 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_26, __pyx_bstride_0_values, __pyx_t_27, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":563
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":564
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val < minx[lab, 0]:
 *                     minx[lab, 0] = val
 */
        __pyx_t_28 = __pyx_v_lab;
        __pyx_t_29 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_28, __pyx_bstride_0_nobs, __pyx_t_29, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":565
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:             # <<<<<<<<<<<<<<
 *                     minx[lab, 0] = val
 * 
 */
        __pyx_t_30 = __pyx_v_lab;
        __pyx_t_31 = 0;
        __pyx_t_13 = (__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_30, __pyx_bstride_0_minx, __pyx_t_31, __pyx_bstride_1_minx)));
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":566
 *                 nobs[lab, 0] += 1
 *                 if val < minx[lab, 0]:
 *                     minx[lab, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
          __pyx_t_32 = __pyx_v_lab;
          __pyx_t_33 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_32, __pyx_bstride_0_minx, __pyx_t_33, __pyx_bstride_1_minx) = __pyx_v_val;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }
      __pyx_L19:;
      __pyx_L16_continue:;
    }
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":568
 *                     minx[lab, 0] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":569
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_34 = __pyx_v_K;
    for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
      __pyx_v_j = __pyx_t_35;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":570
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_t_37 = __pyx_v_j;
      __pyx_t_13 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_36, __pyx_bstride_0_nobs, __pyx_t_37, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":571
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = minx[i, j]
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_38, __pyx_bstride_0_out, __pyx_t_39, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L25;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":573
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        __pyx_t_42 = __pyx_v_i;
        __pyx_t_43 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_42, __pyx_bstride_0_out, __pyx_t_43, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_40, __pyx_bstride_0_minx, __pyx_t_41, __pyx_bstride_1_minx));
      }
      __pyx_L25:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_minx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":578
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_max(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_72group_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_72group_max[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_72group_max = {__Pyx_NAMESTR("group_max"), (PyCFunction)__pyx_pf_6pandas_3lib_72group_max, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_72group_max)};
static PyObject *__pyx_pf_6pandas_3lib_72group_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_maxx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_maxx;
  Py_ssize_t __pyx_bstride_0_maxx = 0;
  Py_ssize_t __pyx_bstride_1_maxx = 0;
  Py_ssize_t __pyx_bshape_0_maxx = 0;
  Py_ssize_t __pyx_bshape_1_maxx = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  long __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  long __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  long __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  long __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("group_max");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_max") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_max", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_maxx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":590
 *         ndarray[float64_t, ndim=2] maxx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     maxx = np.empty_like(out)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":592
 *     nobs = np.zeros_like(out)
 * 
 *     maxx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     maxx.fill(-np.inf)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_maxx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_maxx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_maxx, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_maxx = __pyx_bstruct_maxx.strides[0]; __pyx_bstride_1_maxx = __pyx_bstruct_maxx.strides[1];
    __pyx_bshape_0_maxx = __pyx_bstruct_maxx.shape[0]; __pyx_bshape_1_maxx = __pyx_bstruct_maxx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":593
 * 
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_maxx), __pyx_n_s__fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":595
 *     maxx.fill(-np.inf)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":597
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_13 = (__pyx_v_K > 1);
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":598
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":599
 *     if K > 1:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_14, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":600
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":601
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L9_continue;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":603
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_15 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":604
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_16 = __pyx_v_K;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_j = __pyx_t_17;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":605
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":608
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:
 */
        __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":609
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     if val > maxx[lab, j]:
 *                         maxx[lab, j] = val
 */
          __pyx_t_20 = __pyx_v_lab;
          __pyx_t_21 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_20, __pyx_bstride_0_nobs, __pyx_t_21, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":610
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:             # <<<<<<<<<<<<<<
 *                         maxx[lab, j] = val
 *     else:
 */
          __pyx_t_22 = __pyx_v_lab;
          __pyx_t_23 = __pyx_v_j;
          __pyx_t_13 = (__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_22, __pyx_bstride_0_maxx, __pyx_t_23, __pyx_bstride_1_maxx)));
          if (__pyx_t_13) {

            /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":611
 *                     nobs[lab, j] += 1
 *                     if val > maxx[lab, j]:
 *                         maxx[lab, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_24 = __pyx_v_lab;
            __pyx_t_25 = __pyx_v_j;
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_24, __pyx_bstride_0_maxx, __pyx_t_25, __pyx_bstride_1_maxx) = __pyx_v_val;
            goto __pyx_L15;
          }
          __pyx_L15:;
          goto __pyx_L14;
        }
        __pyx_L14:;
      }
      __pyx_L9_continue:;
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":613
 *                         maxx[lab, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":614
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":615
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":616
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L16_continue;
        goto __pyx_L18;
      }
      __pyx_L18:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":618
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":619
 * 
 *             counts[lab] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_27 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_26, __pyx_bstride_0_values, __pyx_t_27, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":622
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":623
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val > maxx[lab, 0]:
 *                     maxx[lab, 0] = val
 */
        __pyx_t_28 = __pyx_v_lab;
        __pyx_t_29 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_28, __pyx_bstride_0_nobs, __pyx_t_29, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":624
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:             # <<<<<<<<<<<<<<
 *                     maxx[lab, 0] = val
 * 
 */
        __pyx_t_30 = __pyx_v_lab;
        __pyx_t_31 = 0;
        __pyx_t_13 = (__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_30, __pyx_bstride_0_maxx, __pyx_t_31, __pyx_bstride_1_maxx)));
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":625
 *                 nobs[lab, 0] += 1
 *                 if val > maxx[lab, 0]:
 *                     maxx[lab, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
          __pyx_t_32 = __pyx_v_lab;
          __pyx_t_33 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_32, __pyx_bstride_0_maxx, __pyx_t_33, __pyx_bstride_1_maxx) = __pyx_v_val;
          goto __pyx_L20;
        }
        __pyx_L20:;
        goto __pyx_L19;
      }
      __pyx_L19:;
      __pyx_L16_continue:;
    }
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":627
 *                     maxx[lab, 0] = val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":628
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_34 = __pyx_v_K;
    for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
      __pyx_v_j = __pyx_t_35;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":629
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_t_37 = __pyx_v_j;
      __pyx_t_13 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_36, __pyx_bstride_0_nobs, __pyx_t_37, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":630
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = maxx[i, j]
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_38, __pyx_bstride_0_out, __pyx_t_39, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L25;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":632
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        __pyx_t_42 = __pyx_v_i;
        __pyx_t_43 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_42, __pyx_bstride_0_out, __pyx_t_43, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_40, __pyx_bstride_0_maxx, __pyx_t_41, __pyx_bstride_1_maxx));
      }
      __pyx_L25:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_maxx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_maxx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_maxx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":637
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_mean(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_73group_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_73group_mean = {__Pyx_NAMESTR("group_mean"), (PyCFunction)__pyx_pf_6pandas_3lib_73group_mean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_73group_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_count;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_sumx;
  Py_ssize_t __pyx_bstride_0_sumx = 0;
  Py_ssize_t __pyx_bstride_1_sumx = 0;
  Py_ssize_t __pyx_bshape_0_sumx = 0;
  Py_ssize_t __pyx_bshape_1_sumx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  long __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  long __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  long __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  __pyx_t_5numpy_float64_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("group_mean");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_mean") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_mean", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_mean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_sumx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":646
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":647
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_sumx = __pyx_bstruct_sumx.strides[0]; __pyx_bstride_1_sumx = __pyx_bstruct_sumx.strides[1];
    __pyx_bshape_0_sumx = __pyx_bstruct_sumx.shape[0]; __pyx_bshape_1_sumx = __pyx_bstruct_sumx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":649
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":651
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             lab = labels[i]
 */
  __pyx_t_13 = (__pyx_v_K > 1);
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":652
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":653
 *     if K > 1:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_14, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":654
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":655
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L9_continue;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":657
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_15 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":658
 * 
 *             counts[lab] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 *                 # not nan
 */
      __pyx_t_16 = __pyx_v_K;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_j = __pyx_t_17;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":659
 *             counts[lab] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 *                 # not nan
 *                 if val == val:
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":661
 *                 val = values[i, j]
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":662
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[lab, j] += val
 *     else:
 */
          __pyx_t_20 = __pyx_v_lab;
          __pyx_t_21 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_20, __pyx_bstride_0_nobs, __pyx_t_21, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":663
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_22 = __pyx_v_lab;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_22, __pyx_bstride_0_sumx, __pyx_t_23, __pyx_bstride_1_sumx) += __pyx_v_val;
          goto __pyx_L14;
        }
        __pyx_L14:;
      }
      __pyx_L9_continue:;
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":665
 *                     sumx[lab, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             lab = labels[i]
 *             if lab < 0:
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":666
 *     else:
 *         for i in range(N):
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":667
 *         for i in range(N):
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":668
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L15_continue;
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":670
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":671
 * 
 *             counts[lab] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 *             # not nan
 *             if val == val:
 */
      __pyx_t_24 = __pyx_v_i;
      __pyx_t_25 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_24, __pyx_bstride_0_values, __pyx_t_25, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":673
 *             val = values[i, 0]
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":674
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[lab, 0] += val
 * 
 */
        __pyx_t_26 = __pyx_v_lab;
        __pyx_t_27 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_26, __pyx_bstride_0_nobs, __pyx_t_27, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":675
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(len(counts)):
 */
        __pyx_t_28 = __pyx_v_lab;
        __pyx_t_29 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_28, __pyx_bstride_0_sumx, __pyx_t_29, __pyx_bstride_1_sumx) += __pyx_v_val;
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_L15_continue:;
    }
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":677
 *                 sumx[lab, 0] += val
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             count = nobs[i, j]
 */
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":678
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             count = nobs[i, j]
 *             if nobs[i, j] == 0:
 */
    __pyx_t_30 = __pyx_v_K;
    for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
      __pyx_v_j = __pyx_t_31;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":679
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             count = nobs[i, j]             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
      __pyx_t_32 = __pyx_v_i;
      __pyx_t_33 = __pyx_v_j;
      __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_32, __pyx_bstride_0_nobs, __pyx_t_33, __pyx_bstride_1_nobs));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":680
 *         for j in range(K):
 *             count = nobs[i, j]
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_34 = __pyx_v_i;
      __pyx_t_35 = __pyx_v_j;
      __pyx_t_13 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_34, __pyx_bstride_0_nobs, __pyx_t_35, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":681
 *             count = nobs[i, j]
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = sumx[i, j] / count
 */
        __pyx_t_36 = __pyx_v_i;
        __pyx_t_37 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_36, __pyx_bstride_0_out, __pyx_t_37, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":683
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j] / count             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        __pyx_t_40 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_38, __pyx_bstride_0_sumx, __pyx_t_39, __pyx_bstride_1_sumx));
        if (unlikely(__pyx_v_count == 0)) {
          PyErr_Format(PyExc_ZeroDivisionError, "float division");
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_41, __pyx_bstride_0_out, __pyx_t_42, __pyx_bstride_1_out) = (__pyx_t_40 / __pyx_v_count);
      }
      __pyx_L23:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_mean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":686
 * 
 * 
 * def group_median(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                  ndarray[int64_t] counts,
 *                  ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_74group_median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_74group_median[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_74group_median = {__Pyx_NAMESTR("group_median"), (PyCFunction)__pyx_pf_6pandas_3lib_74group_median, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_74group_median)};
static PyObject *__pyx_pf_6pandas_3lib_74group_median(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_size;
  PyArrayObject *__pyx_v__counts = 0;
  PyArrayObject *__pyx_v_data = 0;
  __pyx_t_5numpy_float64_t *__pyx_v_ptr;
  PyObject *__pyx_v_take_2d_axis1_float64 = NULL;
  PyObject *__pyx_v_indexer = NULL;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct__counts;
  Py_ssize_t __pyx_bstride_0__counts = 0;
  Py_ssize_t __pyx_bshape_0__counts = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  long __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("group_median");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_median") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_median", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct__counts.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":699
 *         float64_t* ptr
 * 
 *     from pandas._algos import take_2d_axis1_float64             # <<<<<<<<<<<<<<
 * 
 *     ngroups = len(counts)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s_80));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s_80));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_80));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_79), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s_80); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_take_2d_axis1_float64 = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":701
 *     from pandas._algos import take_2d_axis1_float64
 * 
 *     ngroups = len(counts)             # <<<<<<<<<<<<<<
 *     N, K = (<object> values).shape
 * 
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ngroups = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":702
 * 
 *     ngroups = len(counts)
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_3;
  __pyx_v_K = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":704
 *     N, K = (<object> values).shape
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)             # <<<<<<<<<<<<<<
 *     counts[:] = _counts[1:]
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_labels));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_labels));
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_unpacking_done;
    __pyx_L8_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L9_unpacking_done:;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_indexer = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct__counts);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct__counts, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct__counts, (PyObject*)__pyx_v__counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0__counts = __pyx_bstruct__counts.strides[0];
    __pyx_bshape_0__counts = __pyx_bstruct__counts.shape[0];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v__counts = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":705
 * 
 *     indexer, _counts = groupsort_indexer(labels, ngroups)
 *     counts[:] = _counts[1:]             # <<<<<<<<<<<<<<
 * 
 *     data = np.empty((K, N), dtype=np.float64)
 */
  __pyx_t_4 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v__counts), 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PySequence_SetSlice(((PyObject *)__pyx_v_counts), 0, PY_SSIZE_T_MAX, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":707
 *     counts[:] = _counts[1:]
 * 
 *     data = np.empty((K, N), dtype=np.float64)             # <<<<<<<<<<<<<<
 *     ptr = <float64_t*> data.data
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_data = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":708
 * 
 *     data = np.empty((K, N), dtype=np.float64)
 *     ptr = <float64_t*> data.data             # <<<<<<<<<<<<<<
 * 
 *     take_2d_axis1_float64(values.T, indexer, out=data)
 */
  __pyx_v_ptr = ((__pyx_t_5numpy_float64_t *)__pyx_v_data->data);

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":710
 *     ptr = <float64_t*> data.data
 * 
 *     take_2d_axis1_float64(values.T, indexer, out=data)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(K):
 */
  __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__T); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __Pyx_INCREF(__pyx_v_indexer);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_indexer);
  __Pyx_GIVEREF(__pyx_v_indexer);
  __pyx_t_13 = 0;
  __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_13));
  if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__out), ((PyObject *)__pyx_v_data)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_v_take_2d_axis1_float64, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":712
 *     take_2d_axis1_float64(values.T, indexer, out=data)
 * 
 *     for i in range(K):             # <<<<<<<<<<<<<<
 *         # exclude NA group
 *         ptr += _counts[0]
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_7; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":714
 *     for i in range(K):
 *         # exclude NA group
 *         ptr += _counts[0]             # <<<<<<<<<<<<<<
 *         for j in range(ngroups):
 *             size = _counts[j + 1]
 */
    __pyx_t_14 = 0;
    __pyx_t_9 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0__counts;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0__counts)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_ptr = (__pyx_v_ptr + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct__counts.buf, __pyx_t_14, __pyx_bstride_0__counts)));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":715
 *         # exclude NA group
 *         ptr += _counts[0]
 *         for j in range(ngroups):             # <<<<<<<<<<<<<<
 *             size = _counts[j + 1]
 *             out[j, i] = _median_linear(ptr, size)
 */
    __pyx_t_15 = __pyx_v_ngroups;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_j = __pyx_t_16;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":716
 *         ptr += _counts[0]
 *         for j in range(ngroups):
 *             size = _counts[j + 1]             # <<<<<<<<<<<<<<
 *             out[j, i] = _median_linear(ptr, size)
 *             ptr += size
 */
      __pyx_t_17 = (__pyx_v_j + 1);
      __pyx_t_9 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0__counts;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0__counts)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_size = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct__counts.buf, __pyx_t_17, __pyx_bstride_0__counts));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":717
 *         for j in range(ngroups):
 *             size = _counts[j + 1]
 *             out[j, i] = _median_linear(ptr, size)             # <<<<<<<<<<<<<<
 *             ptr += size
 * 
 */
      __pyx_t_18 = __pyx_v_j;
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_out;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_out)) __pyx_t_9 = 0;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_1_out;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_1_out)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_18, __pyx_bstride_0_out, __pyx_t_19, __pyx_bstride_1_out) = __pyx_f_6pandas_3lib__median_linear(__pyx_v_ptr, __pyx_v_size);

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":718
 *             size = _counts[j + 1]
 *             out[j, i] = _median_linear(ptr, size)
 *             ptr += size             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_ptr = (__pyx_v_ptr + __pyx_v_size);
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct__counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct__counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v__counts);
  __Pyx_XDECREF((PyObject *)__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_take_2d_axis1_float64);
  __Pyx_XDECREF(__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":721
 * 
 * 
 * cdef inline float64_t _median_linear(float64_t* a, int n):             # <<<<<<<<<<<<<<
 *     cdef int i, j, na_count = 0
 *     cdef float64_t result
 */

static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_6pandas_3lib__median_linear(__pyx_t_5numpy_float64_t *__pyx_v_a, int __pyx_v_n) {
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_na_count;
  __pyx_t_5numpy_float64_t __pyx_v_result;
  __pyx_t_5numpy_float64_t *__pyx_v_tmp;
  __pyx_t_5numpy_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_5numpy_float64_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_median_linear");

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":722
 * 
 * cdef inline float64_t _median_linear(float64_t* a, int n):
 *     cdef int i, j, na_count = 0             # <<<<<<<<<<<<<<
 *     cdef float64_t result
 *     cdef float64_t* tmp
 */
  __pyx_v_na_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":727
 * 
 *     # count NAs
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if a[i] != a[i]:
 *             na_count += 1
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":728
 *     # count NAs
 *     for i in range(n):
 *         if a[i] != a[i]:             # <<<<<<<<<<<<<<
 *             na_count += 1
 * 
 */
    __pyx_t_3 = ((__pyx_v_a[__pyx_v_i]) != (__pyx_v_a[__pyx_v_i]));
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":729
 *     for i in range(n):
 *         if a[i] != a[i]:
 *             na_count += 1             # <<<<<<<<<<<<<<
 * 
 *     if na_count:
 */
      __pyx_v_na_count = (__pyx_v_na_count + 1);
      goto __pyx_L5;
    }
    __pyx_L5:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":731
 *             na_count += 1
 * 
 *     if na_count:             # <<<<<<<<<<<<<<
 *         if na_count == n:
 *             return NaN
 */
  if (__pyx_v_na_count) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":732
 * 
 *     if na_count:
 *         if na_count == n:             # <<<<<<<<<<<<<<
 *             return NaN
 * 
 */
    __pyx_t_3 = (__pyx_v_na_count == __pyx_v_n);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":733
 *     if na_count:
 *         if na_count == n:
 *             return NaN             # <<<<<<<<<<<<<<
 * 
 *         tmp = <float64_t*> malloc((n - na_count) * sizeof(float64_t))
 */
      __pyx_r = __pyx_v_6pandas_3lib_NaN;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":735
 *             return NaN
 * 
 *         tmp = <float64_t*> malloc((n - na_count) * sizeof(float64_t))             # <<<<<<<<<<<<<<
 * 
 *         j = 0
 */
    __pyx_v_tmp = ((__pyx_t_5numpy_float64_t *)malloc(((__pyx_v_n - __pyx_v_na_count) * (sizeof(__pyx_t_5numpy_float64_t)))));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":737
 *         tmp = <float64_t*> malloc((n - na_count) * sizeof(float64_t))
 * 
 *         j = 0             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             if a[i] == a[i]:
 */
    __pyx_v_j = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":738
 * 
 *         j = 0
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             if a[i] == a[i]:
 *                 tmp[j] = a[i]
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":739
 *         j = 0
 *         for i in range(n):
 *             if a[i] == a[i]:             # <<<<<<<<<<<<<<
 *                 tmp[j] = a[i]
 *                 j += 1
 */
      __pyx_t_3 = ((__pyx_v_a[__pyx_v_i]) == (__pyx_v_a[__pyx_v_i]));
      if (__pyx_t_3) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":740
 *         for i in range(n):
 *             if a[i] == a[i]:
 *                 tmp[j] = a[i]             # <<<<<<<<<<<<<<
 *                 j += 1
 * 
 */
        (__pyx_v_tmp[__pyx_v_j]) = (__pyx_v_a[__pyx_v_i]);

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":741
 *             if a[i] == a[i]:
 *                 tmp[j] = a[i]
 *                 j += 1             # <<<<<<<<<<<<<<
 * 
 *         a = tmp
 */
        __pyx_v_j = (__pyx_v_j + 1);
        goto __pyx_L10;
      }
      __pyx_L10:;
    }

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":743
 *                 j += 1
 * 
 *         a = tmp             # <<<<<<<<<<<<<<
 *         n -= na_count
 * 
 */
    __pyx_v_a = __pyx_v_tmp;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":744
 * 
 *         a = tmp
 *         n -= na_count             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_n = (__pyx_v_n - __pyx_v_na_count);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":747
 * 
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         result = kth_smallest_c(a, n / 2, n)
 *     else:
 */
  __pyx_t_4 = __Pyx_mod_long(__pyx_v_n, 2);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":748
 * 
 *     if n % 2:
 *         result = kth_smallest_c(a, n / 2, n)             # <<<<<<<<<<<<<<
 *     else:
 *         result = (kth_smallest_c(a, n / 2, n) +
 */
    __pyx_t_5 = __pyx_f_6pandas_3lib_kth_smallest_c(__pyx_v_a, __Pyx_div_long(__pyx_v_n, 2), __pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_result = __pyx_t_6;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":750
 *         result = kth_smallest_c(a, n / 2, n)
 *     else:
 *         result = (kth_smallest_c(a, n / 2, n) +             # <<<<<<<<<<<<<<
 *                   kth_smallest_c(a, n / 2 - 1, n)) / 2
 * 
 */
    __pyx_t_5 = __pyx_f_6pandas_3lib_kth_smallest_c(__pyx_v_a, __Pyx_div_long(__pyx_v_n, 2), __pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":751
 *     else:
 *         result = (kth_smallest_c(a, n / 2, n) +
 *                   kth_smallest_c(a, n / 2 - 1, n)) / 2             # <<<<<<<<<<<<<<
 * 
 *     if na_count:
 */
    __pyx_t_7 = __pyx_f_6pandas_3lib_kth_smallest_c(__pyx_v_a, (__Pyx_div_long(__pyx_v_n, 2) - 1), __pyx_v_n); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_int_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_6 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_v_result = __pyx_t_6;
  }
  __pyx_L11:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":753
 *                   kth_smallest_c(a, n / 2 - 1, n)) / 2
 * 
 *     if na_count:             # <<<<<<<<<<<<<<
 *         free(a)
 * 
 */
  if (__pyx_v_na_count) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":754
 * 
 *     if na_count:
 *         free(a)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    free(__pyx_v_a);
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":756
 *         free(a)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("pandas.lib._median_linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":761
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_var(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_75group_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_75group_var = {__Pyx_NAMESTR("group_var"), (PyCFunction)__pyx_pf_6pandas_3lib_75group_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_75group_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_lab;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_ct;
  PyArrayObject *__pyx_v_nobs = 0;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_sumxx = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_sumx;
  Py_ssize_t __pyx_bstride_0_sumx = 0;
  Py_ssize_t __pyx_bstride_1_sumx = 0;
  Py_ssize_t __pyx_bshape_0_sumx = 0;
  Py_ssize_t __pyx_bshape_1_sumx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_sumxx;
  Py_ssize_t __pyx_bstride_0_sumxx = 0;
  Py_ssize_t __pyx_bstride_1_sumxx = 0;
  Py_ssize_t __pyx_bshape_0_sumxx = 0;
  Py_ssize_t __pyx_bshape_1_sumxx = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  long __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  long __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  long __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  long __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  __pyx_t_5numpy_float64_t __pyx_t_46;
  __pyx_t_5numpy_float64_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("group_var");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_var") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_labels = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_var", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_sumx.buf = NULL;
  __pyx_bstruct_sumxx.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":770
 *         ndarray[float64_t, ndim=2] nobs, sumx, sumxx
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":771
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumxx = np.zeros_like(out)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_sumx = __pyx_bstruct_sumx.strides[0]; __pyx_bstride_1_sumx = __pyx_bstruct_sumx.strides[1];
    __pyx_bshape_0_sumx = __pyx_bstruct_sumx.shape[0]; __pyx_bshape_1_sumx = __pyx_bstruct_sumx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":772
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumxx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sumxx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sumxx, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_sumxx = __pyx_bstruct_sumxx.strides[0]; __pyx_bstride_1_sumxx = __pyx_bstruct_sumxx.strides[1];
    __pyx_bshape_0_sumxx = __pyx_bstruct_sumxx.shape[0]; __pyx_bshape_1_sumxx = __pyx_bstruct_sumxx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":774
 *     sumxx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if K > 1:
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":776
 *     N, K = (<object> values).shape
 * 
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 * 
 */
  __pyx_t_13 = (__pyx_v_K > 1);
  if (__pyx_t_13) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":777
 * 
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 * 
 *             lab = labels[i]
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":779
 *         for i in range(N):
 * 
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_14, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":780
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":781
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L9_continue;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":783
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 * 
 *             for j in range(K):
 */
      __pyx_t_15 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":785
 *             counts[lab] += 1
 * 
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_16 = __pyx_v_K;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_j = __pyx_t_17;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":786
 * 
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":789
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 */
        __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":790
 *                 # not nan
 *                 if val == val:
 *                     nobs[lab, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[lab, j] += val
 *                     sumxx[lab, j] += val * val
 */
          __pyx_t_20 = __pyx_v_lab;
          __pyx_t_21 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_20, __pyx_bstride_0_nobs, __pyx_t_21, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":791
 *                 if val == val:
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val             # <<<<<<<<<<<<<<
 *                     sumxx[lab, j] += val * val
 *     else:
 */
          __pyx_t_22 = __pyx_v_lab;
          __pyx_t_23 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_22, __pyx_bstride_0_sumx, __pyx_t_23, __pyx_bstride_1_sumx) += __pyx_v_val;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":792
 *                     nobs[lab, j] += 1
 *                     sumx[lab, j] += val
 *                     sumxx[lab, j] += val * val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_24 = __pyx_v_lab;
          __pyx_t_25 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumxx.buf, __pyx_t_24, __pyx_bstride_0_sumxx, __pyx_t_25, __pyx_bstride_1_sumxx) += (__pyx_v_val * __pyx_v_val);
          goto __pyx_L14;
        }
        __pyx_L14:;
      }
      __pyx_L9_continue:;
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":794
 *                     sumxx[lab, j] += val * val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 * 
 *             lab = labels[i]
 */
    __pyx_t_12 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":796
 *         for i in range(N):
 * 
 *             lab = labels[i]             # <<<<<<<<<<<<<<
 *             if lab < 0:
 *                 continue
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":797
 * 
 *             lab = labels[i]
 *             if lab < 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      __pyx_t_13 = (__pyx_v_lab < 0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":798
 *             lab = labels[i]
 *             if lab < 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             counts[lab] += 1
 */
        goto __pyx_L15_continue;
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":800
 *                 continue
 * 
 *             counts[lab] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 *             # not nan
 */
      __pyx_t_17 = __pyx_v_lab;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":801
 * 
 *             counts[lab] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 *             # not nan
 *             if val == val:
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_27 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_26, __pyx_bstride_0_values, __pyx_t_27, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":803
 *             val = values[i, 0]
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":804
 *             # not nan
 *             if val == val:
 *                 nobs[lab, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[lab, 0] += val
 *                 sumxx[lab, 0] += val * val
 */
        __pyx_t_28 = __pyx_v_lab;
        __pyx_t_29 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_28, __pyx_bstride_0_nobs, __pyx_t_29, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":805
 *             if val == val:
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val             # <<<<<<<<<<<<<<
 *                 sumxx[lab, 0] += val * val
 * 
 */
        __pyx_t_30 = __pyx_v_lab;
        __pyx_t_31 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_30, __pyx_bstride_0_sumx, __pyx_t_31, __pyx_bstride_1_sumx) += __pyx_v_val;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":806
 *                 nobs[lab, 0] += 1
 *                 sumx[lab, 0] += val
 *                 sumxx[lab, 0] += val * val             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_32 = __pyx_v_lab;
        __pyx_t_33 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumxx.buf, __pyx_t_32, __pyx_bstride_0_sumxx, __pyx_t_33, __pyx_bstride_1_sumxx) += (__pyx_v_val * __pyx_v_val);
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_L15_continue:;
    }
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":809
 * 
 * 
 *     for i in range(len(counts)):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             ct = nobs[i, j]
 */
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_counts)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":810
 * 
 *     for i in range(len(counts)):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             ct = nobs[i, j]
 *             if ct < 2:
 */
    __pyx_t_34 = __pyx_v_K;
    for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
      __pyx_v_j = __pyx_t_35;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":811
 *     for i in range(len(counts)):
 *         for j in range(K):
 *             ct = nobs[i, j]             # <<<<<<<<<<<<<<
 *             if ct < 2:
 *                 out[i, j] = nan
 */
      __pyx_t_36 = __pyx_v_i;
      __pyx_t_37 = __pyx_v_j;
      __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_36, __pyx_bstride_0_nobs, __pyx_t_37, __pyx_bstride_1_nobs));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":812
 *         for j in range(K):
 *             ct = nobs[i, j]
 *             if ct < 2:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_13 = (__pyx_v_ct < 2.0);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":813
 *             ct = nobs[i, j]
 *             if ct < 2:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 */
        __pyx_t_38 = __pyx_v_i;
        __pyx_t_39 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_38, __pyx_bstride_0_out, __pyx_t_39, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":815
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * 
 */
        __pyx_t_40 = __pyx_v_i;
        __pyx_t_41 = __pyx_v_j;
        __pyx_t_42 = __pyx_v_i;
        __pyx_t_43 = __pyx_v_j;
        __pyx_t_44 = __pyx_v_i;
        __pyx_t_45 = __pyx_v_j;
        __pyx_t_46 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumxx.buf, __pyx_t_40, __pyx_bstride_0_sumxx, __pyx_t_41, __pyx_bstride_1_sumxx))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_42, __pyx_bstride_0_sumx, __pyx_t_43, __pyx_bstride_1_sumx)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_44, __pyx_bstride_0_sumx, __pyx_t_45, __pyx_bstride_1_sumx))));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":816
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 *                              (ct * ct - ct))             # <<<<<<<<<<<<<<
 * 
 * # TODO: could do even better if we know something about the data. eg, index has
 */
        __pyx_t_47 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct);
        if (unlikely(__pyx_t_47 == 0)) {
          PyErr_Format(PyExc_ZeroDivisionError, "float division");
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":815
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * 
 */
        __pyx_t_48 = __pyx_v_i;
        __pyx_t_49 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_48, __pyx_bstride_0_out, __pyx_t_49, __pyx_bstride_1_out) = (__pyx_t_46 / __pyx_t_47);
      }
      __pyx_L23:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumxx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumxx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_sumxx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":824
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner,             # <<<<<<<<<<<<<<
 *                        object closed='left'):
 *     """
 */

static PyObject *__pyx_pf_6pandas_3lib_76generate_bins_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_76generate_bins_dt64[] = "\n    Int64 (datetime64) version of generic python version in groupby.py\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_76generate_bins_dt64 = {__Pyx_NAMESTR("generate_bins_dt64"), (PyCFunction)__pyx_pf_6pandas_3lib_76generate_bins_dt64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_76generate_bins_dt64)};
static PyObject *__pyx_pf_6pandas_3lib_76generate_bins_dt64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_binner = 0;
  PyObject *__pyx_v_closed = 0;
  Py_ssize_t __pyx_v_lenidx;
  Py_ssize_t __pyx_v_lenbin;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_bc;
  PyArrayObject *__pyx_v_bins = 0;
  __pyx_t_5numpy_int64_t __pyx_v_l_bin;
  __pyx_t_5numpy_int64_t __pyx_v_r_bin;
  int __pyx_v_right_closed;
  Py_buffer __pyx_bstruct_binner;
  Py_ssize_t __pyx_bstride_0_binner = 0;
  Py_ssize_t __pyx_bshape_0_binner = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  long __pyx_t_6;
  long __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  int __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__binner,&__pyx_n_s__closed,0};
  __Pyx_RefNannySetupContext("generate_bins_dt64");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_n_s__left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__binner);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("generate_bins_dt64", 0, 2, 3, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__closed);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "generate_bins_dt64") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_binner = ((PyArrayObject *)values[1]);
    __pyx_v_closed = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("generate_bins_dt64", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.generate_bins_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_bins.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_binner.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_binner), __pyx_ptype_5numpy_ndarray, 1, "binner", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_binner, (PyObject*)__pyx_v_binner, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_binner = __pyx_bstruct_binner.strides[0];
  __pyx_bshape_0_binner = __pyx_bstruct_binner.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":833
 *         ndarray[int64_t] bins
 *         int64_t l_bin, r_bin
 *         bint right_closed = closed == 'right'             # <<<<<<<<<<<<<<
 * 
 *     lenidx = len(values)
 */
  __pyx_t_1 = __Pyx_PyString_Equals(__pyx_v_closed, ((PyObject *)__pyx_n_s__right), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_right_closed = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":835
 *         bint right_closed = closed == 'right'
 * 
 *     lenidx = len(values)             # <<<<<<<<<<<<<<
 *     lenbin = len(binner)
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lenidx = __pyx_t_2;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":836
 * 
 *     lenidx = len(values)
 *     lenbin = len(binner)             # <<<<<<<<<<<<<<
 * 
 *     if lenidx <= 0 or lenbin <= 0:
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_binner)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lenbin = __pyx_t_2;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":838
 *     lenbin = len(binner)
 * 
 *     if lenidx <= 0 or lenbin <= 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("Invalid length for values or for binner")
 * 
 */
  __pyx_t_1 = (__pyx_v_lenidx <= 0);
  if (!__pyx_t_1) {
    __pyx_t_3 = (__pyx_v_lenbin <= 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_1;
  }
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":839
 * 
 *     if lenidx <= 0 or lenbin <= 0:
 *         raise ValueError("Invalid length for values or for binner")             # <<<<<<<<<<<<<<
 * 
 *     # check binner fits data
 */
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_82), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":842
 * 
 *     # check binner fits data
 *     if values[0] < binner[0]:             # <<<<<<<<<<<<<<
 *         raise ValueError("Values falls before first bin")
 * 
 */
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_4 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_6, __pyx_bstride_0_values)) < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_binner.buf, __pyx_t_7, __pyx_bstride_0_binner)));
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":843
 *     # check binner fits data
 *     if values[0] < binner[0]:
 *         raise ValueError("Values falls before first bin")             # <<<<<<<<<<<<<<
 * 
 *     if values[lenidx-1] > binner[lenbin-1]:
 */
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":845
 *         raise ValueError("Values falls before first bin")
 * 
 *     if values[lenidx-1] > binner[lenbin-1]:             # <<<<<<<<<<<<<<
 *         raise ValueError("Values falls after last bin")
 * 
 */
  __pyx_t_2 = (__pyx_v_lenidx - 1);
  __pyx_t_8 = (__pyx_v_lenbin - 1);
  __pyx_t_4 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_2, __pyx_bstride_0_values)) > (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_binner.buf, __pyx_t_8, __pyx_bstride_0_binner)));
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":846
 * 
 *     if values[lenidx-1] > binner[lenbin-1]:
 *         raise ValueError("Values falls after last bin")             # <<<<<<<<<<<<<<
 * 
 *     bins   = np.empty(lenbin - 1, dtype=np.int64)
 */
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_86), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":848
 *         raise ValueError("Values falls after last bin")
 * 
 *     bins   = np.empty(lenbin - 1, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     j  = 0 # index into values
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_lenbin - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__int64); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_9, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_14 < 0)) {
      PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
    }
    __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
    __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];
    if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_bins = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":850
 *     bins   = np.empty(lenbin - 1, dtype=np.int64)
 * 
 *     j  = 0 # index into values             # <<<<<<<<<<<<<<
 *     bc = 0 # bin count
 * 
 */
  __pyx_v_j = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":851
 * 
 *     j  = 0 # index into values
 *     bc = 0 # bin count             # <<<<<<<<<<<<<<
 * 
 *     # linear scan
 */
  __pyx_v_bc = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":854
 * 
 *     # linear scan
 *     for i in range(0, lenbin - 1):             # <<<<<<<<<<<<<<
 *         l_bin = binner[i]
 *         r_bin = binner[i+1]
 */
  __pyx_t_18 = (__pyx_v_lenbin - 1);
  for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
    __pyx_v_i = __pyx_t_19;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":855
 *     # linear scan
 *     for i in range(0, lenbin - 1):
 *         l_bin = binner[i]             # <<<<<<<<<<<<<<
 *         r_bin = binner[i+1]
 * 
 */
    __pyx_t_20 = __pyx_v_i;
    __pyx_v_l_bin = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_binner.buf, __pyx_t_20, __pyx_bstride_0_binner));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":856
 *     for i in range(0, lenbin - 1):
 *         l_bin = binner[i]
 *         r_bin = binner[i+1]             # <<<<<<<<<<<<<<
 * 
 *         # count values in current bin, advance to next bin
 */
    __pyx_t_21 = (__pyx_v_i + 1);
    __pyx_v_r_bin = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_binner.buf, __pyx_t_21, __pyx_bstride_0_binner));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":859
 * 
 *         # count values in current bin, advance to next bin
 *         while j < lenidx and (values[j] < r_bin or             # <<<<<<<<<<<<<<
 *                               (right_closed and values[j] == r_bin)):
 *             j += 1
 */
    while (1) {
      __pyx_t_4 = (__pyx_v_j < __pyx_v_lenidx);
      if (__pyx_t_4) {
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_1 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_22, __pyx_bstride_0_values)) < __pyx_v_r_bin);
        if (!__pyx_t_1) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":860
 *         # count values in current bin, advance to next bin
 *         while j < lenidx and (values[j] < r_bin or
 *                               (right_closed and values[j] == r_bin)):             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
          if (__pyx_v_right_closed) {
            __pyx_t_23 = __pyx_v_j;
            __pyx_t_3 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_23, __pyx_bstride_0_values)) == __pyx_v_r_bin);
            __pyx_t_24 = __pyx_t_3;
          } else {
            __pyx_t_24 = __pyx_v_right_closed;
          }
          __pyx_t_3 = __pyx_t_24;
        } else {
          __pyx_t_3 = __pyx_t_1;
        }
        __pyx_t_1 = __pyx_t_3;
      } else {
        __pyx_t_1 = __pyx_t_4;
      }
      if (!__pyx_t_1) break;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":861
 *         while j < lenidx and (values[j] < r_bin or
 *                               (right_closed and values[j] == r_bin)):
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         bins[bc] = j
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":863
 *             j += 1
 * 
 *         bins[bc] = j             # <<<<<<<<<<<<<<
 *         bc += 1
 * 
 */
    __pyx_t_25 = __pyx_v_bc;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_25, __pyx_bstride_0_bins) = __pyx_v_j;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":864
 * 
 *         bins[bc] = j
 *         bc += 1             # <<<<<<<<<<<<<<
 * 
 *     return bins
 */
    __pyx_v_bc = (__pyx_v_bc + 1);
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":866
 *         bc += 1
 * 
 *     return bins             # <<<<<<<<<<<<<<
 * 
 * # add passing bin edges, instead of labels
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_bins));
  __pyx_r = ((PyObject *)__pyx_v_bins);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_binner);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.generate_bins_dt64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_binner);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_bins);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":872
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_77group_add_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_77group_add_bin[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_77group_add_bin = {__Pyx_NAMESTR("group_add_bin"), (PyCFunction)__pyx_pf_6pandas_3lib_77group_add_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_77group_add_bin)};
static PyObject *__pyx_pf_6pandas_3lib_77group_add_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_sumx;
  Py_ssize_t __pyx_bstride_0_sumx = 0;
  Py_ssize_t __pyx_bstride_1_sumx = 0;
  Py_ssize_t __pyx_bshape_0_sumx = 0;
  Py_ssize_t __pyx_bshape_1_sumx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  long __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  long __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  long __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,0};
  __Pyx_RefNannySetupContext("group_add_bin");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_add_bin", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_add_bin") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_add_bin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_add_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_sumx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":884
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":885
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_sumx = __pyx_bstruct_sumx.strides[0]; __pyx_bstride_1_sumx = __pyx_bstruct_sumx.strides[1];
    __pyx_bshape_0_sumx = __pyx_bstruct_sumx.shape[0]; __pyx_bshape_1_sumx = __pyx_bstruct_sumx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":887
 *     sumx = np.zeros_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_10, __pyx_bstride_0_bins)) == __pyx_t_11);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":888
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":890
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 *     N, K = (<object> values).shape
 * 
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":891
 *     else:
 *         ngroups = len(bins) + 1
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":893
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":894
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_12 = (__pyx_v_K > 1);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":895
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":896
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_12 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_15, __pyx_bstride_0_bins)));
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":897
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":899
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_18 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":900
 * 
 *             counts[b] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_19 = __pyx_v_K;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_j = __pyx_t_20;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":901
 *             counts[b] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_22 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":904
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_17) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":905
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *     else:
 */
          __pyx_t_23 = __pyx_v_b;
          __pyx_t_24 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_23, __pyx_bstride_0_nobs, __pyx_t_24, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":906
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_25 = __pyx_v_b;
          __pyx_t_26 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_25, __pyx_bstride_0_sumx, __pyx_t_26, __pyx_bstride_1_sumx) += __pyx_v_val;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
    }
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":908
 *                     sumx[b, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":909
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_17 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_19, __pyx_bstride_0_bins)));
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":910
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":912
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_20, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":913
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_27, __pyx_bstride_0_values, __pyx_t_28, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":916
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":917
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 * 
 */
        __pyx_t_29 = __pyx_v_b;
        __pyx_t_30 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_29, __pyx_bstride_0_nobs, __pyx_t_30, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":918
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_31 = __pyx_v_b;
        __pyx_t_32 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_31, __pyx_bstride_0_sumx, __pyx_t_32, __pyx_bstride_1_sumx) += __pyx_v_val;
        goto __pyx_L21;
      }
      __pyx_L21:;
    }
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":920
 *                 sumx[b, 0] += val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_9 = __pyx_v_ngroups;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":921
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_33 = __pyx_v_K;
    for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) {
      __pyx_v_j = __pyx_t_34;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":922
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_35 = __pyx_v_i;
      __pyx_t_36 = __pyx_v_j;
      __pyx_t_16 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_35, __pyx_bstride_0_nobs, __pyx_t_36, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":923
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = sumx[i, j]
 */
        __pyx_t_37 = __pyx_v_i;
        __pyx_t_38 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_37, __pyx_bstride_0_out, __pyx_t_38, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L26;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":925
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_39 = __pyx_v_i;
        __pyx_t_40 = __pyx_v_j;
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_41, __pyx_bstride_0_out, __pyx_t_42, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_39, __pyx_bstride_0_sumx, __pyx_t_40, __pyx_bstride_1_sumx));
      }
      __pyx_L26:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_add_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":929
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_78group_prod_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_78group_prod_bin[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_78group_prod_bin = {__Pyx_NAMESTR("group_prod_bin"), (PyCFunction)__pyx_pf_6pandas_3lib_78group_prod_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_78group_prod_bin)};
static PyObject *__pyx_pf_6pandas_3lib_78group_prod_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_prodx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_prodx;
  Py_ssize_t __pyx_bstride_0_prodx = 0;
  Py_ssize_t __pyx_bstride_1_prodx = 0;
  Py_ssize_t __pyx_bshape_0_prodx = 0;
  Py_ssize_t __pyx_bshape_1_prodx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  long __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  long __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  long __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,0};
  __Pyx_RefNannySetupContext("group_prod_bin");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_prod_bin", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_prod_bin") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_prod_bin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_prod_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_prodx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":941
 *         ndarray[float64_t, ndim=2] prodx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     prodx = np.ones_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":942
 * 
 *     nobs = np.zeros_like(out)
 *     prodx = np.ones_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__ones_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_prodx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_prodx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_prodx, (PyObject*)__pyx_v_prodx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_prodx = __pyx_bstruct_prodx.strides[0]; __pyx_bstride_1_prodx = __pyx_bstruct_prodx.strides[1];
    __pyx_bshape_0_prodx = __pyx_bstruct_prodx.shape[0]; __pyx_bshape_1_prodx = __pyx_bstruct_prodx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_prodx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":944
 *     prodx = np.ones_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_10, __pyx_bstride_0_bins)) == __pyx_t_11);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":945
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":947
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 *     N, K = (<object> values).shape
 * 
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":948
 *     else:
 *         ngroups = len(bins) + 1
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":950
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":951
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_12 = (__pyx_v_K > 1);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":952
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":953
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_12 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_15, __pyx_bstride_0_bins)));
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":954
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":956
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_18 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":957
 * 
 *             counts[b] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_19 = __pyx_v_K;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_j = __pyx_t_20;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":958
 *             counts[b] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_22 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":961
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     prodx[b, j] *= val
 */
        __pyx_t_17 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_17) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":962
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     prodx[b, j] *= val
 *     else:
 */
          __pyx_t_23 = __pyx_v_b;
          __pyx_t_24 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_23, __pyx_bstride_0_nobs, __pyx_t_24, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":963
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     prodx[b, j] *= val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_25 = __pyx_v_b;
          __pyx_t_26 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_prodx.buf, __pyx_t_25, __pyx_bstride_0_prodx, __pyx_t_26, __pyx_bstride_1_prodx) *= __pyx_v_val;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
    }
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":965
 *                     prodx[b, j] *= val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":966
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_17 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_19, __pyx_bstride_0_bins)));
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":967
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":969
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_20, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":970
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_27, __pyx_bstride_0_values, __pyx_t_28, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":973
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 prodx[b, 0] *= val
 */
      __pyx_t_16 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":974
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 prodx[b, 0] *= val
 * 
 */
        __pyx_t_29 = __pyx_v_b;
        __pyx_t_30 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_29, __pyx_bstride_0_nobs, __pyx_t_30, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":975
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 prodx[b, 0] *= val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_31 = __pyx_v_b;
        __pyx_t_32 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_prodx.buf, __pyx_t_31, __pyx_bstride_0_prodx, __pyx_t_32, __pyx_bstride_1_prodx) *= __pyx_v_val;
        goto __pyx_L21;
      }
      __pyx_L21:;
    }
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":977
 *                 prodx[b, 0] *= val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_9 = __pyx_v_ngroups;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":978
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_33 = __pyx_v_K;
    for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) {
      __pyx_v_j = __pyx_t_34;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":979
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_35 = __pyx_v_i;
      __pyx_t_36 = __pyx_v_j;
      __pyx_t_16 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_35, __pyx_bstride_0_nobs, __pyx_t_36, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":980
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = prodx[i, j]
 */
        __pyx_t_37 = __pyx_v_i;
        __pyx_t_38 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_37, __pyx_bstride_0_out, __pyx_t_38, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L26;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":982
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = prodx[i, j]             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_39 = __pyx_v_i;
        __pyx_t_40 = __pyx_v_j;
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_41, __pyx_bstride_0_out, __pyx_t_42, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_prodx.buf, __pyx_t_39, __pyx_bstride_0_prodx, __pyx_t_40, __pyx_bstride_1_prodx));
      }
      __pyx_L26:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_prodx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_prod_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_prodx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_prodx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":986
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_min_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_79group_min_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_79group_min_bin[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_79group_min_bin = {__Pyx_NAMESTR("group_min_bin"), (PyCFunction)__pyx_pf_6pandas_3lib_79group_min_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_79group_min_bin)};
static PyObject *__pyx_pf_6pandas_3lib_79group_min_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_minx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_minx;
  Py_ssize_t __pyx_bstride_0_minx = 0;
  Py_ssize_t __pyx_bstride_1_minx = 0;
  Py_ssize_t __pyx_bshape_0_minx = 0;
  Py_ssize_t __pyx_bshape_1_minx = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  long __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  long __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  long __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  long __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,0};
  __Pyx_RefNannySetupContext("group_min_bin");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_min_bin", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_min_bin") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_min_bin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_min_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_minx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":998
 *         ndarray[float64_t, ndim=2] minx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     minx = np.empty_like(out)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1000
 *     nobs = np.zeros_like(out)
 * 
 *     minx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     minx.fill(np.inf)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_minx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_minx, (PyObject*)__pyx_v_minx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_minx = __pyx_bstruct_minx.strides[0]; __pyx_bstride_1_minx = __pyx_bstruct_minx.strides[1];
    __pyx_bshape_0_minx = __pyx_bstruct_minx.shape[0]; __pyx_bshape_1_minx = __pyx_bstruct_minx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_minx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1001
 * 
 *     minx = np.empty_like(out)
 *     minx.fill(np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_minx), __pyx_n_s__fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1003
 *     minx.fill(np.inf)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_10, __pyx_bstride_0_bins)) == __pyx_t_11);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1004
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1006
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1008
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1010
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1011
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_12 = (__pyx_v_K > 1);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1012
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1013
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_12 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_15, __pyx_bstride_0_bins)));
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1014
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1016
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_18 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1017
 * 
 *             counts[b] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_19 = __pyx_v_K;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_j = __pyx_t_20;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1018
 *             counts[b] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_22 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1021
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:
 */
        __pyx_t_17 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_17) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1022
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     if val < minx[b, j]:
 *                         minx[b, j] = val
 */
          __pyx_t_23 = __pyx_v_b;
          __pyx_t_24 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_23, __pyx_bstride_0_nobs, __pyx_t_24, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1023
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:             # <<<<<<<<<<<<<<
 *                         minx[b, j] = val
 *     else:
 */
          __pyx_t_25 = __pyx_v_b;
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_17 = (__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_25, __pyx_bstride_0_minx, __pyx_t_26, __pyx_bstride_1_minx)));
          if (__pyx_t_17) {

            /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1024
 *                     nobs[b, j] += 1
 *                     if val < minx[b, j]:
 *                         minx[b, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_27 = __pyx_v_b;
            __pyx_t_28 = __pyx_v_j;
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_27, __pyx_bstride_0_minx, __pyx_t_28, __pyx_bstride_1_minx) = __pyx_v_val;
            goto __pyx_L17;
          }
          __pyx_L17:;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
    }
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1026
 *                         minx[b, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1027
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_17 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_19, __pyx_bstride_0_bins)));
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1028
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1030
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_20, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1031
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_30 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_29, __pyx_bstride_0_values, __pyx_t_30, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1034
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:
 */
      __pyx_t_16 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1035
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val < minx[b, 0]:
 *                     minx[b, 0] = val
 */
        __pyx_t_31 = __pyx_v_b;
        __pyx_t_32 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_31, __pyx_bstride_0_nobs, __pyx_t_32, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1036
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:             # <<<<<<<<<<<<<<
 *                     minx[b, 0] = val
 * 
 */
        __pyx_t_33 = __pyx_v_b;
        __pyx_t_34 = 0;
        __pyx_t_16 = (__pyx_v_val < (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_33, __pyx_bstride_0_minx, __pyx_t_34, __pyx_bstride_1_minx)));
        if (__pyx_t_16) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1037
 *                 nobs[b, 0] += 1
 *                 if val < minx[b, 0]:
 *                     minx[b, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_35 = __pyx_v_b;
          __pyx_t_36 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_35, __pyx_bstride_0_minx, __pyx_t_36, __pyx_bstride_1_minx) = __pyx_v_val;
          goto __pyx_L23;
        }
        __pyx_L23:;
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1039
 *                     minx[b, 0] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_9 = __pyx_v_ngroups;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1040
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_37 = __pyx_v_K;
    for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
      __pyx_v_j = __pyx_t_38;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1041
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_39 = __pyx_v_i;
      __pyx_t_40 = __pyx_v_j;
      __pyx_t_16 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_39, __pyx_bstride_0_nobs, __pyx_t_40, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1042
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = minx[i, j]
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_41, __pyx_bstride_0_out, __pyx_t_42, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L28;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1044
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = minx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_43 = __pyx_v_i;
        __pyx_t_44 = __pyx_v_j;
        __pyx_t_45 = __pyx_v_i;
        __pyx_t_46 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_45, __pyx_bstride_0_out, __pyx_t_46, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_minx.buf, __pyx_t_43, __pyx_bstride_0_minx, __pyx_t_44, __pyx_bstride_1_minx));
      }
      __pyx_L28:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_min_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_minx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1049
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_max_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_80group_max_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_80group_max_bin[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_80group_max_bin = {__Pyx_NAMESTR("group_max_bin"), (PyCFunction)__pyx_pf_6pandas_3lib_80group_max_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_80group_max_bin)};
static PyObject *__pyx_pf_6pandas_3lib_80group_max_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  PyArrayObject *__pyx_v_maxx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_maxx;
  Py_ssize_t __pyx_bstride_0_maxx = 0;
  Py_ssize_t __pyx_bstride_1_maxx = 0;
  Py_ssize_t __pyx_bshape_0_maxx = 0;
  Py_ssize_t __pyx_bshape_1_maxx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  long __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  long __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  long __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  long __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,0};
  __Pyx_RefNannySetupContext("group_max_bin");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_max_bin", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_max_bin") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_max_bin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_max_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_maxx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1061
 *         ndarray[float64_t, ndim=2] maxx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1062
 * 
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)             # <<<<<<<<<<<<<<
 *     maxx.fill(-np.inf)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_maxx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_maxx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_maxx, (PyObject*)__pyx_v_maxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_maxx = __pyx_bstruct_maxx.strides[0]; __pyx_bstride_1_maxx = __pyx_bstruct_maxx.strides[1];
    __pyx_bshape_0_maxx = __pyx_bstruct_maxx.shape[0]; __pyx_bshape_1_maxx = __pyx_bstruct_maxx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_maxx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1063
 *     nobs = np.zeros_like(out)
 *     maxx = np.empty_like(out)
 *     maxx.fill(-np.inf)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_maxx), __pyx_n_s__fill); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1065
 *     maxx.fill(-np.inf)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_10, __pyx_bstride_0_bins)) == __pyx_t_11);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1066
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1068
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1070
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1072
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1073
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_12 = (__pyx_v_K > 1);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1074
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1075
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_12 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_15, __pyx_bstride_0_bins)));
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1076
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1078
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_18 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1079
 * 
 *             counts[b] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_19 = __pyx_v_K;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_j = __pyx_t_20;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1080
 *             counts[b] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_22 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1083
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:
 */
        __pyx_t_17 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_17) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1084
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     if val > maxx[b, j]:
 *                         maxx[b, j] = val
 */
          __pyx_t_23 = __pyx_v_b;
          __pyx_t_24 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_23, __pyx_bstride_0_nobs, __pyx_t_24, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1085
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:             # <<<<<<<<<<<<<<
 *                         maxx[b, j] = val
 *     else:
 */
          __pyx_t_25 = __pyx_v_b;
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_17 = (__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_25, __pyx_bstride_0_maxx, __pyx_t_26, __pyx_bstride_1_maxx)));
          if (__pyx_t_17) {

            /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1086
 *                     nobs[b, j] += 1
 *                     if val > maxx[b, j]:
 *                         maxx[b, j] = val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
            __pyx_t_27 = __pyx_v_b;
            __pyx_t_28 = __pyx_v_j;
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_27, __pyx_bstride_0_maxx, __pyx_t_28, __pyx_bstride_1_maxx) = __pyx_v_val;
            goto __pyx_L17;
          }
          __pyx_L17:;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
    }
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1088
 *                         maxx[b, j] = val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1089
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_17 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_19, __pyx_bstride_0_bins)));
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1090
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1092
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_20, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1093
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_30 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_29, __pyx_bstride_0_values, __pyx_t_30, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1096
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:
 */
      __pyx_t_16 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1097
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 if val > maxx[b, 0]:
 *                     maxx[b, 0] = val
 */
        __pyx_t_31 = __pyx_v_b;
        __pyx_t_32 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_31, __pyx_bstride_0_nobs, __pyx_t_32, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1098
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:             # <<<<<<<<<<<<<<
 *                     maxx[b, 0] = val
 * 
 */
        __pyx_t_33 = __pyx_v_b;
        __pyx_t_34 = 0;
        __pyx_t_16 = (__pyx_v_val > (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_33, __pyx_bstride_0_maxx, __pyx_t_34, __pyx_bstride_1_maxx)));
        if (__pyx_t_16) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1099
 *                 nobs[b, 0] += 1
 *                 if val > maxx[b, 0]:
 *                     maxx[b, 0] = val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
          __pyx_t_35 = __pyx_v_b;
          __pyx_t_36 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_35, __pyx_bstride_0_maxx, __pyx_t_36, __pyx_bstride_1_maxx) = __pyx_v_val;
          goto __pyx_L23;
        }
        __pyx_L23:;
        goto __pyx_L22;
      }
      __pyx_L22:;
    }
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1101
 *                     maxx[b, 0] = val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 */
  __pyx_t_9 = __pyx_v_ngroups;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1102
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
    __pyx_t_37 = __pyx_v_K;
    for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
      __pyx_v_j = __pyx_t_38;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1103
 *     for i in range(ngroups):
 *         for j in range(K):
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_39 = __pyx_v_i;
      __pyx_t_40 = __pyx_v_j;
      __pyx_t_16 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_39, __pyx_bstride_0_nobs, __pyx_t_40, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1104
 *         for j in range(K):
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = maxx[i, j]
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_41, __pyx_bstride_0_out, __pyx_t_42, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L28;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1106
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = maxx[i, j]             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_43 = __pyx_v_i;
        __pyx_t_44 = __pyx_v_j;
        __pyx_t_45 = __pyx_v_i;
        __pyx_t_46 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_45, __pyx_bstride_0_out, __pyx_t_46, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_maxx.buf, __pyx_t_43, __pyx_bstride_0_maxx, __pyx_t_44, __pyx_bstride_1_maxx));
      }
      __pyx_L28:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_maxx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_max_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_maxx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_maxx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1111
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_ohlc(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_81group_ohlc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_81group_ohlc[] = "\n    Only aggregates on axis=0\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_81group_ohlc = {__Pyx_NAMESTR("group_ohlc"), (PyCFunction)__pyx_pf_6pandas_3lib_81group_ohlc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_81group_ohlc)};
static PyObject *__pyx_pf_6pandas_3lib_81group_ohlc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_vopen;
  __pyx_t_5numpy_float64_t __pyx_v_vhigh;
  __pyx_t_5numpy_float64_t __pyx_v_vlow;
  __pyx_t_5numpy_float64_t __pyx_v_vclose;
  __pyx_t_5numpy_float64_t __pyx_v_NA;
  int __pyx_v_got_first;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  __pyx_t_5numpy_float64_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  long __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  long __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  long __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  long __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  long __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  long __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  long __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  long __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  long __pyx_t_32;
  long __pyx_t_33;
  long __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  long __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  long __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  long __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  long __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  long __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  long __pyx_t_46;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,0};
  __Pyx_RefNannySetupContext("group_ohlc");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_ohlc", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_ohlc") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_ohlc", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_ohlc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1122
 *         float64_t val, count
 *         float64_t vopen, vhigh, vlow, vclose, NA
 *         bint got_first = 0             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_v_got_first = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1124
 *         bint got_first = 0
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 - 1);
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_2, __pyx_bstride_0_bins)) == __pyx_t_3);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1125
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_3;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1127
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_3 + 1);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1129
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     if out.shape[1] != 4:
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
    PyObject* sequence = __pyx_t_5;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
    index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_7);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_N = __pyx_t_3;
  __pyx_v_K = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1131
 *     N, K = (<object> values).shape
 * 
 *     if out.shape[1] != 4:             # <<<<<<<<<<<<<<
 *         raise ValueError('Output array must have 4 columns')
 * 
 */
  __pyx_t_4 = ((__pyx_v_out->dimensions[1]) != 4);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1132
 * 
 *     if out.shape[1] != 4:
 *         raise ValueError('Output array must have 4 columns')             # <<<<<<<<<<<<<<
 * 
 *     NA = np.nan
 */
    __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_88), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1134
 *         raise ValueError('Output array must have 4 columns')
 * 
 *     NA = np.nan             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__nan); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_NA = __pyx_t_10;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1136
 *     NA = np.nan
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         raise NotImplementedError
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1137
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 *     else:
 */
  __pyx_t_4 = (__pyx_v_K > 1);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1138
 *     b = 0
 *     if K > 1:
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
    __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L10;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1140
 *         raise NotImplementedError
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 if not got_first:
 */
    __pyx_t_1 = __pyx_v_N;
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1141
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 if not got_first:
 *                     out[b, 0] = NA
 */
      while (1) {
        __pyx_t_4 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_4) {
          __pyx_t_11 = __pyx_v_b;
          __pyx_t_12 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_11, __pyx_bstride_0_bins)));
          __pyx_t_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_4;
        }
        if (!__pyx_t_13) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1142
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 if not got_first:             # <<<<<<<<<<<<<<
 *                     out[b, 0] = NA
 *                     out[b, 1] = NA
 */
        __pyx_t_13 = (!__pyx_v_got_first);
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1143
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 if not got_first:
 *                     out[b, 0] = NA             # <<<<<<<<<<<<<<
 *                     out[b, 1] = NA
 *                     out[b, 2] = NA
 */
          __pyx_t_14 = __pyx_v_b;
          __pyx_t_15 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_14, __pyx_bstride_0_out, __pyx_t_15, __pyx_bstride_1_out) = __pyx_v_NA;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1144
 *                 if not got_first:
 *                     out[b, 0] = NA
 *                     out[b, 1] = NA             # <<<<<<<<<<<<<<
 *                     out[b, 2] = NA
 *                     out[b, 3] = NA
 */
          __pyx_t_16 = __pyx_v_b;
          __pyx_t_17 = 1;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_16, __pyx_bstride_0_out, __pyx_t_17, __pyx_bstride_1_out) = __pyx_v_NA;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1145
 *                     out[b, 0] = NA
 *                     out[b, 1] = NA
 *                     out[b, 2] = NA             # <<<<<<<<<<<<<<
 *                     out[b, 3] = NA
 *                 else:
 */
          __pyx_t_18 = __pyx_v_b;
          __pyx_t_19 = 2;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_18, __pyx_bstride_0_out, __pyx_t_19, __pyx_bstride_1_out) = __pyx_v_NA;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1146
 *                     out[b, 1] = NA
 *                     out[b, 2] = NA
 *                     out[b, 3] = NA             # <<<<<<<<<<<<<<
 *                 else:
 *                     out[b, 0] = vopen
 */
          __pyx_t_20 = __pyx_v_b;
          __pyx_t_21 = 3;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_20, __pyx_bstride_0_out, __pyx_t_21, __pyx_bstride_1_out) = __pyx_v_NA;
          goto __pyx_L15;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1148
 *                     out[b, 3] = NA
 *                 else:
 *                     out[b, 0] = vopen             # <<<<<<<<<<<<<<
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow
 */
          __pyx_t_22 = __pyx_v_b;
          __pyx_t_23 = 0;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_22, __pyx_bstride_0_out, __pyx_t_23, __pyx_bstride_1_out) = __pyx_v_vopen;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1149
 *                 else:
 *                     out[b, 0] = vopen
 *                     out[b, 1] = vhigh             # <<<<<<<<<<<<<<
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose
 */
          __pyx_t_24 = __pyx_v_b;
          __pyx_t_25 = 1;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_24, __pyx_bstride_0_out, __pyx_t_25, __pyx_bstride_1_out) = __pyx_v_vhigh;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1150
 *                     out[b, 0] = vopen
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow             # <<<<<<<<<<<<<<
 *                     out[b, 3] = vclose
 *                 b += 1
 */
          __pyx_t_26 = __pyx_v_b;
          __pyx_t_27 = 2;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_26, __pyx_bstride_0_out, __pyx_t_27, __pyx_bstride_1_out) = __pyx_v_vlow;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1151
 *                     out[b, 1] = vhigh
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose             # <<<<<<<<<<<<<<
 *                 b += 1
 *                 got_first = 0
 */
          __pyx_t_28 = __pyx_v_b;
          __pyx_t_29 = 3;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_28, __pyx_bstride_0_out, __pyx_t_29, __pyx_bstride_1_out) = __pyx_v_vclose;
        }
        __pyx_L15:;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1152
 *                     out[b, 2] = vlow
 *                     out[b, 3] = vclose
 *                 b += 1             # <<<<<<<<<<<<<<
 *                 got_first = 0
 * 
 */
        __pyx_v_b = (__pyx_v_b + 1);

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1153
 *                     out[b, 3] = vclose
 *                 b += 1
 *                 got_first = 0             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_got_first = 0;
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1155
 *                 got_first = 0
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_30 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_30, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1156
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_31 = __pyx_v_i;
      __pyx_t_32 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_31, __pyx_bstride_0_values, __pyx_t_32, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1159
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 if not got_first:
 *                     got_first = 1
 */
      __pyx_t_13 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1160
 *             # not nan
 *             if val == val:
 *                 if not got_first:             # <<<<<<<<<<<<<<
 *                     got_first = 1
 *                     vopen = val
 */
        __pyx_t_13 = (!__pyx_v_got_first);
        if (__pyx_t_13) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1161
 *             if val == val:
 *                 if not got_first:
 *                     got_first = 1             # <<<<<<<<<<<<<<
 *                     vopen = val
 *                     vlow = val
 */
          __pyx_v_got_first = 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1162
 *                 if not got_first:
 *                     got_first = 1
 *                     vopen = val             # <<<<<<<<<<<<<<
 *                     vlow = val
 *                     vhigh = val
 */
          __pyx_v_vopen = __pyx_v_val;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1163
 *                     got_first = 1
 *                     vopen = val
 *                     vlow = val             # <<<<<<<<<<<<<<
 *                     vhigh = val
 *                 else:
 */
          __pyx_v_vlow = __pyx_v_val;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1164
 *                     vopen = val
 *                     vlow = val
 *                     vhigh = val             # <<<<<<<<<<<<<<
 *                 else:
 *                     if val < vlow:
 */
          __pyx_v_vhigh = __pyx_v_val;
          goto __pyx_L17;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1166
 *                     vhigh = val
 *                 else:
 *                     if val < vlow:             # <<<<<<<<<<<<<<
 *                         vlow = val
 *                     if val > vhigh:
 */
          __pyx_t_13 = (__pyx_v_val < __pyx_v_vlow);
          if (__pyx_t_13) {

            /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1167
 *                 else:
 *                     if val < vlow:
 *                         vlow = val             # <<<<<<<<<<<<<<
 *                     if val > vhigh:
 *                         vhigh = val
 */
            __pyx_v_vlow = __pyx_v_val;
            goto __pyx_L18;
          }
          __pyx_L18:;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1168
 *                     if val < vlow:
 *                         vlow = val
 *                     if val > vhigh:             # <<<<<<<<<<<<<<
 *                         vhigh = val
 *                 vclose = val
 */
          __pyx_t_13 = (__pyx_v_val > __pyx_v_vhigh);
          if (__pyx_t_13) {

            /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1169
 *                         vlow = val
 *                     if val > vhigh:
 *                         vhigh = val             # <<<<<<<<<<<<<<
 *                 vclose = val
 * 
 */
            __pyx_v_vhigh = __pyx_v_val;
            goto __pyx_L19;
          }
          __pyx_L19:;
        }
        __pyx_L17:;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1170
 *                     if val > vhigh:
 *                         vhigh = val
 *                 vclose = val             # <<<<<<<<<<<<<<
 * 
 *         if not got_first:
 */
        __pyx_v_vclose = __pyx_v_val;
        goto __pyx_L16;
      }
      __pyx_L16:;
    }

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1172
 *                 vclose = val
 * 
 *         if not got_first:             # <<<<<<<<<<<<<<
 *             out[b, 0] = NA
 *             out[b, 1] = NA
 */
    __pyx_t_13 = (!__pyx_v_got_first);
    if (__pyx_t_13) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1173
 * 
 *         if not got_first:
 *             out[b, 0] = NA             # <<<<<<<<<<<<<<
 *             out[b, 1] = NA
 *             out[b, 2] = NA
 */
      __pyx_t_1 = __pyx_v_b;
      __pyx_t_33 = 0;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_1, __pyx_bstride_0_out, __pyx_t_33, __pyx_bstride_1_out) = __pyx_v_NA;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1174
 *         if not got_first:
 *             out[b, 0] = NA
 *             out[b, 1] = NA             # <<<<<<<<<<<<<<
 *             out[b, 2] = NA
 *             out[b, 3] = NA
 */
      __pyx_t_3 = __pyx_v_b;
      __pyx_t_34 = 1;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_3, __pyx_bstride_0_out, __pyx_t_34, __pyx_bstride_1_out) = __pyx_v_NA;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1175
 *             out[b, 0] = NA
 *             out[b, 1] = NA
 *             out[b, 2] = NA             # <<<<<<<<<<<<<<
 *             out[b, 3] = NA
 *         else:
 */
      __pyx_t_35 = __pyx_v_b;
      __pyx_t_36 = 2;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_35, __pyx_bstride_0_out, __pyx_t_36, __pyx_bstride_1_out) = __pyx_v_NA;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1176
 *             out[b, 1] = NA
 *             out[b, 2] = NA
 *             out[b, 3] = NA             # <<<<<<<<<<<<<<
 *         else:
 *             out[b, 0] = vopen
 */
      __pyx_t_37 = __pyx_v_b;
      __pyx_t_38 = 3;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_37, __pyx_bstride_0_out, __pyx_t_38, __pyx_bstride_1_out) = __pyx_v_NA;
      goto __pyx_L20;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1178
 *             out[b, 3] = NA
 *         else:
 *             out[b, 0] = vopen             # <<<<<<<<<<<<<<
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow
 */
      __pyx_t_39 = __pyx_v_b;
      __pyx_t_40 = 0;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_39, __pyx_bstride_0_out, __pyx_t_40, __pyx_bstride_1_out) = __pyx_v_vopen;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1179
 *         else:
 *             out[b, 0] = vopen
 *             out[b, 1] = vhigh             # <<<<<<<<<<<<<<
 *             out[b, 2] = vlow
 *             out[b, 3] = vclose
 */
      __pyx_t_41 = __pyx_v_b;
      __pyx_t_42 = 1;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_41, __pyx_bstride_0_out, __pyx_t_42, __pyx_bstride_1_out) = __pyx_v_vhigh;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1180
 *             out[b, 0] = vopen
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow             # <<<<<<<<<<<<<<
 *             out[b, 3] = vclose
 * 
 */
      __pyx_t_43 = __pyx_v_b;
      __pyx_t_44 = 2;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_43, __pyx_bstride_0_out, __pyx_t_44, __pyx_bstride_1_out) = __pyx_v_vlow;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1181
 *             out[b, 1] = vhigh
 *             out[b, 2] = vlow
 *             out[b, 3] = vclose             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_45 = __pyx_v_b;
      __pyx_t_46 = 3;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_45, __pyx_bstride_0_out, __pyx_t_46, __pyx_bstride_1_out) = __pyx_v_vclose;
    }
    __pyx_L20:;
  }
  __pyx_L10:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_ohlc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1186
 * # @cython.boundscheck(False)
 * # @cython.wraparound(False)
 * def group_mean_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_82group_mean_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_82group_mean_bin = {__Pyx_NAMESTR("group_mean_bin"), (PyCFunction)__pyx_pf_6pandas_3lib_82group_mean_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_82group_mean_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_count;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_nobs = 0;
  Py_buffer __pyx_bstruct_sumx;
  Py_ssize_t __pyx_bstride_0_sumx = 0;
  Py_ssize_t __pyx_bstride_1_sumx = 0;
  Py_ssize_t __pyx_bshape_0_sumx = 0;
  Py_ssize_t __pyx_bshape_1_sumx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  long __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  long __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  long __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  __pyx_t_5numpy_float64_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,0};
  __Pyx_RefNannySetupContext("group_mean_bin");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_mean_bin", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_mean_bin") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_mean_bin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_mean_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_sumx.buf = NULL;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1195
 *         ndarray[float64_t, ndim=2] sumx, nobs
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1196
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_sumx = __pyx_bstruct_sumx.strides[0]; __pyx_bstride_1_sumx = __pyx_bstruct_sumx.strides[1];
    __pyx_bshape_0_sumx = __pyx_bstruct_sumx.shape[0]; __pyx_bshape_1_sumx = __pyx_bstruct_sumx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1198
 *     sumx = np.zeros_like(out)
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_12;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1199
 * 
 *     N, K = (<object> values).shape
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_12 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (__pyx_t_12 - 1);
  __pyx_t_5 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_bshape_0_bins;
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_bins)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_11, __pyx_bstride_0_bins)) == __pyx_t_13);
  if (__pyx_t_14) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1200
 *     N, K = (<object> values).shape
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_13;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1202
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
    __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_13 + 1);
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1204
 *         ngroups = len(bins) + 1
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1205
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_14 = (__pyx_v_K > 1);
  if (__pyx_t_14) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1206
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_13 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1207
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_14 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_14) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_5 = -1;
          if (__pyx_t_15 < 0) {
            __pyx_t_15 += __pyx_bshape_0_bins;
            if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_bins)) __pyx_t_5 = 0;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_16 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_15, __pyx_bstride_0_bins)));
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_14;
        }
        if (!__pyx_t_17) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1208
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1210
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             for j in range(K):
 *                 val = values[i, j]
 */
      __pyx_t_18 = __pyx_v_b;
      __pyx_t_5 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_counts)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1211
 * 
 *             counts[b] += 1
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_19 = __pyx_v_K;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_j = __pyx_t_20;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1212
 *             counts[b] += 1
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_5 = -1;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_bshape_0_values;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
        if (__pyx_t_22 < 0) {
          __pyx_t_22 += __pyx_bshape_1_values;
          if (unlikely(__pyx_t_22 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_22 >= __pyx_bshape_1_values)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1215
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_17) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1216
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *     else:
 */
          __pyx_t_23 = __pyx_v_b;
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_5 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_bshape_0_nobs;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_nobs)) __pyx_t_5 = 0;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_bshape_1_nobs;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_5 = 1;
          } else if (unlikely(__pyx_t_24 >= __pyx_bshape_1_nobs)) __pyx_t_5 = 1;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_23, __pyx_bstride_0_nobs, __pyx_t_24, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1217
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_25 = __pyx_v_b;
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_5 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_bshape_0_sumx;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_sumx)) __pyx_t_5 = 0;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_bshape_1_sumx;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_5 = 1;
          } else if (unlikely(__pyx_t_26 >= __pyx_bshape_1_sumx)) __pyx_t_5 = 1;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_25, __pyx_bstride_0_sumx, __pyx_t_26, __pyx_bstride_1_sumx) += __pyx_v_val;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
    }
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1219
 *                     sumx[b, j] += val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_13 = __pyx_v_N;
    for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) {
      __pyx_v_i = __pyx_t_12;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1220
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_17 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_5 = -1;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_bshape_0_bins;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0;
          } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_bins)) __pyx_t_5 = 0;
          if (unlikely(__pyx_t_5 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_5);
            {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_14 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_19, __pyx_bstride_0_bins)));
          __pyx_t_16 = __pyx_t_14;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1221
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1223
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      __pyx_t_5 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_counts)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_20, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1224
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_27 = __pyx_v_i;
      __pyx_t_28 = 0;
      __pyx_t_5 = -1;
      if (__pyx_t_27 < 0) {
        __pyx_t_27 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_27 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
      if (__pyx_t_28 < 0) {
        __pyx_t_28 += __pyx_bshape_1_values;
        if (unlikely(__pyx_t_28 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_28 >= __pyx_bshape_1_values)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_27, __pyx_bstride_0_values, __pyx_t_28, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1227
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1228
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 * 
 */
        __pyx_t_29 = __pyx_v_b;
        __pyx_t_30 = 0;
        __pyx_t_5 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_bshape_0_nobs;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_nobs)) __pyx_t_5 = 0;
        if (__pyx_t_30 < 0) {
          __pyx_t_30 += __pyx_bshape_1_nobs;
          if (unlikely(__pyx_t_30 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_30 >= __pyx_bshape_1_nobs)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_29, __pyx_bstride_0_nobs, __pyx_t_30, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1229
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_31 = __pyx_v_b;
        __pyx_t_32 = 0;
        __pyx_t_5 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_bshape_0_sumx;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_31 >= __pyx_bshape_0_sumx)) __pyx_t_5 = 0;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_bshape_1_sumx;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_32 >= __pyx_bshape_1_sumx)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_31, __pyx_bstride_0_sumx, __pyx_t_32, __pyx_bstride_1_sumx) += __pyx_v_val;
        goto __pyx_L21;
      }
      __pyx_L21:;
    }
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1231
 *                 sumx[b, 0] += val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             count = nobs[i, j]
 */
  __pyx_t_13 = __pyx_v_ngroups;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1232
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             count = nobs[i, j]
 *             if nobs[i, j] == 0:
 */
    __pyx_t_33 = __pyx_v_K;
    for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) {
      __pyx_v_j = __pyx_t_34;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1233
 *     for i in range(ngroups):
 *         for j in range(K):
 *             count = nobs[i, j]             # <<<<<<<<<<<<<<
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan
 */
      __pyx_t_35 = __pyx_v_i;
      __pyx_t_36 = __pyx_v_j;
      __pyx_t_5 = -1;
      if (__pyx_t_35 < 0) {
        __pyx_t_35 += __pyx_bshape_0_nobs;
        if (unlikely(__pyx_t_35 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_35 >= __pyx_bshape_0_nobs)) __pyx_t_5 = 0;
      if (__pyx_t_36 < 0) {
        __pyx_t_36 += __pyx_bshape_1_nobs;
        if (unlikely(__pyx_t_36 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_36 >= __pyx_bshape_1_nobs)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_count = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_35, __pyx_bstride_0_nobs, __pyx_t_36, __pyx_bstride_1_nobs));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1234
 *         for j in range(K):
 *             count = nobs[i, j]
 *             if nobs[i, j] == 0:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_37 = __pyx_v_i;
      __pyx_t_38 = __pyx_v_j;
      __pyx_t_5 = -1;
      if (__pyx_t_37 < 0) {
        __pyx_t_37 += __pyx_bshape_0_nobs;
        if (unlikely(__pyx_t_37 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_37 >= __pyx_bshape_0_nobs)) __pyx_t_5 = 0;
      if (__pyx_t_38 < 0) {
        __pyx_t_38 += __pyx_bshape_1_nobs;
        if (unlikely(__pyx_t_38 < 0)) __pyx_t_5 = 1;
      } else if (unlikely(__pyx_t_38 >= __pyx_bshape_1_nobs)) __pyx_t_5 = 1;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_37, __pyx_bstride_0_nobs, __pyx_t_38, __pyx_bstride_1_nobs)) == 0.0);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1235
 *             count = nobs[i, j]
 *             if nobs[i, j] == 0:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = sumx[i, j] / count
 */
        __pyx_t_39 = __pyx_v_i;
        __pyx_t_40 = __pyx_v_j;
        __pyx_t_5 = -1;
        if (__pyx_t_39 < 0) {
          __pyx_t_39 += __pyx_bshape_0_out;
          if (unlikely(__pyx_t_39 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_39 >= __pyx_bshape_0_out)) __pyx_t_5 = 0;
        if (__pyx_t_40 < 0) {
          __pyx_t_40 += __pyx_bshape_1_out;
          if (unlikely(__pyx_t_40 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_40 >= __pyx_bshape_1_out)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_39, __pyx_bstride_0_out, __pyx_t_40, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L26;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1237
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = sumx[i, j] / count             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        __pyx_t_5 = -1;
        if (__pyx_t_41 < 0) {
          __pyx_t_41 += __pyx_bshape_0_sumx;
          if (unlikely(__pyx_t_41 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_41 >= __pyx_bshape_0_sumx)) __pyx_t_5 = 0;
        if (__pyx_t_42 < 0) {
          __pyx_t_42 += __pyx_bshape_1_sumx;
          if (unlikely(__pyx_t_42 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_42 >= __pyx_bshape_1_sumx)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_41, __pyx_bstride_0_sumx, __pyx_t_42, __pyx_bstride_1_sumx));
        if (unlikely(__pyx_v_count == 0)) {
          PyErr_Format(PyExc_ZeroDivisionError, "float division");
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_44 = __pyx_v_i;
        __pyx_t_45 = __pyx_v_j;
        __pyx_t_5 = -1;
        if (__pyx_t_44 < 0) {
          __pyx_t_44 += __pyx_bshape_0_out;
          if (unlikely(__pyx_t_44 < 0)) __pyx_t_5 = 0;
        } else if (unlikely(__pyx_t_44 >= __pyx_bshape_0_out)) __pyx_t_5 = 0;
        if (__pyx_t_45 < 0) {
          __pyx_t_45 += __pyx_bshape_1_out;
          if (unlikely(__pyx_t_45 < 0)) __pyx_t_5 = 1;
        } else if (unlikely(__pyx_t_45 >= __pyx_bshape_1_out)) __pyx_t_5 = 1;
        if (unlikely(__pyx_t_5 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_5);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_44, __pyx_bstride_0_out, __pyx_t_45, __pyx_bstride_1_out) = (__pyx_t_43 / __pyx_v_count);
      }
      __pyx_L26:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_mean_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1241
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_var_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */

static PyObject *__pyx_pf_6pandas_3lib_83group_var_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_83group_var_bin = {__Pyx_NAMESTR("group_var_bin"), (PyCFunction)__pyx_pf_6pandas_3lib_83group_var_bin, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_83group_var_bin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_out = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_bins = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_b;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_ct;
  PyArrayObject *__pyx_v_nobs = 0;
  PyArrayObject *__pyx_v_sumx = 0;
  PyArrayObject *__pyx_v_sumxx = 0;
  Py_buffer __pyx_bstruct_sumx;
  Py_ssize_t __pyx_bstride_0_sumx = 0;
  Py_ssize_t __pyx_bstride_1_sumx = 0;
  Py_ssize_t __pyx_bshape_0_sumx = 0;
  Py_ssize_t __pyx_bshape_1_sumx = 0;
  Py_buffer __pyx_bstruct_nobs;
  Py_ssize_t __pyx_bstride_0_nobs = 0;
  Py_ssize_t __pyx_bstride_1_nobs = 0;
  Py_ssize_t __pyx_bshape_0_nobs = 0;
  Py_ssize_t __pyx_bshape_1_nobs = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_sumxx;
  Py_ssize_t __pyx_bstride_0_sumxx = 0;
  Py_ssize_t __pyx_bstride_1_sumxx = 0;
  Py_ssize_t __pyx_bshape_0_sumxx = 0;
  Py_ssize_t __pyx_bshape_1_sumxx = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_bins;
  Py_ssize_t __pyx_bstride_0_bins = 0;
  Py_ssize_t __pyx_bshape_0_bins = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyArrayObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  long __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  long __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  long __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  long __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  __pyx_t_5numpy_float64_t __pyx_t_49;
  __pyx_t_5numpy_float64_t __pyx_t_50;
  Py_ssize_t __pyx_t_51;
  Py_ssize_t __pyx_t_52;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__out,&__pyx_n_s__counts,&__pyx_n_s__values,&__pyx_n_s__bins,0};
  __Pyx_RefNannySetupContext("group_var_bin");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__counts);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_var_bin", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_var_bin") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_out = ((PyArrayObject *)values[0]);
    __pyx_v_counts = ((PyArrayObject *)values[1]);
    __pyx_v_values = ((PyArrayObject *)values[2]);
    __pyx_v_bins = ((PyArrayObject *)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_var_bin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_var_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_nobs.buf = NULL;
  __pyx_bstruct_sumx.buf = NULL;
  __pyx_bstruct_sumxx.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_bins.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_counts), __pyx_ptype_5numpy_ndarray, 1, "counts", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bins), __pyx_ptype_5numpy_ndarray, 1, "bins", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
  __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bins, (PyObject*)__pyx_v_bins, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_bins = __pyx_bstruct_bins.strides[0];
  __pyx_bshape_0_bins = __pyx_bstruct_bins.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1251
 *         ndarray[float64_t, ndim=2] nobs, sumx, sumxx
 * 
 *     nobs = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_nobs, (PyObject*)__pyx_v_nobs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_nobs = __pyx_bstruct_nobs.strides[0]; __pyx_bstride_1_nobs = __pyx_bstruct_nobs.strides[1];
    __pyx_bshape_0_nobs = __pyx_bstruct_nobs.shape[0]; __pyx_bshape_1_nobs = __pyx_bstruct_nobs.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_nobs = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1252
 * 
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 *     sumxx = np.zeros_like(out)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sumx, (PyObject*)__pyx_v_sumx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_sumx = __pyx_bstruct_sumx.strides[0]; __pyx_bstride_1_sumx = __pyx_bstruct_sumx.strides[1];
    __pyx_bshape_0_sumx = __pyx_bstruct_sumx.shape[0]; __pyx_bshape_1_sumx = __pyx_bstruct_sumx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumx = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1253
 *     nobs = np.zeros_like(out)
 *     sumx = np.zeros_like(out)
 *     sumxx = np.zeros_like(out)             # <<<<<<<<<<<<<<
 * 
 *     if bins[len(bins) - 1] == len(values):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros_like); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_out));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_out));
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumxx);
    __pyx_t_5 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sumxx, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_5 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sumxx, (PyObject*)__pyx_v_sumxx, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_sumxx = __pyx_bstruct_sumxx.strides[0]; __pyx_bstride_1_sumxx = __pyx_bstruct_sumxx.strides[1];
    __pyx_bshape_0_sumxx = __pyx_bstruct_sumxx.shape[0]; __pyx_bshape_1_sumxx = __pyx_bstruct_sumxx.shape[1];
    if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = 0;
  __pyx_v_sumxx = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1255
 *     sumxx = np.zeros_like(out)
 * 
 *     if bins[len(bins) - 1] == len(values):             # <<<<<<<<<<<<<<
 *         ngroups = len(bins)
 *     else:
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = (__pyx_t_9 - 1);
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_10, __pyx_bstride_0_bins)) == __pyx_t_11);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1256
 * 
 *     if bins[len(bins) - 1] == len(values):
 *         ngroups = len(bins)             # <<<<<<<<<<<<<<
 *     else:
 *         ngroups = len(bins) + 1
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = __pyx_t_11;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1258
 *         ngroups = len(bins)
 *     else:
 *         ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     N, K = (<object> values).shape
 */
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_bins)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_ngroups = (__pyx_t_11 + 1);
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1260
 *         ngroups = len(bins) + 1
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 * 
 *     b = 0
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_11;
  __pyx_v_K = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1262
 *     N, K = (<object> values).shape
 * 
 *     b = 0             # <<<<<<<<<<<<<<
 *     if K > 1:
 *         for i in range(N):
 */
  __pyx_v_b = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1263
 * 
 *     b = 0
 *     if K > 1:             # <<<<<<<<<<<<<<
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 */
  __pyx_t_12 = (__pyx_v_K > 1);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1264
 *     b = 0
 *     if K > 1:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1265
 *     if K > 1:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_12 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_12) {
          __pyx_t_15 = __pyx_v_b;
          __pyx_t_16 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_15, __pyx_bstride_0_bins)));
          __pyx_t_17 = __pyx_t_16;
        } else {
          __pyx_t_17 = __pyx_t_12;
        }
        if (!__pyx_t_17) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1266
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1268
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 * 
 *             for j in range(K):
 */
      __pyx_t_18 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1270
 *             counts[b] += 1
 * 
 *             for j in range(K):             # <<<<<<<<<<<<<<
 *                 val = values[i, j]
 * 
 */
      __pyx_t_19 = __pyx_v_K;
      for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
        __pyx_v_j = __pyx_t_20;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1271
 * 
 *             for j in range(K):
 *                 val = values[i, j]             # <<<<<<<<<<<<<<
 * 
 *                 # not nan
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_22 = __pyx_v_j;
        __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1274
 * 
 *                 # not nan
 *                 if val == val:             # <<<<<<<<<<<<<<
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 */
        __pyx_t_17 = (__pyx_v_val == __pyx_v_val);
        if (__pyx_t_17) {

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1275
 *                 # not nan
 *                 if val == val:
 *                     nobs[b, j] += 1             # <<<<<<<<<<<<<<
 *                     sumx[b, j] += val
 *                     sumxx[b, j] += val * val
 */
          __pyx_t_23 = __pyx_v_b;
          __pyx_t_24 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_23, __pyx_bstride_0_nobs, __pyx_t_24, __pyx_bstride_1_nobs) += 1;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1276
 *                 if val == val:
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val             # <<<<<<<<<<<<<<
 *                     sumxx[b, j] += val * val
 *     else:
 */
          __pyx_t_25 = __pyx_v_b;
          __pyx_t_26 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_25, __pyx_bstride_0_sumx, __pyx_t_26, __pyx_bstride_1_sumx) += __pyx_v_val;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1277
 *                     nobs[b, j] += 1
 *                     sumx[b, j] += val
 *                     sumxx[b, j] += val * val             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(N):
 */
          __pyx_t_27 = __pyx_v_b;
          __pyx_t_28 = __pyx_v_j;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumxx.buf, __pyx_t_27, __pyx_bstride_0_sumxx, __pyx_t_28, __pyx_bstride_1_sumxx) += (__pyx_v_val * __pyx_v_val);
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
    }
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1279
 *                     sumxx[b, j] += val * val
 *     else:
 *         for i in range(N):             # <<<<<<<<<<<<<<
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1
 */
    __pyx_t_9 = __pyx_v_N;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1280
 *     else:
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:             # <<<<<<<<<<<<<<
 *                 b += 1
 * 
 */
      while (1) {
        __pyx_t_17 = (__pyx_v_b < (__pyx_v_ngroups - 1));
        if (__pyx_t_17) {
          __pyx_t_19 = __pyx_v_b;
          __pyx_t_12 = (__pyx_v_i >= (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_bins.buf, __pyx_t_19, __pyx_bstride_0_bins)));
          __pyx_t_16 = __pyx_t_12;
        } else {
          __pyx_t_16 = __pyx_t_17;
        }
        if (!__pyx_t_16) break;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1281
 *         for i in range(N):
 *             while b < ngroups - 1 and i >= bins[b]:
 *                 b += 1             # <<<<<<<<<<<<<<
 * 
 *             counts[b] += 1
 */
        __pyx_v_b = (__pyx_v_b + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1283
 *                 b += 1
 * 
 *             counts[b] += 1             # <<<<<<<<<<<<<<
 *             val = values[i, 0]
 * 
 */
      __pyx_t_20 = __pyx_v_b;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_20, __pyx_bstride_0_counts) += 1;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1284
 * 
 *             counts[b] += 1
 *             val = values[i, 0]             # <<<<<<<<<<<<<<
 * 
 *             # not nan
 */
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_30 = 0;
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_29, __pyx_bstride_0_values, __pyx_t_30, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1287
 * 
 *             # not nan
 *             if val == val:             # <<<<<<<<<<<<<<
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 */
      __pyx_t_16 = (__pyx_v_val == __pyx_v_val);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1288
 *             # not nan
 *             if val == val:
 *                 nobs[b, 0] += 1             # <<<<<<<<<<<<<<
 *                 sumx[b, 0] += val
 *                 sumxx[b, 0] += val * val
 */
        __pyx_t_31 = __pyx_v_b;
        __pyx_t_32 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_31, __pyx_bstride_0_nobs, __pyx_t_32, __pyx_bstride_1_nobs) += 1;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1289
 *             if val == val:
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val             # <<<<<<<<<<<<<<
 *                 sumxx[b, 0] += val * val
 * 
 */
        __pyx_t_33 = __pyx_v_b;
        __pyx_t_34 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_33, __pyx_bstride_0_sumx, __pyx_t_34, __pyx_bstride_1_sumx) += __pyx_v_val;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1290
 *                 nobs[b, 0] += 1
 *                 sumx[b, 0] += val
 *                 sumxx[b, 0] += val * val             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ngroups):
 */
        __pyx_t_35 = __pyx_v_b;
        __pyx_t_36 = 0;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumxx.buf, __pyx_t_35, __pyx_bstride_0_sumxx, __pyx_t_36, __pyx_bstride_1_sumxx) += (__pyx_v_val * __pyx_v_val);
        goto __pyx_L21;
      }
      __pyx_L21:;
    }
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1292
 *                 sumxx[b, 0] += val * val
 * 
 *     for i in range(ngroups):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             ct = nobs[i, j]
 */
  __pyx_t_9 = __pyx_v_ngroups;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1293
 * 
 *     for i in range(ngroups):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             ct = nobs[i, j]
 *             if ct < 2:
 */
    __pyx_t_37 = __pyx_v_K;
    for (__pyx_t_38 = 0; __pyx_t_38 < __pyx_t_37; __pyx_t_38+=1) {
      __pyx_v_j = __pyx_t_38;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1294
 *     for i in range(ngroups):
 *         for j in range(K):
 *             ct = nobs[i, j]             # <<<<<<<<<<<<<<
 *             if ct < 2:
 *                 out[i, j] = nan
 */
      __pyx_t_39 = __pyx_v_i;
      __pyx_t_40 = __pyx_v_j;
      __pyx_v_ct = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_nobs.buf, __pyx_t_39, __pyx_bstride_0_nobs, __pyx_t_40, __pyx_bstride_1_nobs));

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1295
 *         for j in range(K):
 *             ct = nobs[i, j]
 *             if ct < 2:             # <<<<<<<<<<<<<<
 *                 out[i, j] = nan
 *             else:
 */
      __pyx_t_16 = (__pyx_v_ct < 2.0);
      if (__pyx_t_16) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1296
 *             ct = nobs[i, j]
 *             if ct < 2:
 *                 out[i, j] = nan             # <<<<<<<<<<<<<<
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 */
        __pyx_t_41 = __pyx_v_i;
        __pyx_t_42 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_41, __pyx_bstride_0_out, __pyx_t_42, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_nan;
        goto __pyx_L26;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1298
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * 
 */
        __pyx_t_43 = __pyx_v_i;
        __pyx_t_44 = __pyx_v_j;
        __pyx_t_45 = __pyx_v_i;
        __pyx_t_46 = __pyx_v_j;
        __pyx_t_47 = __pyx_v_i;
        __pyx_t_48 = __pyx_v_j;
        __pyx_t_49 = ((__pyx_v_ct * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumxx.buf, __pyx_t_43, __pyx_bstride_0_sumxx, __pyx_t_44, __pyx_bstride_1_sumxx))) - ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_45, __pyx_bstride_0_sumx, __pyx_t_46, __pyx_bstride_1_sumx)) * (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sumx.buf, __pyx_t_47, __pyx_bstride_0_sumx, __pyx_t_48, __pyx_bstride_1_sumx))));

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1299
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /
 *                              (ct * ct - ct))             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __pyx_t_50 = ((__pyx_v_ct * __pyx_v_ct) - __pyx_v_ct);
        if (unlikely(__pyx_t_50 == 0)) {
          PyErr_Format(PyExc_ZeroDivisionError, "float division");
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1298
 *                 out[i, j] = nan
 *             else:
 *                 out[i, j] = ((ct * sumxx[i, j] - sumx[i, j] * sumx[i, j]) /             # <<<<<<<<<<<<<<
 *                              (ct * ct - ct))
 * 
 */
        __pyx_t_51 = __pyx_v_i;
        __pyx_t_52 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_51, __pyx_bstride_0_out, __pyx_t_52, __pyx_bstride_1_out) = (__pyx_t_49 / __pyx_t_50);
      }
      __pyx_L26:;
    }
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumxx);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_var_bin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_nobs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sumxx);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bins);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nobs);
  __Pyx_XDECREF((PyObject *)__pyx_v_sumx);
  __Pyx_XDECREF((PyObject *)__pyx_v_sumxx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1305
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def row_bool_subset(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                     ndarray[uint8_t, cast=True] mask):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_84row_bool_subset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_84row_bool_subset = {__Pyx_NAMESTR("row_bool_subset"), (PyCFunction)__pyx_pf_6pandas_3lib_84row_bool_subset, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_84row_bool_subset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_mask = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_pos;
  PyArrayObject *__pyx_v_out = 0;
  Py_buffer __pyx_bstruct_mask;
  Py_ssize_t __pyx_bstride_0_mask = 0;
  Py_ssize_t __pyx_bshape_0_mask = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  __pyx_t_5numpy_uint8_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__mask,0};
  __Pyx_RefNannySetupContext("row_bool_subset");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("row_bool_subset", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "row_bool_subset") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_mask = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("row_bool_subset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.row_bool_subset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_mask.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_mask = __pyx_bstruct_mask.strides[0];
  __pyx_bshape_0_mask = __pyx_bstruct_mask.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1308
 *                     ndarray[uint8_t, cast=True] mask):
 *     cdef:
 *         Py_ssize_t i, j, n, k, pos = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t, ndim=2] out
 * 
 */
  __pyx_v_pos = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1311
 *         ndarray[float64_t, ndim=2] out
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     assert(n == len(mask))
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_n = __pyx_t_6;
  __pyx_v_k = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1312
 * 
 *     n, k = (<object> values).shape
 *     assert(n == len(mask))             # <<<<<<<<<<<<<<
 * 
 *     out = np.empty((mask.sum(), k), dtype=np.float64)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!(__pyx_v_n == __pyx_t_7))) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1314
 *     assert(n == len(mask))
 * 
 *     out = np.empty((mask.sum(), k), dtype=np.float64)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_mask), __pyx_n_s__sum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
    __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_out = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1316
 *     out = np.empty((mask.sum(), k), dtype=np.float64)
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             for j in range(k):
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1317
 * 
 *     for i in range(n):
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             for j in range(k):
 *                 out[pos, j] = values[i, j]
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_15 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_14, __pyx_bstride_0_mask));
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1318
 *     for i in range(n):
 *         if mask[i]:
 *             for j in range(k):             # <<<<<<<<<<<<<<
 *                 out[pos, j] = values[i, j]
 *             pos += 1
 */
      __pyx_t_16 = __pyx_v_k;
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
        __pyx_v_j = __pyx_t_17;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1319
 *         if mask[i]:
 *             for j in range(k):
 *                 out[pos, j] = values[i, j]             # <<<<<<<<<<<<<<
 *             pos += 1
 * 
 */
        __pyx_t_18 = __pyx_v_i;
        __pyx_t_19 = __pyx_v_j;
        __pyx_t_20 = __pyx_v_pos;
        __pyx_t_21 = __pyx_v_j;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_20, __pyx_bstride_0_out, __pyx_t_21, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));
      }

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1320
 *             for j in range(k):
 *                 out[pos, j] = values[i, j]
 *             pos += 1             # <<<<<<<<<<<<<<
 * 
 *     return out
 */
      __pyx_v_pos = (__pyx_v_pos + 1);
      goto __pyx_L10;
    }
    __pyx_L10:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1322
 *             pos += 1
 * 
 *     return out             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.row_bool_subset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1326
 * 
 * 
 * def group_count(ndarray[int64_t] values, Py_ssize_t size):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_85group_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_85group_count = {__Pyx_NAMESTR("group_count"), (PyCFunction)__pyx_pf_6pandas_3lib_85group_count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_85group_count(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_counts = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __pyx_t_5numpy_int64_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__size,0};
  __Pyx_RefNannySetupContext("group_count");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("group_count", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "group_count") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_size = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_size == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("group_count", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.group_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1328
 * def group_count(ndarray[int64_t] values, Py_ssize_t size):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] counts
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1331
 *         ndarray[int64_t] counts
 * 
 *     counts = np.zeros(size, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         counts[values[i]] += 1
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1332
 * 
 *     counts = np.zeros(size, dtype=np.int64)
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         counts[values[i]] += 1
 *     return counts
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1333
 *     counts = np.zeros(size, dtype=np.int64)
 *     for i in range(n):
 *         counts[values[i]] += 1             # <<<<<<<<<<<<<<
 *     return counts
 * 
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_values)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_13, __pyx_bstride_0_values));
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_counts;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_counts)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_14, __pyx_bstride_0_counts) += 1;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1334
 *     for i in range(n):
 *         counts[values[i]] += 1
 *     return counts             # <<<<<<<<<<<<<<
 * 
 * def lookup_values(ndarray[object] values, dict mapping):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  __pyx_r = ((PyObject *)__pyx_v_counts);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.group_count", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1336
 *     return counts
 * 
 * def lookup_values(ndarray[object] values, dict mapping):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_86lookup_values(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_86lookup_values = {__Pyx_NAMESTR("lookup_values"), (PyCFunction)__pyx_pf_6pandas_3lib_86lookup_values, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_86lookup_values(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_mapping = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_result = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__mapping,0};
  __Pyx_RefNannySetupContext("lookup_values");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mapping);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lookup_values", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lookup_values") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_mapping = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lookup_values", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.lookup_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapping), (&PyDict_Type), 1, "mapping", 1))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1338
 * def lookup_values(ndarray[object] values, dict mapping):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype='O')
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1340
 *         Py_ssize_t i, n = len(values)
 * 
 *     result = np.empty(n, dtype='O')             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         result[i] = mapping[values[i]]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1341
 * 
 *     result = np.empty(n, dtype='O')
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         result[i] = mapping[values[i]]
 *     return maybe_convert_objects(result)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1342
 *     result = np.empty(n, dtype='O')
 *     for i in range(n):
 *         result[i] = mapping[values[i]]             # <<<<<<<<<<<<<<
 *     return maybe_convert_objects(result)
 * 
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_7 < 0) {
      __pyx_t_7 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_values)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_7, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_mapping), __pyx_t_5); if (!__pyx_t_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_SetItemInt(__pyx_v_result, __pyx_v_i, __pyx_t_2, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1343
 *     for i in range(n):
 *         result[i] = mapping[values[i]]
 *     return maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_89); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(__pyx_v_result);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_result);
  __Pyx_GIVEREF(__pyx_v_result);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.lookup_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1346
 * 
 * 
 * def count_level_1d(ndarray[uint8_t, cast=True] mask,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] labels, Py_ssize_t max_bin):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_87count_level_1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_87count_level_1d = {__Pyx_NAMESTR("count_level_1d"), (PyCFunction)__pyx_pf_6pandas_3lib_87count_level_1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_87count_level_1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_max_bin;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_counts = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_mask;
  Py_ssize_t __pyx_bstride_0_mask = 0;
  Py_ssize_t __pyx_bshape_0_mask = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  __pyx_t_5numpy_uint8_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  __pyx_t_5numpy_int64_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mask,&__pyx_n_s__labels,&__pyx_n_s__max_bin,0};
  __Pyx_RefNannySetupContext("count_level_1d");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_bin);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "count_level_1d") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_mask = ((PyArrayObject *)values[0]);
    __pyx_v_labels = ((PyArrayObject *)values[1]);
    __pyx_v_max_bin = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_bin == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("count_level_1d", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.count_level_1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_mask.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_mask = __pyx_bstruct_mask.strides[0];
  __pyx_bshape_0_mask = __pyx_bstruct_mask.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1352
 *         ndarray[int64_t] counts
 * 
 *     counts = np.zeros(max_bin, dtype='i8')             # <<<<<<<<<<<<<<
 * 
 *     n = len(mask)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_bin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__i8)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1354
 *     counts = np.zeros(max_bin, dtype='i8')
 * 
 *     n = len(mask)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_mask)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1356
 *     n = len(mask)
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         if mask[i]:
 *             counts[labels[i]] += 1
 */
  __pyx_t_10 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_10; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1357
 * 
 *     for i from 0 <= i < n:
 *         if mask[i]:             # <<<<<<<<<<<<<<
 *             counts[labels[i]] += 1
 * 
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_bshape_0_mask;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_mask)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_11, __pyx_bstride_0_mask));
    if (__pyx_t_12) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1358
 *     for i from 0 <= i < n:
 *         if mask[i]:
 *             counts[labels[i]] += 1             # <<<<<<<<<<<<<<
 * 
 *     return counts
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_labels)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_13, __pyx_bstride_0_labels));
      __pyx_t_6 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_0_counts;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_counts)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_14, __pyx_bstride_0_counts) += 1;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1360
 *             counts[labels[i]] += 1
 * 
 *     return counts             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  __pyx_r = ((PyObject *)__pyx_v_counts);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.count_level_1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1363
 * 
 * 
 * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] labels, Py_ssize_t max_bin):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_88count_level_2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_88count_level_2d = {__Pyx_NAMESTR("count_level_2d"), (PyCFunction)__pyx_pf_6pandas_3lib_88count_level_2d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_88count_level_2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_mask = 0;
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_max_bin;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_counts = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_mask;
  Py_ssize_t __pyx_bstride_0_mask = 0;
  Py_ssize_t __pyx_bstride_1_mask = 0;
  Py_ssize_t __pyx_bshape_0_mask = 0;
  Py_ssize_t __pyx_bshape_1_mask = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bstride_1_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_ssize_t __pyx_bshape_1_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  __pyx_t_5numpy_uint8_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  __pyx_t_5numpy_int64_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mask,&__pyx_n_s__labels,&__pyx_n_s__max_bin,0};
  __Pyx_RefNannySetupContext("count_level_2d");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mask);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_bin);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "count_level_2d") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_mask = ((PyArrayObject *)values[0]);
    __pyx_v_labels = ((PyArrayObject *)values[1]);
    __pyx_v_max_bin = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_bin == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("count_level_2d", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.count_level_2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_mask.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mask), __pyx_ptype_5numpy_ndarray, 1, "mask", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_mask = __pyx_bstruct_mask.strides[0]; __pyx_bstride_1_mask = __pyx_bstruct_mask.strides[1];
  __pyx_bshape_0_mask = __pyx_bstruct_mask.shape[0]; __pyx_bshape_1_mask = __pyx_bstruct_mask.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1369
 *         ndarray[int64_t, ndim=2] counts
 * 
 *     n, k = (<object> mask).shape             # <<<<<<<<<<<<<<
 *     counts = np.zeros((max_bin, k), dtype='i8')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_mask), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_n = __pyx_t_6;
  __pyx_v_k = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1370
 * 
 *     n, k = (<object> mask).shape
 *     counts = np.zeros((max_bin, k), dtype='i8')             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_bin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__i8)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0]; __pyx_bstride_1_counts = __pyx_bstruct_counts.strides[1];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0]; __pyx_bshape_1_counts = __pyx_bstruct_counts.shape[1];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1372
 *     counts = np.zeros((max_bin, k), dtype='i8')
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         for j from 0 <= j < k:
 *             if mask[i, j]:
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1373
 * 
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:             # <<<<<<<<<<<<<<
 *             if mask[i, j]:
 *                 counts[labels[i], j] += 1
 */
    __pyx_t_6 = __pyx_v_k;
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1374
 *     for i from 0 <= i < n:
 *         for j from 0 <= j < k:
 *             if mask[i, j]:             # <<<<<<<<<<<<<<
 *                 counts[labels[i], j] += 1
 * 
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_14 = __pyx_v_j;
      __pyx_t_9 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_mask;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_mask)) __pyx_t_9 = 0;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_1_mask;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_1_mask)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_13, __pyx_bstride_0_mask, __pyx_t_14, __pyx_bstride_1_mask));
      if (__pyx_t_15) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1375
 *         for j from 0 <= j < k:
 *             if mask[i, j]:
 *                 counts[labels[i], j] += 1             # <<<<<<<<<<<<<<
 * 
 *     return counts
 */
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_bshape_0_labels;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_labels)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_17 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_16, __pyx_bstride_0_labels));
        __pyx_t_18 = __pyx_v_j;
        __pyx_t_9 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_bshape_0_counts;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_counts)) __pyx_t_9 = 0;
        if (__pyx_t_18 < 0) {
          __pyx_t_18 += __pyx_bshape_1_counts;
          if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 1;
        } else if (unlikely(__pyx_t_18 >= __pyx_bshape_1_counts)) __pyx_t_9 = 1;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts, __pyx_t_18, __pyx_bstride_1_counts) += 1;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1377
 *                 counts[labels[i], j] += 1
 * 
 *     return counts             # <<<<<<<<<<<<<<
 * 
 * cdef class _PandasNull:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  __pyx_r = ((PyObject *)__pyx_v_counts);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.count_level_2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1381
 * cdef class _PandasNull:
 * 
 *     def __richcmp__(_PandasNull self, object other, int op):             # <<<<<<<<<<<<<<
 *         if op == 2: # ==
 *             return isinstance(other, _PandasNull)
 */

static PyObject *__pyx_pf_6pandas_3lib_11_PandasNull___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11_PandasNull___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_6pandas_3lib__PandasNull, 1, "self", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1384
 *         if op == 2: # ==
 *             return isinstance(other, _PandasNull)
 *         elif op == 3: # !=             # <<<<<<<<<<<<<<
 *             return not isinstance(other, _PandasNull)
 *         else:
 */
  switch (__pyx_v_op) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1382
 * 
 *     def __richcmp__(_PandasNull self, object other, int op):
 *         if op == 2: # ==             # <<<<<<<<<<<<<<
 *             return isinstance(other, _PandasNull)
 *         elif op == 3: # !=
 */
    case 2:

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1383
 *     def __richcmp__(_PandasNull self, object other, int op):
 *         if op == 2: # ==
 *             return isinstance(other, _PandasNull)             # <<<<<<<<<<<<<<
 *         elif op == 3: # !=
 *             return not isinstance(other, _PandasNull)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull));
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_t_1); 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1384
 *         if op == 2: # ==
 *             return isinstance(other, _PandasNull)
 *         elif op == 3: # !=             # <<<<<<<<<<<<<<
 *             return not isinstance(other, _PandasNull)
 *         else:
 */
    case 3:

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1385
 *             return isinstance(other, _PandasNull)
 *         elif op == 3: # !=
 *             return not isinstance(other, _PandasNull)             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull));
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_t_1); 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
    default:

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1387
 *             return not isinstance(other, _PandasNull)
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     def __hash__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._PandasNull.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1389
 *             return False
 * 
 *     def __hash__(self):             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */

static Py_hash_t __pyx_pf_6pandas_3lib_11_PandasNull_1__hash__(PyObject *__pyx_v_self); /*proto*/
static Py_hash_t __pyx_pf_6pandas_3lib_11_PandasNull_1__hash__(PyObject *__pyx_v_self) {
  Py_hash_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__hash__");

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1390
 * 
 *     def __hash__(self):
 *         return 0             # <<<<<<<<<<<<<<
 * 
 * pandas_null = _PandasNull()
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1394
 * pandas_null = _PandasNull()
 * 
 * def fast_zip_fillna(list ndarrays, fill_value=pandas_null):             # <<<<<<<<<<<<<<
 *     '''
 *     For zipping multiple ndarrays into an ndarray of tuples
 */

static PyObject *__pyx_pf_6pandas_3lib_89fast_zip_fillna(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_89fast_zip_fillna[] = "\n    For zipping multiple ndarrays into an ndarray of tuples\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_89fast_zip_fillna = {__Pyx_NAMESTR("fast_zip_fillna"), (PyCFunction)__pyx_pf_6pandas_3lib_89fast_zip_fillna, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_89fast_zip_fillna)};
static PyObject *__pyx_pf_6pandas_3lib_89fast_zip_fillna(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ndarrays = 0;
  PyObject *__pyx_v_fill_value = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyArrayIterObject *__pyx_v_it = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_tup = 0;
  PyObject *__pyx_v_arr = NULL;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject **__pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ndarrays,&__pyx_n_s__fill_value,0};
  __Pyx_RefNannySetupContext("fast_zip_fillna");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_90;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ndarrays);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fill_value);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fast_zip_fillna") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ndarrays = ((PyObject*)values[0]);
    __pyx_v_fill_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fast_zip_fillna", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.fast_zip_fillna", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ndarrays), (&PyList_Type), 1, "ndarrays", 1))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1404
 *         object val, tup
 * 
 *     k = len(ndarrays)             # <<<<<<<<<<<<<<
 *     n = len(ndarrays[0])
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_ndarrays) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_ndarrays)); 
  __pyx_v_k = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1405
 * 
 *     k = len(ndarrays)
 *     n = len(ndarrays[0])             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype=object)
 */
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ndarrays), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1407
 *     n = len(ndarrays[0])
 * 
 *     result = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     # initialize tuples on first pass
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1410
 * 
 *     # initialize tuples on first pass
 *     arr = ndarrays[0]             # <<<<<<<<<<<<<<
 *     it = <flatiter> PyArray_IterNew(arr)
 *     for i in range(n):
 */
  __pyx_t_5 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ndarrays), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_arr = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1411
 *     # initialize tuples on first pass
 *     arr = ndarrays[0]
 *     it = <flatiter> PyArray_IterNew(arr)             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 */
  __pyx_t_5 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_t_5)));
  __pyx_v_it = ((PyArrayIterObject *)__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1412
 *     arr = ndarrays[0]
 *     it = <flatiter> PyArray_IterNew(arr)
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *         tup = PyTuple_New(k)
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1413
 *     it = <flatiter> PyArray_IterNew(arr)
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))             # <<<<<<<<<<<<<<
 *         tup = PyTuple_New(k)
 * 
 */
    if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __pyx_v_arr;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_2 = PyArray_GETITEM(((PyArrayObject *)__pyx_t_5), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1414
 *     for i in range(n):
 *         val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *         tup = PyTuple_New(k)             # <<<<<<<<<<<<<<
 * 
 *         if val != val:
 */
    __pyx_t_2 = ((PyObject *)PyTuple_New(__pyx_v_k)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_tup);
    __pyx_v_tup = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1416
 *         tup = PyTuple_New(k)
 * 
 *         if val != val:             # <<<<<<<<<<<<<<
 *             val = fill_value
 * 
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_12) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1417
 * 
 *         if val != val:
 *             val = fill_value             # <<<<<<<<<<<<<<
 * 
 *         PyTuple_SET_ITEM(tup, 0, val)
 */
      __Pyx_INCREF(__pyx_v_fill_value);
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_v_fill_value;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1419
 *             val = fill_value
 * 
 *         PyTuple_SET_ITEM(tup, 0, val)             # <<<<<<<<<<<<<<
 *         Py_INCREF(val)
 *         result[i] = tup
 */
    PyTuple_SET_ITEM(__pyx_v_tup, 0, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1420
 * 
 *         PyTuple_SET_ITEM(tup, 0, val)
 *         Py_INCREF(val)             # <<<<<<<<<<<<<<
 *         result[i] = tup
 *         PyArray_ITER_NEXT(it)
 */
    Py_INCREF(__pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1421
 *         PyTuple_SET_ITEM(tup, 0, val)
 *         Py_INCREF(val)
 *         result[i] = tup             # <<<<<<<<<<<<<<
 *         PyArray_ITER_NEXT(it)
 * 
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_result)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_13, __pyx_bstride_0_result);
    __Pyx_GOTREF(*__pyx_t_14);
    __Pyx_DECREF(*__pyx_t_14); __Pyx_INCREF(__pyx_v_tup);
    *__pyx_t_14 = __pyx_v_tup;
    __Pyx_GIVEREF(*__pyx_t_14);

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1422
 *         Py_INCREF(val)
 *         result[i] = tup
 *         PyArray_ITER_NEXT(it)             # <<<<<<<<<<<<<<
 * 
 *     for j in range(1, k):
 */
    PyArray_ITER_NEXT(__pyx_v_it);
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1424
 *         PyArray_ITER_NEXT(it)
 * 
 *     for j in range(1, k):             # <<<<<<<<<<<<<<
 *         arr = ndarrays[j]
 *         it = <flatiter> PyArray_IterNew(arr)
 */
  __pyx_t_1 = __pyx_v_k;
  for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
    __pyx_v_j = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1425
 * 
 *     for j in range(1, k):
 *         arr = ndarrays[j]             # <<<<<<<<<<<<<<
 *         it = <flatiter> PyArray_IterNew(arr)
 *         if len(arr) != n:
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_ndarrays), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_arr);
    __pyx_v_arr = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1426
 *     for j in range(1, k):
 *         arr = ndarrays[j]
 *         it = <flatiter> PyArray_IterNew(arr)             # <<<<<<<<<<<<<<
 *         if len(arr) != n:
 *             raise ValueError('all arrays must be same length')
 */
    __pyx_t_2 = PyArray_IterNew(__pyx_v_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_t_2)));
    __Pyx_DECREF(((PyObject *)__pyx_v_it));
    __pyx_v_it = ((PyArrayIterObject *)__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1427
 *         arr = ndarrays[j]
 *         it = <flatiter> PyArray_IterNew(arr)
 *         if len(arr) != n:             # <<<<<<<<<<<<<<
 *             raise ValueError('all arrays must be same length')
 * 
 */
    __pyx_t_15 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_12 = (__pyx_t_15 != __pyx_v_n);
    if (__pyx_t_12) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1428
 *         it = <flatiter> PyArray_IterNew(arr)
 *         if len(arr) != n:
 *             raise ValueError('all arrays must be same length')             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1430
 *             raise ValueError('all arrays must be same length')
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *             if val != val:
 */
    __pyx_t_15 = __pyx_v_n;
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_i = __pyx_t_16;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1431
 * 
 *         for i in range(n):
 *             val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))             # <<<<<<<<<<<<<<
 *             if val != val:
 *                 val = fill_value
 */
      if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __pyx_v_arr;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_5 = PyArray_GETITEM(((PyArrayObject *)__pyx_t_2), PyArray_ITER_DATA(__pyx_v_it)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1432
 *         for i in range(n):
 *             val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *             if val != val:             # <<<<<<<<<<<<<<
 *                 val = fill_value
 * 
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_12) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1433
 *             val = PyArray_GETITEM(arr, PyArray_ITER_DATA(it))
 *             if val != val:
 *                 val = fill_value             # <<<<<<<<<<<<<<
 * 
 *             PyTuple_SET_ITEM(result[i], j, val)
 */
        __Pyx_INCREF(__pyx_v_fill_value);
        __Pyx_DECREF(__pyx_v_val);
        __pyx_v_val = __pyx_v_fill_value;
        goto __pyx_L14;
      }
      __pyx_L14:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1435
 *                 val = fill_value
 * 
 *             PyTuple_SET_ITEM(result[i], j, val)             # <<<<<<<<<<<<<<
 *             Py_INCREF(val)
 *             PyArray_ITER_NEXT(it)
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_result)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result);
      __Pyx_INCREF((PyObject*)__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_5, __pyx_v_j, __pyx_v_val);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1436
 * 
 *             PyTuple_SET_ITEM(result[i], j, val)
 *             Py_INCREF(val)             # <<<<<<<<<<<<<<
 *             PyArray_ITER_NEXT(it)
 * 
 */
      Py_INCREF(__pyx_v_val);

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1437
 *             PyTuple_SET_ITEM(result[i], j, val)
 *             Py_INCREF(val)
 *             PyArray_ITER_NEXT(it)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      PyArray_ITER_NEXT(__pyx_v_it);
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1439
 *             PyArray_ITER_NEXT(it)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def duplicated(ndarray[object] values, take_last=False):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.fast_zip_fillna", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1441
 *     return result
 * 
 * def duplicated(ndarray[object] values, take_last=False):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */

static PyObject *__pyx_pf_6pandas_3lib_90duplicated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_90duplicated = {__Pyx_NAMESTR("duplicated"), (PyCFunction)__pyx_pf_6pandas_3lib_90duplicated, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_90duplicated(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_take_last = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_seen = 0;
  PyObject *__pyx_v_row = 0;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__take_last,0};
  __Pyx_RefNannySetupContext("duplicated");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_92;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__take_last);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "duplicated") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_take_last = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("duplicated", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.duplicated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1444
 *     cdef:
 *         Py_ssize_t i, n
 *         dict seen = {}             # <<<<<<<<<<<<<<
 *         object row
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_seen = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1447
 *         object row
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8)
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_2;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1448
 * 
 *     n = len(values)
 *     cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     if take_last:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_result = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_result.buf = NULL;
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
      __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1450
 *     cdef ndarray[uint8_t] result = np.zeros(n, dtype=np.uint8)
 * 
 *     if take_last:             # <<<<<<<<<<<<<<
 *         for i from n > i >= 0:
 *             row = values[i]
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_take_last); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_8) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1451
 * 
 *     if take_last:
 *         for i from n > i >= 0:             # <<<<<<<<<<<<<<
 *             row = values[i]
 * 
 */
    for (__pyx_v_i = __pyx_v_n-1; __pyx_v_i >= 0; __pyx_v_i--) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1452
 *     if take_last:
 *         for i from n > i >= 0:
 *             row = values[i]             # <<<<<<<<<<<<<<
 * 
 *             if row in seen:
 */
      __pyx_t_2 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_2 < 0) {
        __pyx_t_2 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_2 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_2 >= __pyx_bshape_0_values)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_2, __pyx_bstride_0_values);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_row);
      __pyx_v_row = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1454
 *             row = values[i]
 * 
 *             if row in seen:             # <<<<<<<<<<<<<<
 *                 result[i] = 1
 *             else:
 */
      if (unlikely(((PyObject *)__pyx_v_seen) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_8 = ((PyDict_Contains(((PyObject *)__pyx_v_seen), __pyx_v_row))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_8) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1455
 * 
 *             if row in seen:
 *                 result[i] = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 seen[row] = None
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_10 < 0) {
          __pyx_t_10 += __pyx_bshape_0_result;
          if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_result)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_10, __pyx_bstride_0_result) = 1;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1457
 *                 result[i] = 1
 *             else:
 *                 seen[row] = None             # <<<<<<<<<<<<<<
 *                 result[i] = 0
 *     else:
 */
        if (PyDict_SetItem(((PyObject *)__pyx_v_seen), __pyx_v_row, Py_None) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1458
 *             else:
 *                 seen[row] = None
 *                 result[i] = 0             # <<<<<<<<<<<<<<
 *     else:
 *         for i from 0 <= i < n:
 */
        __pyx_t_11 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_11 < 0) {
          __pyx_t_11 += __pyx_bshape_0_result;
          if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_result)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_11, __pyx_bstride_0_result) = 0;
      }
      __pyx_L9:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1460
 *                 result[i] = 0
 *     else:
 *         for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *             row = values[i]
 *             if row in seen:
 */
    __pyx_t_12 = __pyx_v_n;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1461
 *     else:
 *         for i from 0 <= i < n:
 *             row = values[i]             # <<<<<<<<<<<<<<
 *             if row in seen:
 *                 result[i] = 1
 */
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_values)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_13, __pyx_bstride_0_values);
      __Pyx_INCREF((PyObject*)__pyx_t_6);
      __Pyx_XDECREF(__pyx_v_row);
      __pyx_v_row = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1462
 *         for i from 0 <= i < n:
 *             row = values[i]
 *             if row in seen:             # <<<<<<<<<<<<<<
 *                 result[i] = 1
 *             else:
 */
      if (unlikely(((PyObject *)__pyx_v_seen) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
      }
      __pyx_t_8 = ((PyDict_Contains(((PyObject *)__pyx_v_seen), __pyx_v_row))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_8) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1463
 *             row = values[i]
 *             if row in seen:
 *                 result[i] = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 seen[row] = None
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_14 < 0) {
          __pyx_t_14 += __pyx_bshape_0_result;
          if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_result)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_14, __pyx_bstride_0_result) = 1;
        goto __pyx_L12;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1465
 *                 result[i] = 1
 *             else:
 *                 seen[row] = None             # <<<<<<<<<<<<<<
 *                 result[i] = 0
 * 
 */
        if (PyDict_SetItem(((PyObject *)__pyx_v_seen), __pyx_v_row, Py_None) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1466
 *             else:
 *                 seen[row] = None
 *                 result[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     return result.view(np.bool_)
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_bshape_0_result;
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_result)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_15, __pyx_bstride_0_result) = 0;
      }
      __pyx_L12:;
    }
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1468
 *                 result[i] = 0
 * 
 *     return result.view(np.bool_)             # <<<<<<<<<<<<<<
 * 
 * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__bool_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.duplicated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_seen);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1470
 *     return result.view(np.bool_)
 * 
 * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, group_size, n, lab, start
 */

static PyObject *__pyx_pf_6pandas_3lib_91generate_slices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_91generate_slices = {__Pyx_NAMESTR("generate_slices"), (PyCFunction)__pyx_pf_6pandas_3lib_91generate_slices, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_91generate_slices(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_group_size;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_lab;
  Py_ssize_t __pyx_v_start;
  PyArrayObject *__pyx_v_starts = 0;
  PyObject *__pyx_v_ends = NULL;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_starts;
  Py_ssize_t __pyx_bstride_0_starts = 0;
  Py_ssize_t __pyx_bshape_0_starts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__labels,&__pyx_n_s__ngroups,0};
  __Pyx_RefNannySetupContext("generate_slices");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ngroups);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("generate_slices", 1, 2, 2, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "generate_slices") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_labels = ((PyArrayObject *)values[0]);
    __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("generate_slices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.generate_slices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_starts.buf = NULL;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1476
 *         ndarray[int64_t] starts
 * 
 *     n = len(labels)             # <<<<<<<<<<<<<<
 * 
 *     starts = np.zeros(ngroups, dtype=np.int64)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1478
 *     n = len(labels)
 * 
 *     starts = np.zeros(ngroups, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     ends = np.zeros(ngroups, dtype=np.int64)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_starts);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_starts, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_starts, (PyObject*)__pyx_v_starts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_starts = __pyx_bstruct_starts.strides[0];
    __pyx_bshape_0_starts = __pyx_bstruct_starts.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_starts = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1479
 * 
 *     starts = np.zeros(ngroups, dtype=np.int64)
 *     ends = np.zeros(ngroups, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     start = 0
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_ngroups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_v_ends = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1481
 *     ends = np.zeros(ngroups, dtype=np.int64)
 * 
 *     start = 0             # <<<<<<<<<<<<<<
 *     group_size = 0
 *     for i in range(n):
 */
  __pyx_v_start = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1482
 * 
 *     start = 0
 *     group_size = 0             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         group_size += 1
 */
  __pyx_v_group_size = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1483
 *     start = 0
 *     group_size = 0
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         group_size += 1
 *         lab = labels[i]
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1484
 *     group_size = 0
 *     for i in range(n):
 *         group_size += 1             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 *         if i == n - 1 or lab != labels[i + 1]:
 */
    __pyx_v_group_size = (__pyx_v_group_size + 1);

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1485
 *     for i in range(n):
 *         group_size += 1
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 *         if i == n - 1 or lab != labels[i + 1]:
 *             starts[lab] = start
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_labels;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_13, __pyx_bstride_0_labels));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1486
 *         group_size += 1
 *         lab = labels[i]
 *         if i == n - 1 or lab != labels[i + 1]:             # <<<<<<<<<<<<<<
 *             starts[lab] = start
 *             ends[lab] = start + group_size
 */
    __pyx_t_14 = (__pyx_v_i == (__pyx_v_n - 1));
    if (!__pyx_t_14) {
      __pyx_t_15 = (__pyx_v_i + 1);
      __pyx_t_8 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_labels;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_labels)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = (__pyx_v_lab != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_15, __pyx_bstride_0_labels)));
      __pyx_t_17 = __pyx_t_16;
    } else {
      __pyx_t_17 = __pyx_t_14;
    }
    if (__pyx_t_17) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1487
 *         lab = labels[i]
 *         if i == n - 1 or lab != labels[i + 1]:
 *             starts[lab] = start             # <<<<<<<<<<<<<<
 *             ends[lab] = start + group_size
 *             start += group_size
 */
      __pyx_t_18 = __pyx_v_lab;
      __pyx_t_8 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_starts;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_starts)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_starts.buf, __pyx_t_18, __pyx_bstride_0_starts) = __pyx_v_start;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1488
 *         if i == n - 1 or lab != labels[i + 1]:
 *             starts[lab] = start
 *             ends[lab] = start + group_size             # <<<<<<<<<<<<<<
 *             start += group_size
 *             group_size = 0
 */
      __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_start + __pyx_v_group_size)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemInt(__pyx_v_ends, __pyx_v_lab, __pyx_t_5, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1489
 *             starts[lab] = start
 *             ends[lab] = start + group_size
 *             start += group_size             # <<<<<<<<<<<<<<
 *             group_size = 0
 * 
 */
      __pyx_v_start = (__pyx_v_start + __pyx_v_group_size);

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1490
 *             ends[lab] = start + group_size
 *             start += group_size
 *             group_size = 0             # <<<<<<<<<<<<<<
 * 
 *     return starts, ends
 */
      __pyx_v_group_size = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1492
 *             group_size = 0
 * 
 *     return starts, ends             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_v_starts));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_starts));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_starts));
  __Pyx_INCREF(__pyx_v_ends);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ends);
  __Pyx_GIVEREF(__pyx_v_ends);
  __pyx_r = ((PyObject *)__pyx_t_5);
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_starts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.generate_slices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_starts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_starts);
  __Pyx_XDECREF(__pyx_v_ends);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1495
 * 
 * 
 * def groupby_arrays(ndarray index, ndarray[int64_t] labels, sort=True):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, lab, cur, start, n = len(index)
 */

static PyObject *__pyx_pf_6pandas_3lib_92groupby_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_92groupby_arrays = {__Pyx_NAMESTR("groupby_arrays"), (PyCFunction)__pyx_pf_6pandas_3lib_92groupby_arrays, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_92groupby_arrays(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  PyArrayObject *__pyx_v_labels = 0;
  PyObject *__pyx_v_sort = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_lab;
  Py_ssize_t __pyx_v_cur;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_indexer = NULL;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  long __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__labels,&__pyx_n_s__sort,0};
  __Pyx_RefNannySetupContext("groupby_arrays");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_93;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("groupby_arrays", 0, 2, 3, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sort);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "groupby_arrays") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = ((PyArrayObject *)values[0]);
    __pyx_v_labels = ((PyArrayObject *)values[1]);
    __pyx_v_sort = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("groupby_arrays", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.groupby_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_index);
  __Pyx_INCREF((PyObject *)__pyx_v_labels);
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1497
 * def groupby_arrays(ndarray index, ndarray[int64_t] labels, sort=True):
 *     cdef:
 *         Py_ssize_t i, lab, cur, start, n = len(index)             # <<<<<<<<<<<<<<
 *         dict result = {}
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1498
 *     cdef:
 *         Py_ssize_t i, lab, cur, start, n = len(index)
 *         dict result = {}             # <<<<<<<<<<<<<<
 * 
 *     index = np.asarray(index)
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1500
 *         dict result = {}
 * 
 *     index = np.asarray(index)             # <<<<<<<<<<<<<<
 * 
 *     # this is N log N. If this is a bottleneck may we worth fixing someday
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_index));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_index));
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_v_index));
  __pyx_v_index = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1503
 * 
 *     # this is N log N. If this is a bottleneck may we worth fixing someday
 *     if sort:             # <<<<<<<<<<<<<<
 *         indexer = labels.argsort(kind='mergesort')
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1504
 *     # this is N log N. If this is a bottleneck may we worth fixing someday
 *     if sort:
 *         indexer = labels.argsort(kind='mergesort')             # <<<<<<<<<<<<<<
 * 
 *         labels = labels.take(indexer)
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_labels), __pyx_n_s__argsort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__kind), ((PyObject *)__pyx_n_s__mergesort)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_indexer = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1506
 *         indexer = labels.argsort(kind='mergesort')
 * 
 *         labels = labels.take(indexer)             # <<<<<<<<<<<<<<
 *         index = index.take(indexer)
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_labels), __pyx_n_s__take); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_indexer);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_indexer);
    __Pyx_GIVEREF(__pyx_v_indexer);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
      __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_labels));
    __pyx_v_labels = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1507
 * 
 *         labels = labels.take(indexer)
 *         index = index.take(indexer)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_index), __pyx_n_s__take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_indexer);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_indexer);
    __Pyx_GIVEREF(__pyx_v_indexer);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_index));
    __pyx_v_index = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1509
 *         index = index.take(indexer)
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_5 = (__pyx_v_n == 0);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1510
 * 
 *     if n == 0:
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     start = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = ((PyObject *)__pyx_v_result);
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1512
 *         return result
 * 
 *     start = 0             # <<<<<<<<<<<<<<
 *     cur = labels[0]
 *     for i in range(1, n):
 */
  __pyx_v_start = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1513
 * 
 *     start = 0
 *     cur = labels[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         lab = labels[i]
 */
  __pyx_t_11 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_11 < 0) {
    __pyx_t_11 += __pyx_bshape_0_labels;
    if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_labels)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_11, __pyx_bstride_0_labels));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1514
 *     start = 0
 *     cur = labels[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1515
 *     cur = labels[0]
 *     for i in range(1, n):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 * 
 *         if lab != cur:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_labels;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_labels)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_13, __pyx_bstride_0_labels));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1517
 *         lab = labels[i]
 * 
 *         if lab != cur:             # <<<<<<<<<<<<<<
 *             if lab != -1:
 *                 result[cur] = index[start:i]
 */
    __pyx_t_5 = (__pyx_v_lab != __pyx_v_cur);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1518
 * 
 *         if lab != cur:
 *             if lab != -1:             # <<<<<<<<<<<<<<
 *                 result[cur] = index[start:i]
 *             start = i
 */
      __pyx_t_5 = (__pyx_v_lab != -1);
      if (__pyx_t_5) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1519
 *         if lab != cur:
 *             if lab != -1:
 *                 result[cur] = index[start:i]             # <<<<<<<<<<<<<<
 *             start = i
 *         cur = lab
 */
        __pyx_t_3 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_index), __pyx_v_start, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_result), __pyx_v_cur, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1520
 *             if lab != -1:
 *                 result[cur] = index[start:i]
 *             start = i             # <<<<<<<<<<<<<<
 *         cur = lab
 * 
 */
      __pyx_v_start = __pyx_v_i;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1521
 *                 result[cur] = index[start:i]
 *             start = i
 *         cur = lab             # <<<<<<<<<<<<<<
 * 
 *     result[cur] = index[start:]
 */
    __pyx_v_cur = __pyx_v_lab;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1523
 *         cur = lab
 * 
 *     result[cur] = index[start:]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_3 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_index), __pyx_v_start, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemInt(((PyObject *)__pyx_v_result), __pyx_v_cur, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1524
 * 
 *     result[cur] = index[start:]
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def indices_fast(object index, ndarray[int64_t] labels, list keys,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.groupby_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_index);
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1526
 *     return result
 * 
 * def indices_fast(object index, ndarray[int64_t] labels, list keys,             # <<<<<<<<<<<<<<
 *                  list sorted_labels):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_93indices_fast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_93indices_fast = {__Pyx_NAMESTR("indices_fast"), (PyCFunction)__pyx_pf_6pandas_3lib_93indices_fast, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_93indices_fast(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyArrayObject *__pyx_v_labels = 0;
  PyObject *__pyx_v_keys = 0;
  PyObject *__pyx_v_sorted_labels = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_lab;
  Py_ssize_t __pyx_v_cur;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_tup = 0;
  PyObject *__pyx_v_val = NULL;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__labels,&__pyx_n_s__keys,&__pyx_n_s__sorted_labels,0};
  __Pyx_RefNannySetupContext("indices_fast");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__keys);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sorted_labels);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "indices_fast") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_index = values[0];
    __pyx_v_labels = ((PyArrayObject *)values[1]);
    __pyx_v_keys = ((PyObject*)values[2]);
    __pyx_v_sorted_labels = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("indices_fast", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.indices_fast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_labels.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_labels), __pyx_ptype_5numpy_ndarray, 1, "labels", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sorted_labels), (&PyList_Type), 1, "sorted_labels", 1))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
  __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1529
 *                  list sorted_labels):
 *     cdef:
 *         Py_ssize_t i, j, k, lab, cur, start, n = len(labels)             # <<<<<<<<<<<<<<
 *         dict result = {}
 *         object tup
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_labels)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1530
 *     cdef:
 *         Py_ssize_t i, j, k, lab, cur, start, n = len(labels)
 *         dict result = {}             # <<<<<<<<<<<<<<
 *         object tup
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1533
 *         object tup
 * 
 *     k = len(keys)             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  if (unlikely(((PyObject *)__pyx_v_keys) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_keys)); 
  __pyx_v_k = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1535
 *     k = len(keys)
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_3 = (__pyx_v_n == 0);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1536
 * 
 *     if n == 0:
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     start = 0
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = ((PyObject *)__pyx_v_result);
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1538
 *         return result
 * 
 *     start = 0             # <<<<<<<<<<<<<<
 *     cur = labels[0]
 *     for i in range(1, n):
 */
  __pyx_v_start = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1539
 * 
 *     start = 0
 *     cur = labels[0]             # <<<<<<<<<<<<<<
 *     for i in range(1, n):
 *         lab = labels[i]
 */
  __pyx_t_4 = 0;
  __pyx_t_5 = -1;
  if (__pyx_t_4 < 0) {
    __pyx_t_4 += __pyx_bshape_0_labels;
    if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
  } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_labels)) __pyx_t_5 = 0;
  if (unlikely(__pyx_t_5 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_5);
    {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_4, __pyx_bstride_0_labels));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1540
 *     start = 0
 *     cur = labels[0]
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         lab = labels[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1541
 *     cur = labels[0]
 *     for i in range(1, n):
 *         lab = labels[i]             # <<<<<<<<<<<<<<
 * 
 *         if lab != cur:
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_7 < 0) {
      __pyx_t_7 += __pyx_bshape_0_labels;
      if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_labels)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_7, __pyx_bstride_0_labels));

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1543
 *         lab = labels[i]
 * 
 *         if lab != cur:             # <<<<<<<<<<<<<<
 *             if lab != -1:
 *                 tup = PyTuple_New(k)
 */
    __pyx_t_3 = (__pyx_v_lab != __pyx_v_cur);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1544
 * 
 *         if lab != cur:
 *             if lab != -1:             # <<<<<<<<<<<<<<
 *                 tup = PyTuple_New(k)
 *                 for j in range(k):
 */
      __pyx_t_3 = (__pyx_v_lab != -1);
      if (__pyx_t_3) {

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1545
 *         if lab != cur:
 *             if lab != -1:
 *                 tup = PyTuple_New(k)             # <<<<<<<<<<<<<<
 *                 for j in range(k):
 *                     val = util.get_value_at(keys[j],
 */
        __pyx_t_2 = ((PyObject *)PyTuple_New(__pyx_v_k)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_XDECREF(__pyx_v_tup);
        __pyx_v_tup = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1546
 *             if lab != -1:
 *                 tup = PyTuple_New(k)
 *                 for j in range(k):             # <<<<<<<<<<<<<<
 *                     val = util.get_value_at(keys[j],
 *                                             sorted_labels[j][i-1])
 */
        __pyx_t_8 = __pyx_v_k;
        for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
          __pyx_v_j = __pyx_t_9;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1547
 *                 tup = PyTuple_New(k)
 *                 for j in range(k):
 *                     val = util.get_value_at(keys[j],             # <<<<<<<<<<<<<<
 *                                             sorted_labels[j][i-1])
 *                     PyTuple_SET_ITEM(tup, j, val)
 */
          __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_keys), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1548
 *                 for j in range(k):
 *                     val = util.get_value_at(keys[j],
 *                                             sorted_labels[j][i-1])             # <<<<<<<<<<<<<<
 *                     PyTuple_SET_ITEM(tup, j, val)
 *                     Py_INCREF(val)
 */
          __pyx_t_10 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_sorted_labels), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_10) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = (__pyx_v_i - 1);
          __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_10, __pyx_t_11, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_12) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __pyx_t_10 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_2), __pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_v_val);
          __pyx_v_val = __pyx_t_10;
          __pyx_t_10 = 0;

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1549
 *                     val = util.get_value_at(keys[j],
 *                                             sorted_labels[j][i-1])
 *                     PyTuple_SET_ITEM(tup, j, val)             # <<<<<<<<<<<<<<
 *                     Py_INCREF(val)
 * 
 */
          PyTuple_SET_ITEM(__pyx_v_tup, __pyx_v_j, __pyx_v_val);

          /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1550
 *                                             sorted_labels[j][i-1])
 *                     PyTuple_SET_ITEM(tup, j, val)
 *                     Py_INCREF(val)             # <<<<<<<<<<<<<<
 * 
 *                 result[tup] = index[start:i]
 */
          Py_INCREF(__pyx_v_val);
        }

        /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1552
 *                     Py_INCREF(val)
 * 
 *                 result[tup] = index[start:i]             # <<<<<<<<<<<<<<
 *             start = i
 *         cur = lab
 */
        __pyx_t_10 = __Pyx_PySequence_GetSlice(__pyx_v_index, __pyx_v_start, __pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_v_tup, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1553
 * 
 *                 result[tup] = index[start:i]
 *             start = i             # <<<<<<<<<<<<<<
 *         cur = lab
 * 
 */
      __pyx_v_start = __pyx_v_i;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1554
 *                 result[tup] = index[start:i]
 *             start = i
 *         cur = lab             # <<<<<<<<<<<<<<
 * 
 *     tup = PyTuple_New(k)
 */
    __pyx_v_cur = __pyx_v_lab;
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1556
 *         cur = lab
 * 
 *     tup = PyTuple_New(k)             # <<<<<<<<<<<<<<
 *     for j in range(k):
 *         val = util.get_value_at(keys[j],
 */
  __pyx_t_10 = ((PyObject *)PyTuple_New(__pyx_v_k)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_v_tup);
  __pyx_v_tup = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1557
 * 
 *     tup = PyTuple_New(k)
 *     for j in range(k):             # <<<<<<<<<<<<<<
 *         val = util.get_value_at(keys[j],
 *                                 sorted_labels[j][n - 1])
 */
  __pyx_t_1 = __pyx_v_k;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_1; __pyx_t_6+=1) {
    __pyx_v_j = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1558
 *     tup = PyTuple_New(k)
 *     for j in range(k):
 *         val = util.get_value_at(keys[j],             # <<<<<<<<<<<<<<
 *                                 sorted_labels[j][n - 1])
 *         PyTuple_SET_ITEM(tup, j, val)
 */
    __pyx_t_10 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_keys), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_10) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1559
 *     for j in range(k):
 *         val = util.get_value_at(keys[j],
 *                                 sorted_labels[j][n - 1])             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(tup, j, val)
 *         Py_INCREF(val)
 */
    __pyx_t_12 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_sorted_labels), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_12) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_8 = (__pyx_v_n - 1);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_12, __pyx_t_8, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_10), __pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_12;
    __pyx_t_12 = 0;

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1560
 *         val = util.get_value_at(keys[j],
 *                                 sorted_labels[j][n - 1])
 *         PyTuple_SET_ITEM(tup, j, val)             # <<<<<<<<<<<<<<
 *         Py_INCREF(val)
 *     result[tup] = index[start:]
 */
    PyTuple_SET_ITEM(__pyx_v_tup, __pyx_v_j, __pyx_v_val);

    /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1561
 *                                 sorted_labels[j][n - 1])
 *         PyTuple_SET_ITEM(tup, j, val)
 *         Py_INCREF(val)             # <<<<<<<<<<<<<<
 *     result[tup] = index[start:]
 * 
 */
    Py_INCREF(__pyx_v_val);
  }

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1562
 *         PyTuple_SET_ITEM(tup, j, val)
 *         Py_INCREF(val)
 *     result[tup] = index[start:]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_t_12 = __Pyx_PySequence_GetSlice(__pyx_v_index, __pyx_v_start, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_v_tup, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1564
 *     result[tup] = index[start:]
 * 
 *     return result             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.indices_fast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":28
 * 
 * 
 * def kth_smallest(ndarray[double_t] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i,j,l,m,n
 */

static PyObject *__pyx_pf_6pandas_3lib_94kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_94kth_smallest = {__Pyx_NAMESTR("kth_smallest"), (PyCFunction)__pyx_pf_6pandas_3lib_94kth_smallest, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_94kth_smallest(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_a = 0;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_l;
  Py_ssize_t __pyx_v_m;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_double_t __pyx_v_x;
  __pyx_t_5numpy_double_t __pyx_v_t;
  Py_buffer __pyx_bstruct_a;
  Py_ssize_t __pyx_bstride_0_a = 0;
  Py_ssize_t __pyx_bshape_0_a = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__k,0};
  __Pyx_RefNannySetupContext("kth_smallest");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__k);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("kth_smallest", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "kth_smallest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_a = ((PyArrayObject *)values[0]);
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("kth_smallest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_a.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_a, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_a = __pyx_bstruct_a.strides[0];
  __pyx_bshape_0_a = __pyx_bstruct_a.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":33
 *         double_t x, t
 * 
 *     n = len(a)             # <<<<<<<<<<<<<<
 * 
 *     l = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_a)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":35
 *     n = len(a)
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n-1
 *     while (l<m):
 */
  __pyx_v_l = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":36
 * 
 *     l = 0
 *     m = n-1             # <<<<<<<<<<<<<<
 *     while (l<m):
 *         x = a[k]
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":37
 *     l = 0
 *     m = n-1
 *     while (l<m):             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_l < __pyx_v_m);
    if (!__pyx_t_2) break;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":38
 *     m = n-1
 *     while (l<m):
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_t_1 = __pyx_v_k;
    __pyx_t_3 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_a;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_a)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_x = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_a.buf, __pyx_t_1, __pyx_bstride_0_a));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":39
 *     while (l<m):
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":40
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":42
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {
      if (!1) break;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":43
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_4 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_4 < 0) {
          __pyx_t_4 += __pyx_bshape_0_a;
          if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_a)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_2 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_a.buf, __pyx_t_4, __pyx_bstride_0_a)) < __pyx_v_x);
        if (!__pyx_t_2) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":44
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 t = a[i]
 */
      while (1) {
        __pyx_t_5 = __pyx_v_j;
        __pyx_t_3 = -1;
        if (__pyx_t_5 < 0) {
          __pyx_t_5 += __pyx_bshape_0_a;
          if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_5 >= __pyx_bshape_0_a)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_2 = (__pyx_v_x < (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_a.buf, __pyx_t_5, __pyx_bstride_0_a)));
        if (!__pyx_t_2) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":45
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 t = a[i]
 *                 a[i] = a[j]
 */
      __pyx_t_2 = (__pyx_v_i <= __pyx_v_j);
      if (__pyx_t_2) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":46
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 t = a[i]             # <<<<<<<<<<<<<<
 *                 a[i] = a[j]
 *                 a[j] = t
 */
        __pyx_t_6 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_6 < 0) {
          __pyx_t_6 += __pyx_bshape_0_a;
          if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_a)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_t = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_a.buf, __pyx_t_6, __pyx_bstride_0_a));

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":47
 *             if i <= j:
 *                 t = a[i]
 *                 a[i] = a[j]             # <<<<<<<<<<<<<<
 *                 a[j] = t
 *                 i += 1; j -= 1
 */
        __pyx_t_7 = __pyx_v_j;
        __pyx_t_3 = -1;
        if (__pyx_t_7 < 0) {
          __pyx_t_7 += __pyx_bshape_0_a;
          if (unlikely(__pyx_t_7 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_a)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_8 = __pyx_v_i;
        __pyx_t_3 = -1;
        if (__pyx_t_8 < 0) {
          __pyx_t_8 += __pyx_bshape_0_a;
          if (unlikely(__pyx_t_8 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_8 >= __pyx_bshape_0_a)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_a.buf, __pyx_t_8, __pyx_bstride_0_a) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_a.buf, __pyx_t_7, __pyx_bstride_0_a));

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":48
 *                 t = a[i]
 *                 a[i] = a[j]
 *                 a[j] = t             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        __pyx_t_9 = __pyx_v_j;
        __pyx_t_3 = -1;
        if (__pyx_t_9 < 0) {
          __pyx_t_9 += __pyx_bshape_0_a;
          if (unlikely(__pyx_t_9 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_a)) __pyx_t_3 = 0;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_a.buf, __pyx_t_9, __pyx_bstride_0_a) = __pyx_v_t;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":49
 *                 a[i] = a[j]
 *                 a[j] = t
 *                 i += 1; j -= 1             # <<<<<<<<<<<<<<
 * 
 *             if i > j: break
 */
        __pyx_v_i = (__pyx_v_i + 1);
        __pyx_v_j = (__pyx_v_j - 1);
        goto __pyx_L14;
      }
      __pyx_L14:;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":51
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_2 = (__pyx_v_i > __pyx_v_j);
      if (__pyx_t_2) {
        goto __pyx_L9_break;
        goto __pyx_L15;
      }
      __pyx_L15:;
    }
    __pyx_L9_break:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":53
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_2 = (__pyx_v_j < __pyx_v_k);
    if (__pyx_t_2) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":54
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_2 = (__pyx_v_k < __pyx_v_i);
    if (__pyx_t_2) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L17;
    }
    __pyx_L17:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":55
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = __pyx_v_k;
  __pyx_t_3 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_bshape_0_a;
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_3 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_a)) __pyx_t_3 = 0;
  if (unlikely(__pyx_t_3 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_3);
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = PyFloat_FromDouble((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_a.buf, __pyx_t_10, __pyx_bstride_0_a))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_11);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_a);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.kth_smallest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_a);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":57
 *     return a[k]
 * 
 * cdef inline kth_smallest_c(float64_t* a, Py_ssize_t k, Py_ssize_t n):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i,j,l,m
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_kth_smallest_c(__pyx_t_5numpy_float64_t *__pyx_v_a, Py_ssize_t __pyx_v_k, Py_ssize_t __pyx_v_n) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_l;
  Py_ssize_t __pyx_v_m;
  __pyx_t_5numpy_double_t __pyx_v_x;
  __pyx_t_5numpy_double_t __pyx_v_t;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("kth_smallest_c");

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":62
 *         double_t x, t
 * 
 *     l = 0             # <<<<<<<<<<<<<<
 *     m = n-1
 *     while (l<m):
 */
  __pyx_v_l = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":63
 * 
 *     l = 0
 *     m = n-1             # <<<<<<<<<<<<<<
 *     while (l<m):
 *         x = a[k]
 */
  __pyx_v_m = (__pyx_v_n - 1);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":64
 *     l = 0
 *     m = n-1
 *     while (l<m):             # <<<<<<<<<<<<<<
 *         x = a[k]
 *         i = l
 */
  while (1) {
    __pyx_t_1 = (__pyx_v_l < __pyx_v_m);
    if (!__pyx_t_1) break;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":65
 *     m = n-1
 *     while (l<m):
 *         x = a[k]             # <<<<<<<<<<<<<<
 *         i = l
 *         j = m
 */
    __pyx_v_x = (__pyx_v_a[__pyx_v_k]);

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":66
 *     while (l<m):
 *         x = a[k]
 *         i = l             # <<<<<<<<<<<<<<
 *         j = m
 * 
 */
    __pyx_v_i = __pyx_v_l;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":67
 *         x = a[k]
 *         i = l
 *         j = m             # <<<<<<<<<<<<<<
 * 
 *         while 1:
 */
    __pyx_v_j = __pyx_v_m;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":69
 *         j = m
 * 
 *         while 1:             # <<<<<<<<<<<<<<
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 */
    while (1) {
      if (!1) break;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":70
 * 
 *         while 1:
 *             while a[i] < x: i += 1             # <<<<<<<<<<<<<<
 *             while x < a[j]: j -= 1
 *             if i <= j:
 */
      while (1) {
        __pyx_t_1 = ((__pyx_v_a[__pyx_v_i]) < __pyx_v_x);
        if (!__pyx_t_1) break;
        __pyx_v_i = (__pyx_v_i + 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":71
 *         while 1:
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1             # <<<<<<<<<<<<<<
 *             if i <= j:
 *                 t = a[i]
 */
      while (1) {
        __pyx_t_1 = (__pyx_v_x < (__pyx_v_a[__pyx_v_j]));
        if (!__pyx_t_1) break;
        __pyx_v_j = (__pyx_v_j - 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":72
 *             while a[i] < x: i += 1
 *             while x < a[j]: j -= 1
 *             if i <= j:             # <<<<<<<<<<<<<<
 *                 t = a[i]
 *                 a[i] = a[j]
 */
      __pyx_t_1 = (__pyx_v_i <= __pyx_v_j);
      if (__pyx_t_1) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":73
 *             while x < a[j]: j -= 1
 *             if i <= j:
 *                 t = a[i]             # <<<<<<<<<<<<<<
 *                 a[i] = a[j]
 *                 a[j] = t
 */
        __pyx_v_t = (__pyx_v_a[__pyx_v_i]);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":74
 *             if i <= j:
 *                 t = a[i]
 *                 a[i] = a[j]             # <<<<<<<<<<<<<<
 *                 a[j] = t
 *                 i += 1; j -= 1
 */
        (__pyx_v_a[__pyx_v_i]) = (__pyx_v_a[__pyx_v_j]);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":75
 *                 t = a[i]
 *                 a[i] = a[j]
 *                 a[j] = t             # <<<<<<<<<<<<<<
 *                 i += 1; j -= 1
 * 
 */
        (__pyx_v_a[__pyx_v_j]) = __pyx_v_t;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":76
 *                 a[i] = a[j]
 *                 a[j] = t
 *                 i += 1; j -= 1             # <<<<<<<<<<<<<<
 * 
 *             if i > j: break
 */
        __pyx_v_i = (__pyx_v_i + 1);
        __pyx_v_j = (__pyx_v_j - 1);
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":78
 *                 i += 1; j -= 1
 * 
 *             if i > j: break             # <<<<<<<<<<<<<<
 * 
 *         if j < k: l = i
 */
      __pyx_t_1 = (__pyx_v_i > __pyx_v_j);
      if (__pyx_t_1) {
        goto __pyx_L6_break;
        goto __pyx_L12;
      }
      __pyx_L12:;
    }
    __pyx_L6_break:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":80
 *             if i > j: break
 * 
 *         if j < k: l = i             # <<<<<<<<<<<<<<
 *         if k < i: m = j
 *     return a[k]
 */
    __pyx_t_1 = (__pyx_v_j < __pyx_v_k);
    if (__pyx_t_1) {
      __pyx_v_l = __pyx_v_i;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":81
 * 
 *         if j < k: l = i
 *         if k < i: m = j             # <<<<<<<<<<<<<<
 *     return a[k]
 * 
 */
    __pyx_t_1 = (__pyx_v_k < __pyx_v_i);
    if (__pyx_t_1) {
      __pyx_v_m = __pyx_v_j;
      goto __pyx_L14;
    }
    __pyx_L14:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":82
 *         if j < k: l = i
 *         if k < i: m = j
 *     return a[k]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_a[__pyx_v_k])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.kth_smallest_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":85
 * 
 * 
 * def median(ndarray arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */

static PyObject *__pyx_pf_6pandas_3lib_95median(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static char __pyx_doc_6pandas_3lib_95median[] = "\n    A faster median\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_95median = {__Pyx_NAMESTR("median"), (PyCFunction)__pyx_pf_6pandas_3lib_95median, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_95median)};
static PyObject *__pyx_pf_6pandas_3lib_95median(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  int __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("median");
  __pyx_self = __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_v_arr);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":89
 *     A faster median
 *     '''
 *     cdef int n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if len(arr) == 0:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":91
 *     cdef int n = len(arr)
 * 
 *     if len(arr) == 0:             # <<<<<<<<<<<<<<
 *         return np.NaN
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 == 0);
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":92
 * 
 *     if len(arr) == 0:
 *         return np.NaN             # <<<<<<<<<<<<<<
 * 
 *     arr = arr.copy()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__NaN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":94
 *         return np.NaN
 * 
 *     arr = arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if n % 2:
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_v_arr);
  __pyx_v_arr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":96
 *     arr = arr.copy()
 * 
 *     if n % 2:             # <<<<<<<<<<<<<<
 *         return kth_smallest(arr, n / 2)
 *     else:
 */
  __pyx_t_5 = __Pyx_mod_long(__pyx_v_n, 2);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":97
 * 
 *     if n % 2:
 *         return kth_smallest(arr, n / 2)             # <<<<<<<<<<<<<<
 *     else:
 *         return (kth_smallest(arr, n / 2) +
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__kth_smallest); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyInt_FromLong(__Pyx_div_long(__pyx_v_n, 2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":99
 *         return kth_smallest(arr, n / 2)
 *     else:
 *         return (kth_smallest(arr, n / 2) +             # <<<<<<<<<<<<<<
 *                 kth_smallest(arr, n / 2 - 1)) / 2
 * 
 */
    __Pyx_XDECREF(__pyx_r);

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":100
 *     else:
 *         return (kth_smallest(arr, n / 2) +
 *                 kth_smallest(arr, n / 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__kth_smallest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":99
 *         return kth_smallest(arr, n / 2)
 *     else:
 *         return (kth_smallest(arr, n / 2) +             # <<<<<<<<<<<<<<
 *                 kth_smallest(arr, n / 2 - 1)) / 2
 * 
 */
    __pyx_t_6 = PyInt_FromLong(__Pyx_div_long(__pyx_v_n, 2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":100
 *     else:
 *         return (kth_smallest(arr, n / 2) +
 *                 kth_smallest(arr, n / 2 - 1)) / 2             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__kth_smallest); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyInt_FromLong((__Pyx_div_long(__pyx_v_n, 2) - 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __Pyx_INCREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_arr);
    __Pyx_GIVEREF(__pyx_v_arr);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pandas.lib.median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":105
 * # -------------- Min, Max subsequence
 * 
 * def max_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n
 */

static PyObject *__pyx_pf_6pandas_3lib_96max_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_96max_subseq = {__Pyx_NAMESTR("max_subseq"), (PyCFunction)__pyx_pf_6pandas_3lib_96max_subseq, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_96max_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_s;
  Py_ssize_t __pyx_v_e;
  Py_ssize_t __pyx_v_T;
  Py_ssize_t __pyx_v_n;
  double __pyx_v_m;
  double __pyx_v_S;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("max_subseq");
  __pyx_self = __pyx_self;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":107
 * def max_subseq(ndarray[double_t] arr):
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n             # <<<<<<<<<<<<<<
 *         double m, S
 * 
 */
  __pyx_v_i = 0;
  __pyx_v_s = 0;
  __pyx_v_e = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":110
 *         double m, S
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 * 
 *     if len(arr) == 0:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":112
 *     n = len(arr)
 * 
 *     if len(arr) == 0:             # <<<<<<<<<<<<<<
 *         return (-1,-1,None)
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 == 0);
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":113
 * 
 *     if len(arr) == 0:
 *         return (-1,-1,None)             # <<<<<<<<<<<<<<
 * 
 *     m = arr[0]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_k_tuple_94));
    __pyx_r = ((PyObject *)__pyx_k_tuple_94);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":115
 *         return (-1,-1,None)
 * 
 *     m = arr[0]             # <<<<<<<<<<<<<<
 *     S = m
 *     T = 0
 */
  __pyx_t_3 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_3 < 0) {
    __pyx_t_3 += __pyx_bshape_0_arr;
    if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_arr)) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_m = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_arr.buf, __pyx_t_3, __pyx_bstride_0_arr));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":116
 * 
 *     m = arr[0]
 *     S = m             # <<<<<<<<<<<<<<
 *     T = 0
 * 
 */
  __pyx_v_S = __pyx_v_m;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":117
 *     m = arr[0]
 *     S = m
 *     T = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, n):
 */
  __pyx_v_T = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":119
 *     T = 0
 * 
 *     for i in range(1, n):             # <<<<<<<<<<<<<<
 *         # S = max { S + A[i], A[i] )
 *         if (S > 0):
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":121
 *     for i in range(1, n):
 *         # S = max { S + A[i], A[i] )
 *         if (S > 0):             # <<<<<<<<<<<<<<
 *             S = S + arr[i]
 *         else:
 */
    __pyx_t_2 = (__pyx_v_S > 0.0);
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":122
 *         # S = max { S + A[i], A[i] )
 *         if (S > 0):
 *             S = S + arr[i]             # <<<<<<<<<<<<<<
 *         else:
 *             S = arr[i]
 */
      __pyx_t_6 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_6 < 0) {
        __pyx_t_6 += __pyx_bshape_0_arr;
        if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_arr)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_S = (__pyx_v_S + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_arr.buf, __pyx_t_6, __pyx_bstride_0_arr)));
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":124
 *             S = S + arr[i]
 *         else:
 *             S = arr[i]             # <<<<<<<<<<<<<<
 *             T = i
 *         if S > m:
 */
      __pyx_t_7 = __pyx_v_i;
      __pyx_t_4 = -1;
      if (__pyx_t_7 < 0) {
        __pyx_t_7 += __pyx_bshape_0_arr;
        if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_arr)) __pyx_t_4 = 0;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_S = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_arr.buf, __pyx_t_7, __pyx_bstride_0_arr));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":125
 *         else:
 *             S = arr[i]
 *             T = i             # <<<<<<<<<<<<<<
 *         if S > m:
 *             s = T
 */
      __pyx_v_T = __pyx_v_i;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":126
 *             S = arr[i]
 *             T = i
 *         if S > m:             # <<<<<<<<<<<<<<
 *             s = T
 *             e = i
 */
    __pyx_t_2 = (__pyx_v_S > __pyx_v_m);
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":127
 *             T = i
 *         if S > m:
 *             s = T             # <<<<<<<<<<<<<<
 *             e = i
 *             m = S
 */
      __pyx_v_s = __pyx_v_T;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":128
 *         if S > m:
 *             s = T
 *             e = i             # <<<<<<<<<<<<<<
 *             m = S
 * 
 */
      __pyx_v_e = __pyx_v_i;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":129
 *             s = T
 *             e = i
 *             m = S             # <<<<<<<<<<<<<<
 * 
 *     return (s, e, m)
 */
      __pyx_v_m = __pyx_v_S;
      goto __pyx_L9;
    }
    __pyx_L9:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":131
 *             m = S
 * 
 *     return (s, e, m)             # <<<<<<<<<<<<<<
 * 
 * def min_subseq(ndarray[double_t] arr):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_s); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_e); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyFloat_FromDouble(__pyx_v_m); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_r = ((PyObject *)__pyx_t_11);
  __pyx_t_11 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.max_subseq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":133
 *     return (s, e, m)
 * 
 * def min_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t s, e
 */

static PyObject *__pyx_pf_6pandas_3lib_97min_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_97min_subseq = {__Pyx_NAMESTR("min_subseq"), (PyCFunction)__pyx_pf_6pandas_3lib_97min_subseq, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_97min_subseq(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_s;
  Py_ssize_t __pyx_v_e;
  double __pyx_v_m;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  double __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("min_subseq");
  __pyx_self = __pyx_self;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":138
 *         double m
 * 
 *     (s, e, m) = max_subseq(-arr)             # <<<<<<<<<<<<<<
 * 
 *     return (s, e, -m)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__max_subseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Negative(__pyx_v_arr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 3)) {
        if (PyTuple_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 3)) {
        if (PyList_GET_SIZE(sequence) > 3) __Pyx_RaiseTooManyValuesError(3);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_s = __pyx_t_7;
  __pyx_v_e = __pyx_t_8;
  __pyx_v_m = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":140
 *     (s, e, m) = max_subseq(-arr)
 * 
 *     return (s, e, -m)             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_e); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyFloat_FromDouble((-__pyx_v_m)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.min_subseq", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":145
 * # Rolling sum
 * 
 * def roll_sum(ndarray[double_t] input, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, prev, sum_x = 0
 *     cdef int nobs = 0, i
 */

static PyObject *__pyx_pf_6pandas_3lib_98roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_98roll_sum = {__Pyx_NAMESTR("roll_sum"), (PyCFunction)__pyx_pf_6pandas_3lib_98roll_sum, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_98roll_sum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  double __pyx_v_val;
  double __pyx_v_prev;
  double __pyx_v_sum_x;
  int __pyx_v_nobs;
  int __pyx_v_i;
  int __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_sum");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_sum") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_sum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_input.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
  __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":146
 * 
 * def roll_sum(ndarray[double_t] input, int win, int minp):
 *     cdef double val, prev, sum_x = 0             # <<<<<<<<<<<<<<
 *     cdef int nobs = 0, i
 *     cdef int N = len(input)
 */
  __pyx_v_sum_x = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":147
 * def roll_sum(ndarray[double_t] input, int win, int minp):
 *     cdef double val, prev, sum_x = 0
 *     cdef int nobs = 0, i             # <<<<<<<<<<<<<<
 *     cdef int N = len(input)
 * 
 */
  __pyx_v_nobs = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":148
 *     cdef double val, prev, sum_x = 0
 *     cdef int nobs = 0, i
 *     cdef int N = len(input)             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":150
 *     cdef int N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, N)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":152
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     minp = _check_minp(minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":154
 *     minp = _check_minp(minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_8 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":155
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_7 < 0) {
      __pyx_t_7 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_input)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_7, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":158
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_10 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":159
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":160
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":162
 *             sum_x += val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_11 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_output)) __pyx_t_11 = 0;
    if (unlikely(__pyx_t_11 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_11);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_9, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":164
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":165
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_input)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_12, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":167
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_10 = (__pyx_v_i > (__pyx_v_win - 1));
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":168
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 sum_x -= prev
 */
      __pyx_t_13 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_14 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_input;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_input)) __pyx_t_14 = 0;
      if (unlikely(__pyx_t_14 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_14);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_13, __pyx_bstride_0_input));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":169
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 sum_x -= prev
 *                 nobs -= 1
 */
      __pyx_t_10 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_10) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":170
 *             prev = input[i - win]
 *             if prev == prev:
 *                 sum_x -= prev             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":171
 *             if prev == prev:
 *                 sum_x -= prev
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":173
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_10 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":174
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":175
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":177
 *             sum_x += val
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = sum_x
 *         else:
 */
    __pyx_t_10 = (__pyx_v_nobs >= __pyx_v_minp);
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":178
 * 
 *         if nobs >= minp:
 *             output[i] = sum_x             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_output)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_14, __pyx_bstride_0_output) = __pyx_v_sum_x;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":180
 *             output[i] = sum_x
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_16 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_output)) __pyx_t_16 = 0;
      if (unlikely(__pyx_t_16 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_16);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_15, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L14:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":182
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":187
 * # Rolling mean
 * 
 * def roll_mean(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev, sum_x = 0
 */

static PyObject *__pyx_pf_6pandas_3lib_99roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_99roll_mean = {__Pyx_NAMESTR("roll_mean"), (PyCFunction)__pyx_pf_6pandas_3lib_99roll_mean, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_99roll_mean(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  double __pyx_v_val;
  double __pyx_v_prev;
  double __pyx_v_sum_x;
  Py_ssize_t __pyx_v_nobs;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_mean");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_mean") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_mean", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_input.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
  __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":189
 * def roll_mean(ndarray[double_t] input,
 *                int win, int minp):
 *     cdef double val, prev, sum_x = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t nobs = 0, i
 *     cdef Py_ssize_t N = len(input)
 */
  __pyx_v_sum_x = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":190
 *                int win, int minp):
 *     cdef double val, prev, sum_x = 0
 *     cdef Py_ssize_t nobs = 0, i             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t N = len(input)
 * 
 */
  __pyx_v_nobs = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":191
 *     cdef double val, prev, sum_x = 0
 *     cdef Py_ssize_t nobs = 0, i
 *     cdef Py_ssize_t N = len(input)             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":193
 *     cdef Py_ssize_t N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, N)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":195
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     minp = _check_minp(minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":197
 *     minp = _check_minp(minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_8 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":198
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_1, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":201
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":202
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":203
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":205
 *             sum_x += val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":207
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":208
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_12, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":210
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_9 = (__pyx_v_i > (__pyx_v_win - 1));
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":211
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 sum_x -= prev
 */
      __pyx_t_13 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_input;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_13, __pyx_bstride_0_input));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":212
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 sum_x -= prev
 *                 nobs -= 1
 */
      __pyx_t_9 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":213
 *             prev = input[i - win]
 *             if prev == prev:
 *                 sum_x -= prev             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":214
 *             if prev == prev:
 *                 sum_x -= prev
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":216
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":217
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":218
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":220
 *             sum_x += val
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = sum_x / nobs
 *         else:
 */
    __pyx_t_9 = (__pyx_v_nobs >= __pyx_v_minp);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":221
 * 
 *         if nobs >= minp:
 *             output[i] = sum_x / nobs             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_14, __pyx_bstride_0_output) = (__pyx_v_sum_x / __pyx_v_nobs);
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":223
 *             output[i] = sum_x / nobs
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_15, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L14:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":225
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_mean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":230
 * # Exponentially weighted moving average
 * 
 * def ewma(ndarray[double_t] input, double_t com, int adjust):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute exponentially-weighted moving average using center-of-mass.
 */

static PyObject *__pyx_pf_6pandas_3lib_100ewma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_100ewma[] = "\n    Compute exponentially-weighted moving average using center-of-mass.\n\n    Parameters\n    ----------\n    input : ndarray (float64 type)\n    com : float64\n\n    Returns\n    -------\n    y : ndarray\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_100ewma = {__Pyx_NAMESTR("ewma"), (PyCFunction)__pyx_pf_6pandas_3lib_100ewma, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_100ewma)};
static PyObject *__pyx_pf_6pandas_3lib_100ewma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  __pyx_t_5numpy_double_t __pyx_v_com;
  int __pyx_v_adjust;
  double __pyx_v_cur;
  double __pyx_v_prev;
  double __pyx_v_neww;
  double __pyx_v_oldw;
  double __pyx_v_adj;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  __pyx_t_5numpy_double_t __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  long __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  double __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__com,&__pyx_n_s__adjust,0};
  __Pyx_RefNannySetupContext("ewma");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__com);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__adjust);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "ewma") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_com = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_com == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_adjust = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_adjust == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ewma", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.ewma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_input.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
  __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":246
 *     cdef double cur, prev, neww, oldw, adj
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t N = len(input)             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":248
 *     cdef Py_ssize_t N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":251
 * 
 * 
 *     neww = 1. / (1. + com)             # <<<<<<<<<<<<<<
 *     oldw = 1. - neww
 *     adj = oldw
 */
  __pyx_t_7 = (1. + __pyx_v_com);
  if (unlikely(__pyx_t_7 == 0)) {
    PyErr_Format(PyExc_ZeroDivisionError, "float division");
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_neww = (1. / __pyx_t_7);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":252
 * 
 *     neww = 1. / (1. + com)
 *     oldw = 1. - neww             # <<<<<<<<<<<<<<
 *     adj = oldw
 * 
 */
  __pyx_v_oldw = (1. - __pyx_v_neww);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":253
 *     neww = 1. / (1. + com)
 *     oldw = 1. - neww
 *     adj = oldw             # <<<<<<<<<<<<<<
 * 
 *     output[0] = neww * input[0]
 */
  __pyx_v_adj = __pyx_v_oldw;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":255
 *     adj = oldw
 * 
 *     output[0] = neww * input[0]             # <<<<<<<<<<<<<<
 * 
 *     for i from 1 <= i < N:
 */
  __pyx_t_8 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_bshape_0_input;
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_bshape_0_input)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_10 < 0) {
    __pyx_t_10 += __pyx_bshape_0_output;
    if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_output)) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output) = (__pyx_v_neww * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_8, __pyx_bstride_0_input)));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":257
 *     output[0] = neww * input[0]
 * 
 *     for i from 1 <= i < N:             # <<<<<<<<<<<<<<
 *         cur = input[i]
 *         prev = output[i - 1]
 */
  __pyx_t_1 = __pyx_v_N;
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":258
 * 
 *     for i from 1 <= i < N:
 *         cur = input[i]             # <<<<<<<<<<<<<<
 *         prev = output[i - 1]
 * 
 */
    __pyx_t_11 = __pyx_v_i;
    __pyx_t_9 = -1;
    if (__pyx_t_11 < 0) {
      __pyx_t_11 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_input)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_11, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":259
 *     for i from 1 <= i < N:
 *         cur = input[i]
 *         prev = output[i - 1]             # <<<<<<<<<<<<<<
 * 
 *         if cur == cur:
 */
    __pyx_t_12 = (__pyx_v_i - 1);
    __pyx_t_9 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_output)) __pyx_t_9 = 0;
    if (unlikely(__pyx_t_9 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_9);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_12, __pyx_bstride_0_output));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":261
 *         prev = output[i - 1]
 * 
 *         if cur == cur:             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 output[i] = oldw * prev + neww * cur
 */
    __pyx_t_13 = (__pyx_v_cur == __pyx_v_cur);
    if (__pyx_t_13) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":262
 * 
 *         if cur == cur:
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 output[i] = oldw * prev + neww * cur
 *             else:
 */
      __pyx_t_13 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":263
 *         if cur == cur:
 *             if prev == prev:
 *                 output[i] = oldw * prev + neww * cur             # <<<<<<<<<<<<<<
 *             else:
 *                 output[i] = neww * cur
 */
        __pyx_t_14 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_14 < 0) {
          __pyx_t_14 += __pyx_bshape_0_output;
          if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_output)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_14, __pyx_bstride_0_output) = ((__pyx_v_oldw * __pyx_v_prev) + (__pyx_v_neww * __pyx_v_cur));
        goto __pyx_L9;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":265
 *                 output[i] = oldw * prev + neww * cur
 *             else:
 *                 output[i] = neww * cur             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = prev
 */
        __pyx_t_15 = __pyx_v_i;
        __pyx_t_9 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_bshape_0_output;
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_output)) __pyx_t_9 = 0;
        if (unlikely(__pyx_t_9 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_9);
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_15, __pyx_bstride_0_output) = (__pyx_v_neww * __pyx_v_cur);
      }
      __pyx_L9:;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":267
 *                 output[i] = neww * cur
 *         else:
 *             output[i] = prev             # <<<<<<<<<<<<<<
 * 
 *     if adjust:
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_output)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_16, __pyx_bstride_0_output) = __pyx_v_prev;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":269
 *             output[i] = prev
 * 
 *     if adjust:             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < N:
 *             cur = input[i]
 */
  if (__pyx_v_adjust) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":270
 * 
 *     if adjust:
 *         for i from 0 <= i < N:             # <<<<<<<<<<<<<<
 *             cur = input[i]
 *             output[i] = output[i] / (1. - adj)
 */
    __pyx_t_1 = __pyx_v_N;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":271
 *     if adjust:
 *         for i from 0 <= i < N:
 *             cur = input[i]             # <<<<<<<<<<<<<<
 *             output[i] = output[i] / (1. - adj)
 * 
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_input;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_input)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_cur = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_17, __pyx_bstride_0_input));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":272
 *         for i from 0 <= i < N:
 *             cur = input[i]
 *             output[i] = output[i] / (1. - adj)             # <<<<<<<<<<<<<<
 * 
 *             if cur == cur:
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_output)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_18, __pyx_bstride_0_output));
      __pyx_t_19 = (1. - __pyx_v_adj);
      if (unlikely(__pyx_t_19 == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_9 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_output)) __pyx_t_9 = 0;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_20, __pyx_bstride_0_output) = (__pyx_t_7 / __pyx_t_19);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":274
 *             output[i] = output[i] / (1. - adj)
 * 
 *             if cur == cur:             # <<<<<<<<<<<<<<
 *                 adj *= oldw
 * 
 */
      __pyx_t_13 = (__pyx_v_cur == __pyx_v_cur);
      if (__pyx_t_13) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":275
 * 
 *             if cur == cur:
 *                 adj *= oldw             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
        __pyx_v_adj = (__pyx_v_adj * __pyx_v_oldw);
        goto __pyx_L13;
      }
      __pyx_L13:;
    }
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":277
 *                 adj *= oldw
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.ewma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":284
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */

static PyObject *__pyx_pf_6pandas_3lib_101nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_101nancorr = {__Pyx_NAMESTR("nancorr"), (PyCFunction)__pyx_pf_6pandas_3lib_101nancorr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_101nancorr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_mat = 0;
  PyObject *__pyx_v_cov = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_xi;
  Py_ssize_t __pyx_v_yi;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_mask = 0;
  __pyx_t_5numpy_int64_t __pyx_v_nobs;
  __pyx_t_5numpy_float64_t __pyx_v_vx;
  __pyx_t_5numpy_float64_t __pyx_v_vy;
  __pyx_t_5numpy_float64_t __pyx_v_sumx;
  __pyx_t_5numpy_float64_t __pyx_v_sumy;
  __pyx_t_5numpy_float64_t __pyx_v_sumxx;
  __pyx_t_5numpy_float64_t __pyx_v_sumyy;
  __pyx_t_5numpy_float64_t __pyx_v_meanx;
  __pyx_t_5numpy_float64_t __pyx_v_meany;
  __pyx_t_5numpy_float64_t __pyx_v_divisor;
  Py_buffer __pyx_bstruct_mat;
  Py_ssize_t __pyx_bstride_0_mat = 0;
  Py_ssize_t __pyx_bstride_1_mat = 0;
  Py_ssize_t __pyx_bshape_0_mat = 0;
  Py_ssize_t __pyx_bshape_1_mat = 0;
  Py_buffer __pyx_bstruct_mask;
  Py_ssize_t __pyx_bstride_0_mask = 0;
  Py_ssize_t __pyx_bstride_1_mask = 0;
  Py_ssize_t __pyx_bshape_0_mask = 0;
  Py_ssize_t __pyx_bshape_1_mask = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  __pyx_t_5numpy_uint8_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __pyx_t_5numpy_uint8_t __pyx_t_24;
  int __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  __pyx_t_5numpy_float64_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  double __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  Py_ssize_t __pyx_t_49;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mat,&__pyx_n_s__cov,0};
  __Pyx_RefNannySetupContext("nancorr");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_95;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mat);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cov);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "nancorr") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_mat = ((PyArrayObject *)values[0]);
    __pyx_v_cov = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nancorr", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.nancorr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_mask.buf = NULL;
  __pyx_bstruct_mat.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_5numpy_ndarray, 1, "mat", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mat, (PyObject*)__pyx_v_mat, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_mat = __pyx_bstruct_mat.strides[0]; __pyx_bstride_1_mat = __pyx_bstruct_mat.strides[1];
  __pyx_bshape_0_mat = __pyx_bstruct_mat.shape[0]; __pyx_bshape_1_mat = __pyx_bstruct_mat.shape[1];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":289
 *         ndarray[float64_t, ndim=2] result
 *         ndarray[uint8_t, ndim=2] mask
 *         int64_t nobs = 0             # <<<<<<<<<<<<<<
 *         float64_t vx, vy, sumx, sumy, sumxx, sumyy, meanx, meany, divisor
 * 
 */
  __pyx_v_nobs = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":292
 *         float64_t vx, vy, sumx, sumy, sumxx, sumyy, meanx, meany, divisor
 * 
 *     N, K = (<object> mat).shape             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty((K, K), dtype=np.float64)
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_mat), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_N = __pyx_t_6;
  __pyx_v_K = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":294
 *     N, K = (<object> mat).shape
 * 
 *     result = np.empty((K, K), dtype=np.float64)             # <<<<<<<<<<<<<<
 *     mask = np.isfinite(mat).view(np.uint8)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":295
 * 
 *     result = np.empty((K, K), dtype=np.float64)
 *     mask = np.isfinite(mat).view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     for xi in range(K):
 */
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__isfinite); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  __Pyx_INCREF(((PyObject *)__pyx_v_mat));
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_mat));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_mat));
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__view); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
      }
    }
    __pyx_bstride_0_mask = __pyx_bstruct_mask.strides[0]; __pyx_bstride_1_mask = __pyx_bstruct_mask.strides[1];
    __pyx_bshape_0_mask = __pyx_bstruct_mask.shape[0]; __pyx_bshape_1_mask = __pyx_bstruct_mask.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":297
 *     mask = np.isfinite(mat).view(np.uint8)
 * 
 *     for xi in range(K):             # <<<<<<<<<<<<<<
 *         for yi in range(xi + 1):
 *             nobs = sumxx = sumyy = sumx = sumy = 0
 */
  __pyx_t_7 = __pyx_v_K;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_7; __pyx_t_6+=1) {
    __pyx_v_xi = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":298
 * 
 *     for xi in range(K):
 *         for yi in range(xi + 1):             # <<<<<<<<<<<<<<
 *             nobs = sumxx = sumyy = sumx = sumy = 0
 *             for i in range(N):
 */
    __pyx_t_15 = (__pyx_v_xi + 1);
    for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
      __pyx_v_yi = __pyx_t_16;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":299
 *     for xi in range(K):
 *         for yi in range(xi + 1):
 *             nobs = sumxx = sumyy = sumx = sumy = 0             # <<<<<<<<<<<<<<
 *             for i in range(N):
 *                 if mask[i, xi] and mask[i, yi]:
 */
      __pyx_v_nobs = 0;
      __pyx_v_sumxx = 0;
      __pyx_v_sumyy = 0;
      __pyx_v_sumx = 0;
      __pyx_v_sumy = 0;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":300
 *         for yi in range(xi + 1):
 *             nobs = sumxx = sumyy = sumx = sumy = 0
 *             for i in range(N):             # <<<<<<<<<<<<<<
 *                 if mask[i, xi] and mask[i, yi]:
 *                     vx = mat[i, xi]
 */
      __pyx_t_17 = __pyx_v_N;
      for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
        __pyx_v_i = __pyx_t_18;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":301
 *             nobs = sumxx = sumyy = sumx = sumy = 0
 *             for i in range(N):
 *                 if mask[i, xi] and mask[i, yi]:             # <<<<<<<<<<<<<<
 *                     vx = mat[i, xi]
 *                     vy = mat[i, yi]
 */
        __pyx_t_19 = __pyx_v_i;
        __pyx_t_20 = __pyx_v_xi;
        __pyx_t_21 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_19, __pyx_bstride_0_mask, __pyx_t_20, __pyx_bstride_1_mask));
        if (__pyx_t_21) {
          __pyx_t_22 = __pyx_v_i;
          __pyx_t_23 = __pyx_v_yi;
          __pyx_t_24 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_22, __pyx_bstride_0_mask, __pyx_t_23, __pyx_bstride_1_mask));
          __pyx_t_25 = __pyx_t_24;
        } else {
          __pyx_t_25 = __pyx_t_21;
        }
        if (__pyx_t_25) {

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":302
 *             for i in range(N):
 *                 if mask[i, xi] and mask[i, yi]:
 *                     vx = mat[i, xi]             # <<<<<<<<<<<<<<
 *                     vy = mat[i, yi]
 *                     nobs += 1
 */
          __pyx_t_26 = __pyx_v_i;
          __pyx_t_27 = __pyx_v_xi;
          __pyx_v_vx = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_mat.buf, __pyx_t_26, __pyx_bstride_0_mat, __pyx_t_27, __pyx_bstride_1_mat));

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":303
 *                 if mask[i, xi] and mask[i, yi]:
 *                     vx = mat[i, xi]
 *                     vy = mat[i, yi]             # <<<<<<<<<<<<<<
 *                     nobs += 1
 *                     sumx += vx
 */
          __pyx_t_28 = __pyx_v_i;
          __pyx_t_29 = __pyx_v_yi;
          __pyx_v_vy = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_mat.buf, __pyx_t_28, __pyx_bstride_0_mat, __pyx_t_29, __pyx_bstride_1_mat));

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":304
 *                     vx = mat[i, xi]
 *                     vy = mat[i, yi]
 *                     nobs += 1             # <<<<<<<<<<<<<<
 *                     sumx += vx
 *                     sumy += vy
 */
          __pyx_v_nobs = (__pyx_v_nobs + 1);

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":305
 *                     vy = mat[i, yi]
 *                     nobs += 1
 *                     sumx += vx             # <<<<<<<<<<<<<<
 *                     sumy += vy
 * 
 */
          __pyx_v_sumx = (__pyx_v_sumx + __pyx_v_vx);

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":306
 *                     nobs += 1
 *                     sumx += vx
 *                     sumy += vy             # <<<<<<<<<<<<<<
 * 
 *             if nobs == 0:
 */
          __pyx_v_sumy = (__pyx_v_sumy + __pyx_v_vy);
          goto __pyx_L14;
        }
        __pyx_L14:;
      }

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":308
 *                     sumy += vy
 * 
 *             if nobs == 0:             # <<<<<<<<<<<<<<
 *                 result[xi, yi] = result[yi, xi] = np.NaN
 *             else:
 */
      __pyx_t_25 = (__pyx_v_nobs == 0);
      if (__pyx_t_25) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":309
 * 
 *             if nobs == 0:
 *                 result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 *             else:
 *                 meanx = sumx / nobs
 */
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__NaN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_17 = __pyx_v_xi;
        __pyx_t_18 = __pyx_v_yi;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result, __pyx_t_18, __pyx_bstride_1_result) = __pyx_t_30;
        __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_31 = __pyx_v_yi;
        __pyx_t_32 = __pyx_v_xi;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_result.buf, __pyx_t_31, __pyx_bstride_0_result, __pyx_t_32, __pyx_bstride_1_result) = __pyx_t_30;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":311
 *                 result[xi, yi] = result[yi, xi] = np.NaN
 *             else:
 *                 meanx = sumx / nobs             # <<<<<<<<<<<<<<
 *                 meany = sumy / nobs
 * 
 */
        if (unlikely(__pyx_v_nobs == 0)) {
          PyErr_Format(PyExc_ZeroDivisionError, "float division");
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_meanx = (__pyx_v_sumx / __pyx_v_nobs);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":312
 *             else:
 *                 meanx = sumx / nobs
 *                 meany = sumy / nobs             # <<<<<<<<<<<<<<
 * 
 *                 # now the cov numerator
 */
        if (unlikely(__pyx_v_nobs == 0)) {
          PyErr_Format(PyExc_ZeroDivisionError, "float division");
          {__pyx_filename = __pyx_f[8]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_v_meany = (__pyx_v_sumy / __pyx_v_nobs);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":315
 * 
 *                 # now the cov numerator
 *                 sumx = 0             # <<<<<<<<<<<<<<
 * 
 *                 for i in range(N):
 */
        __pyx_v_sumx = 0.0;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":317
 *                 sumx = 0
 * 
 *                 for i in range(N):             # <<<<<<<<<<<<<<
 *                     if mask[i, xi] and mask[i, yi]:
 *                         vx = mat[i, xi] - meanx
 */
        __pyx_t_33 = __pyx_v_N;
        for (__pyx_t_34 = 0; __pyx_t_34 < __pyx_t_33; __pyx_t_34+=1) {
          __pyx_v_i = __pyx_t_34;

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":318
 * 
 *                 for i in range(N):
 *                     if mask[i, xi] and mask[i, yi]:             # <<<<<<<<<<<<<<
 *                         vx = mat[i, xi] - meanx
 *                         vy = mat[i, yi] - meany
 */
          __pyx_t_35 = __pyx_v_i;
          __pyx_t_36 = __pyx_v_xi;
          __pyx_t_21 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_35, __pyx_bstride_0_mask, __pyx_t_36, __pyx_bstride_1_mask));
          if (__pyx_t_21) {
            __pyx_t_37 = __pyx_v_i;
            __pyx_t_38 = __pyx_v_yi;
            __pyx_t_24 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_37, __pyx_bstride_0_mask, __pyx_t_38, __pyx_bstride_1_mask));
            __pyx_t_25 = __pyx_t_24;
          } else {
            __pyx_t_25 = __pyx_t_21;
          }
          if (__pyx_t_25) {

            /* "/home/wesm/code/pandas/pandas/src/moments.pyx":319
 *                 for i in range(N):
 *                     if mask[i, xi] and mask[i, yi]:
 *                         vx = mat[i, xi] - meanx             # <<<<<<<<<<<<<<
 *                         vy = mat[i, yi] - meany
 * 
 */
            __pyx_t_39 = __pyx_v_i;
            __pyx_t_40 = __pyx_v_xi;
            __pyx_v_vx = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_mat.buf, __pyx_t_39, __pyx_bstride_0_mat, __pyx_t_40, __pyx_bstride_1_mat)) - __pyx_v_meanx);

            /* "/home/wesm/code/pandas/pandas/src/moments.pyx":320
 *                     if mask[i, xi] and mask[i, yi]:
 *                         vx = mat[i, xi] - meanx
 *                         vy = mat[i, yi] - meany             # <<<<<<<<<<<<<<
 * 
 *                         sumx += vx * vy
 */
            __pyx_t_41 = __pyx_v_i;
            __pyx_t_42 = __pyx_v_yi;
            __pyx_v_vy = ((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_mat.buf, __pyx_t_41, __pyx_bstride_0_mat, __pyx_t_42, __pyx_bstride_1_mat)) - __pyx_v_meany);

            /* "/home/wesm/code/pandas/pandas/src/moments.pyx":322
 *                         vy = mat[i, yi] - meany
 * 
 *                         sumx += vx * vy             # <<<<<<<<<<<<<<
 *                         sumxx += vx * vx
 *                         sumyy += vy * vy
 */
            __pyx_v_sumx = (__pyx_v_sumx + (__pyx_v_vx * __pyx_v_vy));

            /* "/home/wesm/code/pandas/pandas/src/moments.pyx":323
 * 
 *                         sumx += vx * vy
 *                         sumxx += vx * vx             # <<<<<<<<<<<<<<
 *                         sumyy += vy * vy
 * 
 */
            __pyx_v_sumxx = (__pyx_v_sumxx + (__pyx_v_vx * __pyx_v_vx));

            /* "/home/wesm/code/pandas/pandas/src/moments.pyx":324
 *                         sumx += vx * vy
 *                         sumxx += vx * vx
 *                         sumyy += vy * vy             # <<<<<<<<<<<<<<
 * 
 *                 divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy)
 */
            __pyx_v_sumyy = (__pyx_v_sumyy + (__pyx_v_vy * __pyx_v_vy));
            goto __pyx_L18;
          }
          __pyx_L18:;
        }

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":326
 *                         sumyy += vy * vy
 * 
 *                 divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy)             # <<<<<<<<<<<<<<
 * 
 *                 if divisor != 0:
 */
        __pyx_t_25 = __Pyx_PyObject_IsTrue(__pyx_v_cov); if (unlikely(__pyx_t_25 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_25) {
          __pyx_t_43 = (__pyx_v_nobs - 1.0);
        } else {
          __pyx_t_43 = sqrt((__pyx_v_sumxx * __pyx_v_sumyy));
        }
        __pyx_v_divisor = __pyx_t_43;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":328
 *                 divisor = (nobs - 1.0) if cov else sqrt(sumxx * sumyy)
 * 
 *                 if divisor != 0:             # <<<<<<<<<<<<<<
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 */
        __pyx_t_25 = (__pyx_v_divisor != 0.0);
        if (__pyx_t_25) {

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":329
 * 
 *                 if divisor != 0:
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor             # <<<<<<<<<<<<<<
 *                 else:
 *                     result[xi, yi] = result[yi, xi] = np.NaN
 */
          if (unlikely(__pyx_v_divisor == 0)) {
            PyErr_Format(PyExc_ZeroDivisionError, "float division");
            {__pyx_filename = __pyx_f[8]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_30 = (__pyx_v_sumx / __pyx_v_divisor);
          __pyx_t_33 = __pyx_v_xi;
          __pyx_t_34 = __pyx_v_yi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_result.buf, __pyx_t_33, __pyx_bstride_0_result, __pyx_t_34, __pyx_bstride_1_result) = __pyx_t_30;
          __pyx_t_44 = __pyx_v_yi;
          __pyx_t_45 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_result.buf, __pyx_t_44, __pyx_bstride_0_result, __pyx_t_45, __pyx_bstride_1_result) = __pyx_t_30;
          goto __pyx_L19;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":331
 *                     result[xi, yi] = result[yi, xi] = sumx / divisor
 *                 else:
 *                     result[xi, yi] = result[yi, xi] = np.NaN             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
          __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__NaN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_46 = __pyx_v_xi;
          __pyx_t_47 = __pyx_v_yi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_result.buf, __pyx_t_46, __pyx_bstride_0_result, __pyx_t_47, __pyx_bstride_1_result) = __pyx_t_30;
          __pyx_t_30 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_30 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_48 = __pyx_v_yi;
          __pyx_t_49 = __pyx_v_xi;
          *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_result.buf, __pyx_t_48, __pyx_bstride_0_result, __pyx_t_49, __pyx_bstride_1_result) = __pyx_t_30;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_L19:;
      }
      __pyx_L15:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":333
 *                     result[xi, yi] = result[yi, xi] = np.NaN
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mat);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.nancorr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mat);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":338
 * # Rolling variance
 * 
 * def _check_minp(minp, N):             # <<<<<<<<<<<<<<
 *     if minp > N:
 *         minp = N + 1
 */

static PyObject *__pyx_pf_6pandas_3lib_102_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_102_check_minp = {__Pyx_NAMESTR("_check_minp"), (PyCFunction)__pyx_pf_6pandas_3lib_102_check_minp, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_102_check_minp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_minp = 0;
  PyObject *__pyx_v_N = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__minp,&__pyx_n_s__N,0};
  __Pyx_RefNannySetupContext("_check_minp");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__N);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_check_minp") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_minp = values[0];
    __pyx_v_N = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_minp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_minp);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":339
 * 
 * def _check_minp(minp, N):
 *     if minp > N:             # <<<<<<<<<<<<<<
 *         minp = N + 1
 *     elif minp == 0:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_minp, __pyx_v_N, Py_GT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":340
 * def _check_minp(minp, N):
 *     if minp > N:
 *         minp = N + 1             # <<<<<<<<<<<<<<
 *     elif minp == 0:
 *         minp = 1
 */
    __pyx_t_1 = PyNumber_Add(__pyx_v_N, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_minp);
    __pyx_v_minp = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":341
 *     if minp > N:
 *         minp = N + 1
 *     elif minp == 0:             # <<<<<<<<<<<<<<
 *         minp = 1
 *     elif minp < 0:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":342
 *         minp = N + 1
 *     elif minp == 0:
 *         minp = 1             # <<<<<<<<<<<<<<
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')
 */
    __Pyx_INCREF(__pyx_int_1);
    __Pyx_DECREF(__pyx_v_minp);
    __pyx_v_minp = __pyx_int_1;
    goto __pyx_L6;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":343
 *     elif minp == 0:
 *         minp = 1
 *     elif minp < 0:             # <<<<<<<<<<<<<<
 *         raise ValueError('min_periods must be >= 0')
 *     return minp
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_minp, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":344
 *         minp = 1
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')             # <<<<<<<<<<<<<<
 *     return minp
 * 
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_97), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":345
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')
 *     return minp             # <<<<<<<<<<<<<<
 * 
 * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_minp);
  __pyx_r = __pyx_v_minp;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib._check_minp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_minp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":347
 *     return minp
 * 
 * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1):             # <<<<<<<<<<<<<<
 *     cdef double val, prev, sum_x = 0, sum_xx = 0, nobs = 0
 *     cdef Py_ssize_t i
 */

static PyObject *__pyx_pf_6pandas_3lib_103roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_103roll_var = {__Pyx_NAMESTR("roll_var"), (PyCFunction)__pyx_pf_6pandas_3lib_103roll_var, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_103roll_var(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  int __pyx_v_ddof;
  double __pyx_v_val;
  double __pyx_v_prev;
  double __pyx_v_sum_x;
  double __pyx_v_sum_xx;
  double __pyx_v_nobs;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  double __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,&__pyx_n_s__ddof,0};
  __Pyx_RefNannySetupContext("roll_var");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ddof);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_var") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[3]) {
      __pyx_v_ddof = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_ddof == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ddof = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_var", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_input.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
  __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":348
 * 
 * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1):
 *     cdef double val, prev, sum_x = 0, sum_xx = 0, nobs = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t N = len(input)
 */
  __pyx_v_sum_x = 0.0;
  __pyx_v_sum_xx = 0.0;
  __pyx_v_nobs = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":350
 *     cdef double val, prev, sum_x = 0, sum_xx = 0, nobs = 0
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t N = len(input)             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":352
 *     cdef Py_ssize_t N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, N)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":354
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     minp = _check_minp(minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":356
 *     minp = _check_minp(minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_8 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":357
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_1, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":360
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":361
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 *             sum_xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1.0);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":362
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 *             sum_xx += val * val
 * 
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":363
 *             nobs += 1
 *             sum_x += val
 *             sum_xx += val * val             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_v_sum_xx = (__pyx_v_sum_xx + (__pyx_v_val * __pyx_v_val));
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":365
 *             sum_xx += val * val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":367
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":368
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_12, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":370
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_9 = (__pyx_v_i > (__pyx_v_win - 1));
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":371
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 sum_x -= prev
 */
      __pyx_t_13 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_input;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_13, __pyx_bstride_0_input));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":372
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 sum_x -= prev
 *                 sum_xx -= prev * prev
 */
      __pyx_t_9 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":373
 *             prev = input[i - win]
 *             if prev == prev:
 *                 sum_x -= prev             # <<<<<<<<<<<<<<
 *                 sum_xx -= prev * prev
 *                 nobs -= 1
 */
        __pyx_v_sum_x = (__pyx_v_sum_x - __pyx_v_prev);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":374
 *             if prev == prev:
 *                 sum_x -= prev
 *                 sum_xx -= prev * prev             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_v_sum_xx = (__pyx_v_sum_xx - (__pyx_v_prev * __pyx_v_prev));

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":375
 *                 sum_x -= prev
 *                 sum_xx -= prev * prev
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1.0);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":377
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             sum_x += val
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":378
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             sum_x += val
 *             sum_xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1.0);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":379
 *         if val == val:
 *             nobs += 1
 *             sum_x += val             # <<<<<<<<<<<<<<
 *             sum_xx += val * val
 * 
 */
      __pyx_v_sum_x = (__pyx_v_sum_x + __pyx_v_val);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":380
 *             nobs += 1
 *             sum_x += val
 *             sum_xx += val * val             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_v_sum_xx = (__pyx_v_sum_xx + (__pyx_v_val * __pyx_v_val));
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":382
 *             sum_xx += val * val
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = (nobs * sum_xx - sum_x * sum_x) / (nobs * (nobs - ddof))
 *         else:
 */
    __pyx_t_9 = (__pyx_v_nobs >= __pyx_v_minp);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":383
 * 
 *         if nobs >= minp:
 *             output[i] = (nobs * sum_xx - sum_x * sum_x) / (nobs * (nobs - ddof))             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_14 = ((__pyx_v_nobs * __pyx_v_sum_xx) - (__pyx_v_sum_x * __pyx_v_sum_x));
      __pyx_t_15 = (__pyx_v_nobs * (__pyx_v_nobs - __pyx_v_ddof));
      if (unlikely(__pyx_t_15 == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_16, __pyx_bstride_0_output) = (__pyx_t_14 / __pyx_t_15);
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":385
 *             output[i] = (nobs * sum_xx - sum_x * sum_x) / (nobs * (nobs - ddof))
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_17, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L14:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":387
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_var", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":392
 * # Rolling skewness
 * 
 * def roll_skew(ndarray[double_t] input, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, prev
 *     cdef double x = 0, xx = 0, xxx = 0
 */

static PyObject *__pyx_pf_6pandas_3lib_104roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_104roll_skew = {__Pyx_NAMESTR("roll_skew"), (PyCFunction)__pyx_pf_6pandas_3lib_104roll_skew, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_104roll_skew(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  double __pyx_v_val;
  double __pyx_v_prev;
  double __pyx_v_x;
  double __pyx_v_xx;
  double __pyx_v_xxx;
  Py_ssize_t __pyx_v_nobs;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  double __pyx_v_A;
  double __pyx_v_B;
  double __pyx_v_C;
  double __pyx_v_R;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  double __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_skew");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_skew") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_skew", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_input.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
  __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":394
 * def roll_skew(ndarray[double_t] input, int win, int minp):
 *     cdef double val, prev
 *     cdef double x = 0, xx = 0, xxx = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t nobs = 0, i
 *     cdef Py_ssize_t N = len(input)
 */
  __pyx_v_x = 0.0;
  __pyx_v_xx = 0.0;
  __pyx_v_xxx = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":395
 *     cdef double val, prev
 *     cdef double x = 0, xx = 0, xxx = 0
 *     cdef Py_ssize_t nobs = 0, i             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t N = len(input)
 * 
 */
  __pyx_v_nobs = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":396
 *     cdef double x = 0, xx = 0, xxx = 0
 *     cdef Py_ssize_t nobs = 0, i
 *     cdef Py_ssize_t N = len(input)             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":398
 *     cdef Py_ssize_t N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     # 3 components of the skewness equation
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":403
 *     cdef double A, B, C, R
 * 
 *     minp = _check_minp(minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":405
 *     minp = _check_minp(minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_8 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":406
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_1, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":409
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":410
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":411
 *         if val == val:
 *             nobs += 1
 *             x += val             # <<<<<<<<<<<<<<
 *             xx += val * val
 *             xxx += val * val * val
 */
      __pyx_v_x = (__pyx_v_x + __pyx_v_val);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":412
 *             nobs += 1
 *             x += val
 *             xx += val * val             # <<<<<<<<<<<<<<
 *             xxx += val * val * val
 * 
 */
      __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":413
 *             x += val
 *             xx += val * val
 *             xxx += val * val * val             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val));
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":415
 *             xxx += val * val * val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":417
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":418
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_12, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":420
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_9 = (__pyx_v_i > (__pyx_v_win - 1));
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":421
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 x -= prev
 */
      __pyx_t_13 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_input;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_13, __pyx_bstride_0_input));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":422
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 x -= prev
 *                 xx -= prev * prev
 */
      __pyx_t_9 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":423
 *             prev = input[i - win]
 *             if prev == prev:
 *                 x -= prev             # <<<<<<<<<<<<<<
 *                 xx -= prev * prev
 *                 xxx -= prev * prev * prev
 */
        __pyx_v_x = (__pyx_v_x - __pyx_v_prev);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":424
 *             if prev == prev:
 *                 x -= prev
 *                 xx -= prev * prev             # <<<<<<<<<<<<<<
 *                 xxx -= prev * prev * prev
 * 
 */
        __pyx_v_xx = (__pyx_v_xx - (__pyx_v_prev * __pyx_v_prev));

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":425
 *                 x -= prev
 *                 xx -= prev * prev
 *                 xxx -= prev * prev * prev             # <<<<<<<<<<<<<<
 * 
 *                 nobs -= 1
 */
        __pyx_v_xxx = (__pyx_v_xxx - ((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev));

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":427
 *                 xxx -= prev * prev * prev
 * 
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":429
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":430
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":431
 *         if val == val:
 *             nobs += 1
 *             x += val             # <<<<<<<<<<<<<<
 *             xx += val * val
 *             xxx += val * val * val
 */
      __pyx_v_x = (__pyx_v_x + __pyx_v_val);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":432
 *             nobs += 1
 *             x += val
 *             xx += val * val             # <<<<<<<<<<<<<<
 *             xxx += val * val * val
 * 
 */
      __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":433
 *             x += val
 *             xx += val * val
 *             xxx += val * val * val             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val));
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":435
 *             xxx += val * val * val
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             A = x / nobs
 *             B = xx / nobs - A * A
 */
    __pyx_t_9 = (__pyx_v_nobs >= __pyx_v_minp);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":436
 * 
 *         if nobs >= minp:
 *             A = x / nobs             # <<<<<<<<<<<<<<
 *             B = xx / nobs - A * A
 *             C = xxx / nobs - A * A * A - 3 * A * B
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_A = (__pyx_v_x / __pyx_v_nobs);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":437
 *         if nobs >= minp:
 *             A = x / nobs
 *             B = xx / nobs - A * A             # <<<<<<<<<<<<<<
 *             C = xxx / nobs - A * A * A - 3 * A * B
 * 
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - (__pyx_v_A * __pyx_v_A));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":438
 *             A = x / nobs
 *             B = xx / nobs - A * A
 *             C = xxx / nobs - A * A * A - 3 * A * B             # <<<<<<<<<<<<<<
 * 
 *             R = sqrt(B)
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_C = (((__pyx_v_xxx / __pyx_v_nobs) - ((__pyx_v_A * __pyx_v_A) * __pyx_v_A)) - ((3.0 * __pyx_v_A) * __pyx_v_B));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":440
 *             C = xxx / nobs - A * A * A - 3 * A * B
 * 
 *             R = sqrt(B)             # <<<<<<<<<<<<<<
 * 
 *             output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /
 */
      __pyx_v_R = sqrt(__pyx_v_B);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":442
 *             R = sqrt(B)
 * 
 *             output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /             # <<<<<<<<<<<<<<
 *                          ((nobs-2) * R * R * R))
 *         else:
 */
      __pyx_t_14 = (sqrt((__pyx_v_nobs * (__pyx_v_nobs - 1.))) * __pyx_v_C);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":443
 * 
 *             output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /
 *                          ((nobs-2) * R * R * R))             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_15 = ((((__pyx_v_nobs - 2) * __pyx_v_R) * __pyx_v_R) * __pyx_v_R);
      if (unlikely(__pyx_t_15 == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":442
 *             R = sqrt(B)
 * 
 *             output[i] = ((sqrt(nobs * (nobs - 1.)) * C) /             # <<<<<<<<<<<<<<
 *                          ((nobs-2) * R * R * R))
 *         else:
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_16, __pyx_bstride_0_output) = (__pyx_t_14 / __pyx_t_15);
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":445
 *                          ((nobs-2) * R * R * R))
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_17, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L14:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":447
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_skew", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":453
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */

static PyObject *__pyx_pf_6pandas_3lib_105roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_105roll_kurt = {__Pyx_NAMESTR("roll_kurt"), (PyCFunction)__pyx_pf_6pandas_3lib_105roll_kurt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_105roll_kurt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  double __pyx_v_val;
  double __pyx_v_prev;
  double __pyx_v_x;
  double __pyx_v_xx;
  double __pyx_v_xxx;
  double __pyx_v_xxxx;
  Py_ssize_t __pyx_v_nobs;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  double __pyx_v_A;
  double __pyx_v_B;
  double __pyx_v_C;
  double __pyx_v_D;
  double __pyx_v_R;
  double __pyx_v_K;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  double __pyx_t_14;
  double __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_kurt");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_kurt") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_kurt", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_input.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
  __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":456
 *                int win, int minp):
 *     cdef double val, prev
 *     cdef double x = 0, xx = 0, xxx = 0, xxxx = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t nobs = 0, i
 *     cdef Py_ssize_t N = len(input)
 */
  __pyx_v_x = 0.0;
  __pyx_v_xx = 0.0;
  __pyx_v_xxx = 0.0;
  __pyx_v_xxxx = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":457
 *     cdef double val, prev
 *     cdef double x = 0, xx = 0, xxx = 0, xxxx = 0
 *     cdef Py_ssize_t nobs = 0, i             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t N = len(input)
 * 
 */
  __pyx_v_nobs = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":458
 *     cdef double x = 0, xx = 0, xxx = 0, xxxx = 0
 *     cdef Py_ssize_t nobs = 0, i
 *     cdef Py_ssize_t N = len(input)             # <<<<<<<<<<<<<<
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":460
 *     cdef Py_ssize_t N = len(input)
 * 
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     # 5 components of the kurtosis equation
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":465
 *     cdef double A, B, C, D, R, K
 * 
 *     minp = _check_minp(minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":467
 *     minp = _check_minp(minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_8 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":468
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_1, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":471
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 * 
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":472
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 * 
 *             # seriously don't ask me why this is faster
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":475
 * 
 *             # seriously don't ask me why this is faster
 *             x += val             # <<<<<<<<<<<<<<
 *             xx += val * val
 *             xxx += val * val * val
 */
      __pyx_v_x = (__pyx_v_x + __pyx_v_val);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":476
 *             # seriously don't ask me why this is faster
 *             x += val
 *             xx += val * val             # <<<<<<<<<<<<<<
 *             xxx += val * val * val
 *             xxxx += val * val * val * val
 */
      __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":477
 *             x += val
 *             xx += val * val
 *             xxx += val * val * val             # <<<<<<<<<<<<<<
 *             xxxx += val * val * val * val
 * 
 */
      __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":478
 *             xx += val * val
 *             xxx += val * val * val
 *             xxxx += val * val * val * val             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_v_xxxx = (__pyx_v_xxxx + (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val));
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":480
 *             xxxx += val * val * val * val
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":482
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":483
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_12, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":485
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 *             if prev == prev:
 */
    __pyx_t_9 = (__pyx_v_i > (__pyx_v_win - 1));
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":486
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 *             if prev == prev:
 *                 x -= prev
 */
      __pyx_t_13 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_input;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_13, __pyx_bstride_0_input));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":487
 *         if i > win - 1:
 *             prev = input[i - win]
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 x -= prev
 *                 xx -= prev * prev
 */
      __pyx_t_9 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":488
 *             prev = input[i - win]
 *             if prev == prev:
 *                 x -= prev             # <<<<<<<<<<<<<<
 *                 xx -= prev * prev
 *                 xxx -= prev * prev * prev
 */
        __pyx_v_x = (__pyx_v_x - __pyx_v_prev);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":489
 *             if prev == prev:
 *                 x -= prev
 *                 xx -= prev * prev             # <<<<<<<<<<<<<<
 *                 xxx -= prev * prev * prev
 *                 xxxx -= prev * prev * prev * prev
 */
        __pyx_v_xx = (__pyx_v_xx - (__pyx_v_prev * __pyx_v_prev));

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":490
 *                 x -= prev
 *                 xx -= prev * prev
 *                 xxx -= prev * prev * prev             # <<<<<<<<<<<<<<
 *                 xxxx -= prev * prev * prev * prev
 * 
 */
        __pyx_v_xxx = (__pyx_v_xxx - ((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev));

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":491
 *                 xx -= prev * prev
 *                 xxx -= prev * prev * prev
 *                 xxxx -= prev * prev * prev * prev             # <<<<<<<<<<<<<<
 * 
 *                 nobs -= 1
 */
        __pyx_v_xxxx = (__pyx_v_xxxx - (((__pyx_v_prev * __pyx_v_prev) * __pyx_v_prev) * __pyx_v_prev));

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":493
 *                 xxxx -= prev * prev * prev * prev
 * 
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":495
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             x += val
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":496
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             x += val
 *             xx += val * val
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":497
 *         if val == val:
 *             nobs += 1
 *             x += val             # <<<<<<<<<<<<<<
 *             xx += val * val
 *             xxx += val * val * val
 */
      __pyx_v_x = (__pyx_v_x + __pyx_v_val);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":498
 *             nobs += 1
 *             x += val
 *             xx += val * val             # <<<<<<<<<<<<<<
 *             xxx += val * val * val
 *             xxxx += val * val * val * val
 */
      __pyx_v_xx = (__pyx_v_xx + (__pyx_v_val * __pyx_v_val));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":499
 *             x += val
 *             xx += val * val
 *             xxx += val * val * val             # <<<<<<<<<<<<<<
 *             xxxx += val * val * val * val
 * 
 */
      __pyx_v_xxx = (__pyx_v_xxx + ((__pyx_v_val * __pyx_v_val) * __pyx_v_val));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":500
 *             xx += val * val
 *             xxx += val * val * val
 *             xxxx += val * val * val * val             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_v_xxxx = (__pyx_v_xxxx + (((__pyx_v_val * __pyx_v_val) * __pyx_v_val) * __pyx_v_val));
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":502
 *             xxxx += val * val * val * val
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             A = x / nobs
 *             R = A * A
 */
    __pyx_t_9 = (__pyx_v_nobs >= __pyx_v_minp);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":503
 * 
 *         if nobs >= minp:
 *             A = x / nobs             # <<<<<<<<<<<<<<
 *             R = A * A
 *             B = xx / nobs - R
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_A = (__pyx_v_x / __pyx_v_nobs);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":504
 *         if nobs >= minp:
 *             A = x / nobs
 *             R = A * A             # <<<<<<<<<<<<<<
 *             B = xx / nobs - R
 *             R = R * A
 */
      __pyx_v_R = (__pyx_v_A * __pyx_v_A);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":505
 *             A = x / nobs
 *             R = A * A
 *             B = xx / nobs - R             # <<<<<<<<<<<<<<
 *             R = R * A
 *             C = xxx / nobs - R - 3 * A * B
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_B = ((__pyx_v_xx / __pyx_v_nobs) - __pyx_v_R);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":506
 *             R = A * A
 *             B = xx / nobs - R
 *             R = R * A             # <<<<<<<<<<<<<<
 *             C = xxx / nobs - R - 3 * A * B
 *             R = R * A
 */
      __pyx_v_R = (__pyx_v_R * __pyx_v_A);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":507
 *             B = xx / nobs - R
 *             R = R * A
 *             C = xxx / nobs - R - 3 * A * B             # <<<<<<<<<<<<<<
 *             R = R * A
 *             D = xxxx / nobs - R - 6*B*A*A - 4*C*A
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_C = (((__pyx_v_xxx / __pyx_v_nobs) - __pyx_v_R) - ((3.0 * __pyx_v_A) * __pyx_v_B));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":508
 *             R = R * A
 *             C = xxx / nobs - R - 3 * A * B
 *             R = R * A             # <<<<<<<<<<<<<<
 *             D = xxxx / nobs - R - 6*B*A*A - 4*C*A
 * 
 */
      __pyx_v_R = (__pyx_v_R * __pyx_v_A);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":509
 *             C = xxx / nobs - R - 3 * A * B
 *             R = R * A
 *             D = xxxx / nobs - R - 6*B*A*A - 4*C*A             # <<<<<<<<<<<<<<
 * 
 *             K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2)
 */
      if (unlikely(__pyx_v_nobs == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_D = ((((__pyx_v_xxxx / __pyx_v_nobs) - __pyx_v_R) - (((6.0 * __pyx_v_B) * __pyx_v_A) * __pyx_v_A)) - ((4.0 * __pyx_v_C) * __pyx_v_A));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":511
 *             D = xxxx / nobs - R - 6*B*A*A - 4*C*A
 * 
 *             K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2)             # <<<<<<<<<<<<<<
 *             K = K / ((nobs - 2.)*(nobs-3.))
 * 
 */
      __pyx_t_14 = (((__pyx_v_nobs * __pyx_v_nobs) - 1.) * __pyx_v_D);
      __pyx_t_15 = (__pyx_v_B * __pyx_v_B);
      if (unlikely(__pyx_t_15 == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_K = ((__pyx_t_14 / __pyx_t_15) - (3.0 * pow((__pyx_v_nobs - 1.), 2.0)));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":512
 * 
 *             K = (nobs * nobs - 1.)*D/(B*B) - 3*((nobs-1.)**2)
 *             K = K / ((nobs - 2.)*(nobs-3.))             # <<<<<<<<<<<<<<
 * 
 *             output[i] = K
 */
      __pyx_t_15 = ((__pyx_v_nobs - 2.) * (__pyx_v_nobs - 3.));
      if (unlikely(__pyx_t_15 == 0)) {
        PyErr_Format(PyExc_ZeroDivisionError, "float division");
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_K = (__pyx_v_K / __pyx_t_15);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":514
 *             K = K / ((nobs - 2.)*(nobs-3.))
 * 
 *             output[i] = K             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_16, __pyx_bstride_0_output) = __pyx_v_K;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":516
 *             output[i] = K
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_17, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L14:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":518
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * #-------------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_kurt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":525
 * ctypedef double_t (* skiplist_f)(object sl, int n, int p)
 * 
 * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op):             # <<<<<<<<<<<<<<
 *     cdef ndarray[double_t] input = arg
 *     cdef double val, prev, midpoint
 */

static PyObject *__pyx_f_6pandas_3lib__roll_skiplist_op(PyArrayObject *__pyx_v_arg, int __pyx_v_win, int __pyx_v_minp, __pyx_t_6pandas_3lib_skiplist_f __pyx_v_op) {
  PyArrayObject *__pyx_v_input = 0;
  double __pyx_v_val;
  double __pyx_v_prev;
  struct __pyx_obj_6pandas_3lib_IndexableSkiplist *__pyx_v_skiplist = 0;
  Py_ssize_t __pyx_v_nobs;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_roll_skiplist_op");
  __pyx_bstruct_input.buf = NULL;
  __pyx_bstruct_output.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":526
 * 
 * cdef _roll_skiplist_op(ndarray arg, int win, int minp, skiplist_f op):
 *     cdef ndarray[double_t] input = arg             # <<<<<<<<<<<<<<
 *     cdef double val, prev, midpoint
 *     cdef IndexableSkiplist skiplist
 */
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)((PyArrayObject *)__pyx_v_arg), &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_input = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_input.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
      __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];
    }
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_arg));
  __pyx_v_input = ((PyArrayObject *)__pyx_v_arg);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":529
 *     cdef double val, prev, midpoint
 *     cdef IndexableSkiplist skiplist
 *     cdef Py_ssize_t nobs = 0, i             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t N = len(input)
 */
  __pyx_v_nobs = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":531
 *     cdef Py_ssize_t nobs = 0, i
 * 
 *     cdef Py_ssize_t N = len(input)             # <<<<<<<<<<<<<<
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":532
 * 
 *     cdef Py_ssize_t N = len(input)
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     skiplist = IndexableSkiplist(win)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":534
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     skiplist = IndexableSkiplist(win)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, N)
 */
  __pyx_t_5 = PyInt_FromLong(__pyx_v_win); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_IndexableSkiplist)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_skiplist = ((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":536
 *     skiplist = IndexableSkiplist(win)
 * 
 *     minp = _check_minp(minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":538
 *     minp = _check_minp(minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_8 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":539
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_1, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":542
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":543
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":544
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":546
 *             skiplist.insert(val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":548
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":549
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_12, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":551
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 * 
 */
    __pyx_t_9 = (__pyx_v_i > (__pyx_v_win - 1));
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":552
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_13 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_input;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_input.buf, __pyx_t_13, __pyx_bstride_0_input));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":554
 *             prev = input[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist.remove(prev)
 *                 nobs -= 1
 */
      __pyx_t_9 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":555
 * 
 *             if prev == prev:
 *                 skiplist.remove(prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":556
 *             if prev == prev:
 *                 skiplist.remove(prev)
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L9;
      }
      __pyx_L9:;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":558
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":559
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":560
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = op(skiplist, nobs, minp)
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":562
 *             skiplist.insert(val)
 * 
 *         output[i] = op(skiplist, nobs, minp)             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_14, __pyx_bstride_0_output) = __pyx_v_op(((PyObject *)__pyx_v_skiplist), __pyx_v_nobs, __pyx_v_minp);
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":564
 *         output[i] = op(skiplist, nobs, minp)
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * from skiplist cimport *
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib._roll_skiplist_op", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_input);
  __Pyx_XDECREF((PyObject *)__pyx_v_skiplist);
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":568
 * from skiplist cimport *
 * 
 * def roll_median_c(ndarray[float64_t] arg, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, res, prev
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_106roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_106roll_median_c = {__Pyx_NAMESTR("roll_median_c"), (PyCFunction)__pyx_pf_6pandas_3lib_106roll_median_c, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_106roll_median_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arg = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  double __pyx_v_val;
  double __pyx_v_res;
  double __pyx_v_prev;
  int __pyx_v_ret;
  skiplist_t *__pyx_v_sl;
  Py_ssize_t __pyx_v_midpoint;
  Py_ssize_t __pyx_v_nobs;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  Py_buffer __pyx_bstruct_arg;
  Py_ssize_t __pyx_bstride_0_arg = 0;
  Py_ssize_t __pyx_bshape_0_arg = 0;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arg,&__pyx_n_s__win,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_median_c");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arg);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_median_c") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_arg = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_median_c", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_arg.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_5numpy_ndarray, 1, "arg", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arg, (PyObject*)__pyx_v_arg, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arg = __pyx_bstruct_arg.strides[0];
  __pyx_bshape_0_arg = __pyx_bstruct_arg.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":571
 *     cdef double val, res, prev
 *     cdef:
 *         int ret=0             # <<<<<<<<<<<<<<
 *         skiplist_t *sl
 *         Py_ssize_t midpoint, nobs = 0, i
 */
  __pyx_v_ret = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":573
 *         int ret=0
 *         skiplist_t *sl
 *         Py_ssize_t midpoint, nobs = 0, i             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_nobs = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":576
 * 
 * 
 *     cdef Py_ssize_t N = len(arg)             # <<<<<<<<<<<<<<
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arg)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":577
 * 
 *     cdef Py_ssize_t N = len(arg)
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     sl = skiplist_init(win)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":579
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     sl = skiplist_init(win)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, N)
 */
  __pyx_v_sl = skiplist_init(__pyx_v_win);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":581
 *     sl = skiplist_init(win)
 * 
 *     minp = _check_minp(minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":583
 *     minp = _check_minp(minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = arg[i]
 * 
 */
  __pyx_t_8 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":584
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = arg[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_arg;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_arg)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_arg.buf, __pyx_t_1, __pyx_bstride_0_arg));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":587
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist_insert(sl, val)
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":588
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist_insert(sl, val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":589
 *         if val == val:
 *             nobs += 1
 *             skiplist_insert(sl, val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      skiplist_insert(__pyx_v_sl, __pyx_v_val);
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":591
 *             skiplist_insert(sl, val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":593
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = arg[i]
 * 
 */
  __pyx_t_11 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":594
 * 
 *     for i from minp - 1 <= i < N:
 *         val = arg[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_arg;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_arg)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_arg.buf, __pyx_t_12, __pyx_bstride_0_arg));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":596
 *         val = arg[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = arg[i - win]
 * 
 */
    __pyx_t_9 = (__pyx_v_i > (__pyx_v_win - 1));
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":597
 * 
 *         if i > win - 1:
 *             prev = arg[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_13 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_arg;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_arg)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_arg.buf, __pyx_t_13, __pyx_bstride_0_arg));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":599
 *             prev = arg[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist_remove(sl, prev)
 *                 nobs -= 1
 */
      __pyx_t_9 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":600
 * 
 *             if prev == prev:
 *                 skiplist_remove(sl, prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        skiplist_remove(__pyx_v_sl, __pyx_v_prev);

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":601
 *             if prev == prev:
 *                 skiplist_remove(sl, prev)
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":603
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist_insert(sl, val)
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":604
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist_insert(sl, val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":605
 *         if val == val:
 *             nobs += 1
 *             skiplist_insert(sl, val)             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      skiplist_insert(__pyx_v_sl, __pyx_v_val);
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":607
 *             skiplist_insert(sl, val)
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             midpoint = nobs / 2
 *             if nobs % 2:
 */
    __pyx_t_9 = (__pyx_v_nobs >= __pyx_v_minp);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":608
 * 
 *         if nobs >= minp:
 *             midpoint = nobs / 2             # <<<<<<<<<<<<<<
 *             if nobs % 2:
 *                 res = skiplist_get(sl, midpoint, &ret)
 */
      __pyx_v_midpoint = __Pyx_div_Py_ssize_t(__pyx_v_nobs, 2);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":609
 *         if nobs >= minp:
 *             midpoint = nobs / 2
 *             if nobs % 2:             # <<<<<<<<<<<<<<
 *                 res = skiplist_get(sl, midpoint, &ret)
 *             else:
 */
      __pyx_t_14 = __Pyx_mod_Py_ssize_t(__pyx_v_nobs, 2);
      if (__pyx_t_14) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":610
 *             midpoint = nobs / 2
 *             if nobs % 2:
 *                 res = skiplist_get(sl, midpoint, &ret)             # <<<<<<<<<<<<<<
 *             else:
 *                 res = (skiplist_get(sl, midpoint, &ret) +
 */
        __pyx_v_res = skiplist_get(__pyx_v_sl, __pyx_v_midpoint, (&__pyx_v_ret));
        goto __pyx_L15;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":613
 *             else:
 *                 res = (skiplist_get(sl, midpoint, &ret) +
 *                        skiplist_get(sl, (midpoint - 1), &ret)) / 2             # <<<<<<<<<<<<<<
 *         else:
 *             res = NaN
 */
        __pyx_v_res = ((skiplist_get(__pyx_v_sl, __pyx_v_midpoint, (&__pyx_v_ret)) + skiplist_get(__pyx_v_sl, (__pyx_v_midpoint - 1), (&__pyx_v_ret))) / 2.0);
      }
      __pyx_L15:;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":615
 *                        skiplist_get(sl, (midpoint - 1), &ret)) / 2
 *         else:
 *             res = NaN             # <<<<<<<<<<<<<<
 * 
 *         output[i] = res
 */
      __pyx_v_res = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L14:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":617
 *             res = NaN
 * 
 *         output[i] = res             # <<<<<<<<<<<<<<
 * 
 *     skiplist_destroy(sl)
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_14, __pyx_bstride_0_output) = __pyx_v_res;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":619
 *         output[i] = res
 * 
 *     skiplist_destroy(sl)             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
  skiplist_destroy(__pyx_v_sl);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":621
 *     skiplist_destroy(sl)
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * def roll_median_cython(ndarray input, int win, int minp):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arg);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_median_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arg);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":623
 *     return output
 * 
 * def roll_median_cython(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

static PyObject *__pyx_pf_6pandas_3lib_107roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_107roll_median_cython[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_107roll_median_cython = {__Pyx_NAMESTR("roll_median_cython"), (PyCFunction)__pyx_pf_6pandas_3lib_107roll_median_cython, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_107roll_median_cython)};
static PyObject *__pyx_pf_6pandas_3lib_107roll_median_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_median_cython");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_median_cython") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_median_cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_median_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":627
 *     O(N log(window)) implementation using skip list
 *     '''
 *     return _roll_skiplist_op(input, win, minp, _get_median)             # <<<<<<<<<<<<<<
 * 
 * # Unfortunately had to resort to some hackery here, would like for
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_3lib__get_median); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.roll_median_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":632
 * # Cython to be able to get this right.
 * 
 * cdef double_t _get_median(object sl, int nobs, int minp):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t midpoint
 *     cdef IndexableSkiplist skiplist = <IndexableSkiplist> sl
 */

static __pyx_t_5numpy_double_t __pyx_f_6pandas_3lib__get_median(PyObject *__pyx_v_sl, int __pyx_v_nobs, int __pyx_v_minp) {
  Py_ssize_t __pyx_v_midpoint;
  struct __pyx_obj_6pandas_3lib_IndexableSkiplist *__pyx_v_skiplist = 0;
  __pyx_t_5numpy_double_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_double_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_median");

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":634
 * cdef double_t _get_median(object sl, int nobs, int minp):
 *     cdef Py_ssize_t midpoint
 *     cdef IndexableSkiplist skiplist = <IndexableSkiplist> sl             # <<<<<<<<<<<<<<
 *     if nobs >= minp:
 *         midpoint = nobs / 2
 */
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_sl)));
  __pyx_v_skiplist = ((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_v_sl);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":635
 *     cdef Py_ssize_t midpoint
 *     cdef IndexableSkiplist skiplist = <IndexableSkiplist> sl
 *     if nobs >= minp:             # <<<<<<<<<<<<<<
 *         midpoint = nobs / 2
 *         if nobs % 2:
 */
  __pyx_t_1 = (__pyx_v_nobs >= __pyx_v_minp);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":636
 *     cdef IndexableSkiplist skiplist = <IndexableSkiplist> sl
 *     if nobs >= minp:
 *         midpoint = nobs / 2             # <<<<<<<<<<<<<<
 *         if nobs % 2:
 *             return skiplist.get(midpoint)
 */
    __pyx_v_midpoint = __Pyx_div_long(__pyx_v_nobs, 2);

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":637
 *     if nobs >= minp:
 *         midpoint = nobs / 2
 *         if nobs % 2:             # <<<<<<<<<<<<<<
 *             return skiplist.get(midpoint)
 *         else:
 */
    __pyx_t_2 = __Pyx_mod_long(__pyx_v_nobs, 2);
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":638
 *         midpoint = nobs / 2
 *         if nobs % 2:
 *             return skiplist.get(midpoint)             # <<<<<<<<<<<<<<
 *         else:
 *             return (skiplist.get(midpoint) +
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_v_midpoint, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_4;
      goto __pyx_L0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":640
 *             return skiplist.get(midpoint)
 *         else:
 *             return (skiplist.get(midpoint) +             # <<<<<<<<<<<<<<
 *                     skiplist.get(midpoint - 1)) / 2
 *     else:
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_v_midpoint, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":641
 *         else:
 *             return (skiplist.get(midpoint) +
 *                     skiplist.get(midpoint - 1)) / 2             # <<<<<<<<<<<<<<
 *     else:
 *         return NaN
 */
      __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, (__pyx_v_midpoint - 1), 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_4 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_4;
      goto __pyx_L0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":643
 *                     skiplist.get(midpoint - 1)) / 2
 *     else:
 *         return NaN             # <<<<<<<<<<<<<<
 * 
 * #----------------------------------------------------------------------
 */
    __pyx_r = __pyx_v_6pandas_3lib_NaN;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("pandas.lib._get_median", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_skiplist);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":659
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def roll_max2(ndarray[float64_t] a, int window, int minp):             # <<<<<<<<<<<<<<
 *     "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs."
 *     cdef np.float64_t ai, aold
 */

static PyObject *__pyx_pf_6pandas_3lib_108roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_108roll_max2[] = "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs.";
static PyMethodDef __pyx_mdef_6pandas_3lib_108roll_max2 = {__Pyx_NAMESTR("roll_max2"), (PyCFunction)__pyx_pf_6pandas_3lib_108roll_max2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_108roll_max2)};
static PyObject *__pyx_pf_6pandas_3lib_108roll_max2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_a = 0;
  int __pyx_v_window;
  int __pyx_v_minp;
  __pyx_t_5numpy_float64_t __pyx_v_ai;
  __pyx_t_5numpy_float64_t __pyx_v_aold;
  Py_ssize_t __pyx_v_count;
  struct __pyx_t_6pandas_3lib_pairs *__pyx_v_ring;
  struct __pyx_t_6pandas_3lib_pairs *__pyx_v_minpair;
  struct __pyx_t_6pandas_3lib_pairs *__pyx_v_end;
  struct __pyx_t_6pandas_3lib_pairs *__pyx_v_last;
  Py_ssize_t __pyx_v_i0;
  npy_intp *__pyx_v_dim;
  Py_ssize_t __pyx_v_n0;
  npy_intp *__pyx_v_dims;
  PyArrayObject *__pyx_v_y = 0;
  Py_buffer __pyx_bstruct_a;
  Py_ssize_t __pyx_bstride_0_a = 0;
  Py_ssize_t __pyx_bshape_0_a = 0;
  Py_buffer __pyx_bstruct_y;
  Py_ssize_t __pyx_bstride_0_y = 0;
  Py_ssize_t __pyx_bshape_0_y = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  npy_intp __pyx_t_1[1];
  PyObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  long __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  long __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__window,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_max2");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__window);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_max2") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_a = ((PyArrayObject *)values[0]);
    __pyx_v_window = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_max2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_max2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_y.buf = NULL;
  __pyx_bstruct_a.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_a, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_a = __pyx_bstruct_a.strides[0];
  __pyx_bshape_0_a = __pyx_bstruct_a.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":669
 *     cdef Py_ssize_t i0
 *     cdef np.npy_intp *dim
 *     dim = PyArray_DIMS(a)             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t n0 = dim[0]
 *     cdef np.npy_intp *dims = [n0]
 */
  __pyx_v_dim = PyArray_DIMS(((PyArrayObject *)__pyx_v_a));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":670
 *     cdef np.npy_intp *dim
 *     dim = PyArray_DIMS(a)
 *     cdef Py_ssize_t n0 = dim[0]             # <<<<<<<<<<<<<<
 *     cdef np.npy_intp *dims = [n0]
 *     cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims,
 */
  __pyx_v_n0 = (__pyx_v_dim[0]);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":671
 *     dim = PyArray_DIMS(a)
 *     cdef Py_ssize_t n0 = dim[0]
 *     cdef np.npy_intp *dims = [n0]             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims,
 * 		NPY_float64, 0)
 */
  __pyx_t_1[0] = __pyx_v_n0;
  __pyx_v_dims = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":673
 *     cdef np.npy_intp *dims = [n0]
 *     cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims,
 * 		NPY_float64, 0)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, n0)
 */
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_y, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_y.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_y = __pyx_bstruct_y.strides[0];
      __pyx_bshape_0_y = __pyx_bstruct_y.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_y = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":675
 * 		NPY_float64, 0)
 * 
 *     minp = _check_minp(minp, n0)             # <<<<<<<<<<<<<<
 * 
 *     if (window < 1) or (window > n0):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":677
 *     minp = _check_minp(minp, n0)
 * 
 *     if (window < 1) or (window > n0):             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid window size %d for len %d array'
 *                          % (window, n0))
 */
  __pyx_t_8 = (__pyx_v_window < 1);
  if (!__pyx_t_8) {
    __pyx_t_9 = (__pyx_v_window > __pyx_v_n0);
    __pyx_t_10 = __pyx_t_9;
  } else {
    __pyx_t_10 = __pyx_t_8;
  }
  if (__pyx_t_10) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":679
 *     if (window < 1) or (window > n0):
 *         raise ValueError('Invalid window size %d for len %d array'
 *                          % (window, n0))             # <<<<<<<<<<<<<<
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 */
    __pyx_t_5 = PyInt_FromLong(__pyx_v_window); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_98), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_6));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":681
 *                          % (window, n0))
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))             # <<<<<<<<<<<<<<
 *     end = ring + window
 *     last = ring
 */
  __pyx_v_ring = ((struct __pyx_t_6pandas_3lib_pairs *)malloc((__pyx_v_window * (sizeof(struct __pyx_t_6pandas_3lib_pairs)))));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":682
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window             # <<<<<<<<<<<<<<
 *     last = ring
 * 
 */
  __pyx_v_end = (__pyx_v_ring + __pyx_v_window);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":683
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window
 *     last = ring             # <<<<<<<<<<<<<<
 * 
 *     minpair = ring
 */
  __pyx_v_last = __pyx_v_ring;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":685
 *     last = ring
 * 
 *     minpair = ring             # <<<<<<<<<<<<<<
 *     ai = a[0]
 *     if ai == ai:
 */
  __pyx_v_minpair = __pyx_v_ring;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":686
 * 
 *     minpair = ring
 *     ai = a[0]             # <<<<<<<<<<<<<<
 *     if ai == ai:
 *         minpair.value = ai
 */
  __pyx_t_11 = 0;
  __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_a.buf, __pyx_t_11, __pyx_bstride_0_a));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":687
 *     minpair = ring
 *     ai = a[0]
 *     if ai == ai:             # <<<<<<<<<<<<<<
 *         minpair.value = ai
 *     else:
 */
  __pyx_t_10 = (__pyx_v_ai == __pyx_v_ai);
  if (__pyx_t_10) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":688
 *     ai = a[0]
 *     if ai == ai:
 *         minpair.value = ai             # <<<<<<<<<<<<<<
 *     else:
 *         minpair.value = MINfloat64
 */
    __pyx_v_minpair->value = __pyx_v_ai;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":690
 *         minpair.value = ai
 *     else:
 *         minpair.value = MINfloat64             # <<<<<<<<<<<<<<
 *     minpair.death = window
 * 
 */
    __pyx_v_minpair->value = __pyx_v_6pandas_3lib_MINfloat64;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":691
 *     else:
 *         minpair.value = MINfloat64
 *     minpair.death = window             # <<<<<<<<<<<<<<
 * 
 *     count = 0
 */
  __pyx_v_minpair->death = __pyx_v_window;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":693
 *     minpair.death = window
 * 
 *     count = 0             # <<<<<<<<<<<<<<
 *     for i0 in range(n0):
 *         ai = a[i0]
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":694
 * 
 *     count = 0
 *     for i0 in range(n0):             # <<<<<<<<<<<<<<
 *         ai = a[i0]
 *         if ai == ai:
 */
  __pyx_t_12 = __pyx_v_n0;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_i0 = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":695
 *     count = 0
 *     for i0 in range(n0):
 *         ai = a[i0]             # <<<<<<<<<<<<<<
 *         if ai == ai:
 *             count += 1
 */
    __pyx_t_14 = __pyx_v_i0;
    __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_a.buf, __pyx_t_14, __pyx_bstride_0_a));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":696
 *     for i0 in range(n0):
 *         ai = a[i0]
 *         if ai == ai:             # <<<<<<<<<<<<<<
 *             count += 1
 *         else:
 */
    __pyx_t_10 = (__pyx_v_ai == __pyx_v_ai);
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":697
 *         ai = a[i0]
 *         if ai == ai:
 *             count += 1             # <<<<<<<<<<<<<<
 *         else:
 *             ai = MINfloat64
 */
      __pyx_v_count = (__pyx_v_count + 1);
      goto __pyx_L10;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":699
 *             count += 1
 *         else:
 *             ai = MINfloat64             # <<<<<<<<<<<<<<
 *         if i0 >= window:
 *             aold = a[i0 - window]
 */
      __pyx_v_ai = __pyx_v_6pandas_3lib_MINfloat64;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":700
 *         else:
 *             ai = MINfloat64
 *         if i0 >= window:             # <<<<<<<<<<<<<<
 *             aold = a[i0 - window]
 *             if aold == aold:
 */
    __pyx_t_10 = (__pyx_v_i0 >= __pyx_v_window);
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":701
 *             ai = MINfloat64
 *         if i0 >= window:
 *             aold = a[i0 - window]             # <<<<<<<<<<<<<<
 *             if aold == aold:
 *                 count -= 1
 */
      __pyx_t_15 = (__pyx_v_i0 - __pyx_v_window);
      __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_a.buf, __pyx_t_15, __pyx_bstride_0_a));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":702
 *         if i0 >= window:
 *             aold = a[i0 - window]
 *             if aold == aold:             # <<<<<<<<<<<<<<
 *                 count -= 1
 *         if minpair.death == i0:
 */
      __pyx_t_10 = (__pyx_v_aold == __pyx_v_aold);
      if (__pyx_t_10) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":703
 *             aold = a[i0 - window]
 *             if aold == aold:
 *                 count -= 1             # <<<<<<<<<<<<<<
 *         if minpair.death == i0:
 *             minpair += 1
 */
        __pyx_v_count = (__pyx_v_count - 1);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":704
 *             if aold == aold:
 *                 count -= 1
 *         if minpair.death == i0:             # <<<<<<<<<<<<<<
 *             minpair += 1
 *             if minpair >= end:
 */
    __pyx_t_10 = (__pyx_v_minpair->death == __pyx_v_i0);
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":705
 *                 count -= 1
 *         if minpair.death == i0:
 *             minpair += 1             # <<<<<<<<<<<<<<
 *             if minpair >= end:
 *                 minpair = ring
 */
      __pyx_v_minpair = (__pyx_v_minpair + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":706
 *         if minpair.death == i0:
 *             minpair += 1
 *             if minpair >= end:             # <<<<<<<<<<<<<<
 *                 minpair = ring
 *         if ai >= minpair.value:
 */
      __pyx_t_10 = (__pyx_v_minpair >= __pyx_v_end);
      if (__pyx_t_10) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":707
 *             minpair += 1
 *             if minpair >= end:
 *                 minpair = ring             # <<<<<<<<<<<<<<
 *         if ai >= minpair.value:
 *             minpair.value = ai
 */
        __pyx_v_minpair = __pyx_v_ring;
        goto __pyx_L14;
      }
      __pyx_L14:;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":708
 *             if minpair >= end:
 *                 minpair = ring
 *         if ai >= minpair.value:             # <<<<<<<<<<<<<<
 *             minpair.value = ai
 *             minpair.death = i0 + window
 */
    __pyx_t_10 = (__pyx_v_ai >= __pyx_v_minpair->value);
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":709
 *                 minpair = ring
 *         if ai >= minpair.value:
 *             minpair.value = ai             # <<<<<<<<<<<<<<
 *             minpair.death = i0 + window
 *             last = minpair
 */
      __pyx_v_minpair->value = __pyx_v_ai;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":710
 *         if ai >= minpair.value:
 *             minpair.value = ai
 *             minpair.death = i0 + window             # <<<<<<<<<<<<<<
 *             last = minpair
 *         else:
 */
      __pyx_v_minpair->death = (__pyx_v_i0 + __pyx_v_window);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":711
 *             minpair.value = ai
 *             minpair.death = i0 + window
 *             last = minpair             # <<<<<<<<<<<<<<
 *         else:
 *             while last.value <= ai:
 */
      __pyx_v_last = __pyx_v_minpair;
      goto __pyx_L15;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":713
 *             last = minpair
 *         else:
 *             while last.value <= ai:             # <<<<<<<<<<<<<<
 *                 if last == ring:
 *                     last = end
 */
      while (1) {
        __pyx_t_10 = (__pyx_v_last->value <= __pyx_v_ai);
        if (!__pyx_t_10) break;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":714
 *         else:
 *             while last.value <= ai:
 *                 if last == ring:             # <<<<<<<<<<<<<<
 *                     last = end
 *                 last -= 1
 */
        __pyx_t_10 = (__pyx_v_last == __pyx_v_ring);
        if (__pyx_t_10) {

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":715
 *             while last.value <= ai:
 *                 if last == ring:
 *                     last = end             # <<<<<<<<<<<<<<
 *                 last -= 1
 *             last += 1
 */
          __pyx_v_last = __pyx_v_end;
          goto __pyx_L18;
        }
        __pyx_L18:;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":716
 *                 if last == ring:
 *                     last = end
 *                 last -= 1             # <<<<<<<<<<<<<<
 *             last += 1
 *             if last == end:
 */
        __pyx_v_last = (__pyx_v_last - 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":717
 *                     last = end
 *                 last -= 1
 *             last += 1             # <<<<<<<<<<<<<<
 *             if last == end:
 *                 last = ring
 */
      __pyx_v_last = (__pyx_v_last + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":718
 *                 last -= 1
 *             last += 1
 *             if last == end:             # <<<<<<<<<<<<<<
 *                 last = ring
 *             last.value = ai
 */
      __pyx_t_10 = (__pyx_v_last == __pyx_v_end);
      if (__pyx_t_10) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":719
 *             last += 1
 *             if last == end:
 *                 last = ring             # <<<<<<<<<<<<<<
 *             last.value = ai
 *             last.death = i0 + window
 */
        __pyx_v_last = __pyx_v_ring;
        goto __pyx_L19;
      }
      __pyx_L19:;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":720
 *             if last == end:
 *                 last = ring
 *             last.value = ai             # <<<<<<<<<<<<<<
 *             last.death = i0 + window
 *         if count >= minp:
 */
      __pyx_v_last->value = __pyx_v_ai;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":721
 *                 last = ring
 *             last.value = ai
 *             last.death = i0 + window             # <<<<<<<<<<<<<<
 *         if count >= minp:
 *             y[i0] = minpair.value
 */
      __pyx_v_last->death = (__pyx_v_i0 + __pyx_v_window);
    }
    __pyx_L15:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":722
 *             last.value = ai
 *             last.death = i0 + window
 *         if count >= minp:             # <<<<<<<<<<<<<<
 *             y[i0] = minpair.value
 *         else:
 */
    __pyx_t_10 = (__pyx_v_count >= __pyx_v_minp);
    if (__pyx_t_10) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":723
 *             last.death = i0 + window
 *         if count >= minp:
 *             y[i0] = minpair.value             # <<<<<<<<<<<<<<
 *         else:
 *             y[i0] = NaN
 */
      __pyx_t_16 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_y.buf, __pyx_t_16, __pyx_bstride_0_y) = __pyx_v_minpair->value;
      goto __pyx_L20;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":725
 *             y[i0] = minpair.value
 *         else:
 *             y[i0] = NaN             # <<<<<<<<<<<<<<
 *     for i0 in range(window - 1):
 *         y[i0] = NaN
 */
      __pyx_t_17 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_y.buf, __pyx_t_17, __pyx_bstride_0_y) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L20:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":726
 *         else:
 *             y[i0] = NaN
 *     for i0 in range(window - 1):             # <<<<<<<<<<<<<<
 *         y[i0] = NaN
 * 
 */
  __pyx_t_18 = (__pyx_v_window - 1);
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_18; __pyx_t_12+=1) {
    __pyx_v_i0 = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":727
 *             y[i0] = NaN
 *     for i0 in range(window - 1):
 *         y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     stdlib.free(ring)
 */
    __pyx_t_13 = __pyx_v_i0;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_y.buf, __pyx_t_13, __pyx_bstride_0_y) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":729
 *         y[i0] = NaN
 * 
 *     stdlib.free(ring)             # <<<<<<<<<<<<<<
 *     return y
 * 
 */
  free(__pyx_v_ring);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":730
 * 
 *     stdlib.free(ring)
 *     return y             # <<<<<<<<<<<<<<
 * 
 * def roll_max(ndarray input, int win, int minp):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_y));
  __pyx_r = ((PyObject *)__pyx_v_y);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_a);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_y);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_max2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_a);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_y);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":732
 *     return y
 * 
 * def roll_max(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

static PyObject *__pyx_pf_6pandas_3lib_109roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_109roll_max[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_109roll_max = {__Pyx_NAMESTR("roll_max"), (PyCFunction)__pyx_pf_6pandas_3lib_109roll_max, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_109roll_max)};
static PyObject *__pyx_pf_6pandas_3lib_109roll_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_max");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_max") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_max", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":736
 *     O(N log(window)) implementation using skip list
 *     '''
 *     return _roll_skiplist_op(input, win, minp, _get_max)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_3lib__get_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.roll_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":739
 * 
 * 
 * cdef double_t _get_max(object skiplist, int nobs, int minp):             # <<<<<<<<<<<<<<
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(nobs - 1)
 */

static __pyx_t_5numpy_double_t __pyx_f_6pandas_3lib__get_max(PyObject *__pyx_v_skiplist, int __pyx_v_nobs, int __pyx_v_minp) {
  __pyx_t_5numpy_double_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_5numpy_double_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_max");

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":740
 * 
 * cdef double_t _get_max(object skiplist, int nobs, int minp):
 *     if nobs >= minp:             # <<<<<<<<<<<<<<
 *         return <IndexableSkiplist> skiplist.get(nobs - 1)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_nobs >= __pyx_v_minp);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":741
 * cdef double_t _get_max(object skiplist, int nobs, int minp):
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(nobs - 1)             # <<<<<<<<<<<<<<
 *     else:
 *         return NaN
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_skiplist, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyInt_FromLong((__pyx_v_nobs - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":743
 *         return <IndexableSkiplist> skiplist.get(nobs - 1)
 *     else:
 *         return NaN             # <<<<<<<<<<<<<<
 * 
 * def roll_min(ndarray input, int win, int minp):
 */
    __pyx_r = __pyx_v_6pandas_3lib_NaN;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pandas.lib._get_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":745
 *         return NaN
 * 
 * def roll_min(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */

static PyObject *__pyx_pf_6pandas_3lib_110roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_110roll_min[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_110roll_min = {__Pyx_NAMESTR("roll_min"), (PyCFunction)__pyx_pf_6pandas_3lib_110roll_min, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_110roll_min)};
static PyObject *__pyx_pf_6pandas_3lib_110roll_min(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_min");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_min") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_min", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":749
 *     O(N log(window)) implementation using skip list
 *     '''
 *     return _roll_skiplist_op(input, win, minp, _get_min)             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib__roll_skiplist_op(__pyx_v_input, __pyx_v_win, __pyx_v_minp, __pyx_f_6pandas_3lib__get_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.roll_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":753
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp):             # <<<<<<<<<<<<<<
 *     "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs."
 *     cdef np.float64_t ai, aold
 */

static PyObject *__pyx_pf_6pandas_3lib_111roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_111roll_min2[] = "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs.";
static PyMethodDef __pyx_mdef_6pandas_3lib_111roll_min2 = {__Pyx_NAMESTR("roll_min2"), (PyCFunction)__pyx_pf_6pandas_3lib_111roll_min2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_111roll_min2)};
static PyObject *__pyx_pf_6pandas_3lib_111roll_min2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_a = 0;
  int __pyx_v_window;
  int __pyx_v_minp;
  __pyx_t_5numpy_float64_t __pyx_v_ai;
  __pyx_t_5numpy_float64_t __pyx_v_aold;
  Py_ssize_t __pyx_v_count;
  struct __pyx_t_6pandas_3lib_pairs *__pyx_v_ring;
  struct __pyx_t_6pandas_3lib_pairs *__pyx_v_minpair;
  struct __pyx_t_6pandas_3lib_pairs *__pyx_v_end;
  struct __pyx_t_6pandas_3lib_pairs *__pyx_v_last;
  Py_ssize_t __pyx_v_i0;
  npy_intp *__pyx_v_dim;
  Py_ssize_t __pyx_v_n0;
  npy_intp *__pyx_v_dims;
  PyArrayObject *__pyx_v_y = 0;
  Py_buffer __pyx_bstruct_a;
  Py_ssize_t __pyx_bstride_0_a = 0;
  Py_ssize_t __pyx_bshape_0_a = 0;
  Py_buffer __pyx_bstruct_y;
  Py_ssize_t __pyx_bstride_0_y = 0;
  Py_ssize_t __pyx_bshape_0_y = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  npy_intp __pyx_t_1[1];
  PyObject *__pyx_t_2 = NULL;
  PyArrayObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  long __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  long __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__window,&__pyx_n_s__minp,0};
  __Pyx_RefNannySetupContext("roll_min2");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__window);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_min2") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_a = ((PyArrayObject *)values[0]);
    __pyx_v_window = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_window == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_min2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_min2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_y.buf = NULL;
  __pyx_bstruct_a.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_5numpy_ndarray, 1, "a", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_a, (PyObject*)__pyx_v_a, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_a = __pyx_bstruct_a.strides[0];
  __pyx_bshape_0_a = __pyx_bstruct_a.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":763
 *     cdef Py_ssize_t i0
 *     cdef np.npy_intp *dim
 *     dim = PyArray_DIMS(a)             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t n0 = dim[0]
 *     cdef np.npy_intp *dims = [n0]
 */
  __pyx_v_dim = PyArray_DIMS(((PyArrayObject *)__pyx_v_a));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":764
 *     cdef np.npy_intp *dim
 *     dim = PyArray_DIMS(a)
 *     cdef Py_ssize_t n0 = dim[0]             # <<<<<<<<<<<<<<
 *     cdef np.npy_intp *dims = [n0]
 *     cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims,
 */
  __pyx_v_n0 = (__pyx_v_dim[0]);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":765
 *     dim = PyArray_DIMS(a)
 *     cdef Py_ssize_t n0 = dim[0]
 *     cdef np.npy_intp *dims = [n0]             # <<<<<<<<<<<<<<
 *     cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims,
 * 		NPY_float64, 0)
 */
  __pyx_t_1[0] = __pyx_v_n0;
  __pyx_v_dims = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":767
 *     cdef np.npy_intp *dims = [n0]
 *     cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims,
 * 		NPY_float64, 0)             # <<<<<<<<<<<<<<
 *     if (window < 1) or (window > n0):
 *         raise ValueError('Invalid window size %d for len %d array'
 */
  __pyx_t_2 = PyArray_EMPTY(1, __pyx_v_dims, NPY_FLOAT64, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_y, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_y = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_y.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_y = __pyx_bstruct_y.strides[0];
      __pyx_bshape_0_y = __pyx_bstruct_y.shape[0];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_y = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":768
 *     cdef np.ndarray[np.float64_t, ndim=1] y = PyArray_EMPTY(1, dims,
 * 		NPY_float64, 0)
 *     if (window < 1) or (window > n0):             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid window size %d for len %d array'
 *                          % (window, n0))
 */
  __pyx_t_4 = (__pyx_v_window < 1);
  if (!__pyx_t_4) {
    __pyx_t_5 = (__pyx_v_window > __pyx_v_n0);
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":770
 *     if (window < 1) or (window > n0):
 *         raise ValueError('Invalid window size %d for len %d array'
 *                          % (window, n0))             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, n0)
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_window); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_2 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_98), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_8));
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":772
 *                          % (window, n0))
 * 
 *     minp = _check_minp(minp, n0)             # <<<<<<<<<<<<<<
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 */
  __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_8 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_minp = __pyx_t_10;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":774
 *     minp = _check_minp(minp, n0)
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))             # <<<<<<<<<<<<<<
 *     end = ring + window
 *     last = ring
 */
  __pyx_v_ring = ((struct __pyx_t_6pandas_3lib_pairs *)malloc((__pyx_v_window * (sizeof(struct __pyx_t_6pandas_3lib_pairs)))));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":775
 * 
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window             # <<<<<<<<<<<<<<
 *     last = ring
 * 
 */
  __pyx_v_end = (__pyx_v_ring + __pyx_v_window);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":776
 *     ring = <pairs*>stdlib.malloc(window * sizeof(pairs))
 *     end = ring + window
 *     last = ring             # <<<<<<<<<<<<<<
 * 
 *     minpair = ring
 */
  __pyx_v_last = __pyx_v_ring;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":778
 *     last = ring
 * 
 *     minpair = ring             # <<<<<<<<<<<<<<
 *     ai = a[0]
 *     if ai == ai:
 */
  __pyx_v_minpair = __pyx_v_ring;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":779
 * 
 *     minpair = ring
 *     ai = a[0]             # <<<<<<<<<<<<<<
 *     if ai == ai:
 *         minpair.value = ai
 */
  __pyx_t_11 = 0;
  __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_a.buf, __pyx_t_11, __pyx_bstride_0_a));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":780
 *     minpair = ring
 *     ai = a[0]
 *     if ai == ai:             # <<<<<<<<<<<<<<
 *         minpair.value = ai
 *     else:
 */
  __pyx_t_6 = (__pyx_v_ai == __pyx_v_ai);
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":781
 *     ai = a[0]
 *     if ai == ai:
 *         minpair.value = ai             # <<<<<<<<<<<<<<
 *     else:
 *         minpair.value = MAXfloat64
 */
    __pyx_v_minpair->value = __pyx_v_ai;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":783
 *         minpair.value = ai
 *     else:
 *         minpair.value = MAXfloat64             # <<<<<<<<<<<<<<
 *     minpair.death = window
 * 
 */
    __pyx_v_minpair->value = __pyx_v_6pandas_3lib_MAXfloat64;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":784
 *     else:
 *         minpair.value = MAXfloat64
 *     minpair.death = window             # <<<<<<<<<<<<<<
 * 
 *     count = 0
 */
  __pyx_v_minpair->death = __pyx_v_window;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":786
 *     minpair.death = window
 * 
 *     count = 0             # <<<<<<<<<<<<<<
 *     for i0 in range(n0):
 *         ai = a[i0]
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":787
 * 
 *     count = 0
 *     for i0 in range(n0):             # <<<<<<<<<<<<<<
 *         ai = a[i0]
 *         if ai == ai:
 */
  __pyx_t_12 = __pyx_v_n0;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
    __pyx_v_i0 = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":788
 *     count = 0
 *     for i0 in range(n0):
 *         ai = a[i0]             # <<<<<<<<<<<<<<
 *         if ai == ai:
 *             count += 1
 */
    __pyx_t_14 = __pyx_v_i0;
    __pyx_v_ai = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_a.buf, __pyx_t_14, __pyx_bstride_0_a));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":789
 *     for i0 in range(n0):
 *         ai = a[i0]
 *         if ai == ai:             # <<<<<<<<<<<<<<
 *             count += 1
 *         else:
 */
    __pyx_t_6 = (__pyx_v_ai == __pyx_v_ai);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":790
 *         ai = a[i0]
 *         if ai == ai:
 *             count += 1             # <<<<<<<<<<<<<<
 *         else:
 *             ai = MAXfloat64
 */
      __pyx_v_count = (__pyx_v_count + 1);
      goto __pyx_L10;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":792
 *             count += 1
 *         else:
 *             ai = MAXfloat64             # <<<<<<<<<<<<<<
 *         if i0 >= window:
 *             aold = a[i0 - window]
 */
      __pyx_v_ai = __pyx_v_6pandas_3lib_MAXfloat64;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":793
 *         else:
 *             ai = MAXfloat64
 *         if i0 >= window:             # <<<<<<<<<<<<<<
 *             aold = a[i0 - window]
 *             if aold == aold:
 */
    __pyx_t_6 = (__pyx_v_i0 >= __pyx_v_window);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":794
 *             ai = MAXfloat64
 *         if i0 >= window:
 *             aold = a[i0 - window]             # <<<<<<<<<<<<<<
 *             if aold == aold:
 *                 count -= 1
 */
      __pyx_t_15 = (__pyx_v_i0 - __pyx_v_window);
      __pyx_v_aold = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_a.buf, __pyx_t_15, __pyx_bstride_0_a));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":795
 *         if i0 >= window:
 *             aold = a[i0 - window]
 *             if aold == aold:             # <<<<<<<<<<<<<<
 *                 count -= 1
 *         if minpair.death == i0:
 */
      __pyx_t_6 = (__pyx_v_aold == __pyx_v_aold);
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":796
 *             aold = a[i0 - window]
 *             if aold == aold:
 *                 count -= 1             # <<<<<<<<<<<<<<
 *         if minpair.death == i0:
 *             minpair += 1
 */
        __pyx_v_count = (__pyx_v_count - 1);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":797
 *             if aold == aold:
 *                 count -= 1
 *         if minpair.death == i0:             # <<<<<<<<<<<<<<
 *             minpair += 1
 *             if minpair >= end:
 */
    __pyx_t_6 = (__pyx_v_minpair->death == __pyx_v_i0);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":798
 *                 count -= 1
 *         if minpair.death == i0:
 *             minpair += 1             # <<<<<<<<<<<<<<
 *             if minpair >= end:
 *                 minpair = ring
 */
      __pyx_v_minpair = (__pyx_v_minpair + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":799
 *         if minpair.death == i0:
 *             minpair += 1
 *             if minpair >= end:             # <<<<<<<<<<<<<<
 *                 minpair = ring
 *         if ai <= minpair.value:
 */
      __pyx_t_6 = (__pyx_v_minpair >= __pyx_v_end);
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":800
 *             minpair += 1
 *             if minpair >= end:
 *                 minpair = ring             # <<<<<<<<<<<<<<
 *         if ai <= minpair.value:
 *             minpair.value = ai
 */
        __pyx_v_minpair = __pyx_v_ring;
        goto __pyx_L14;
      }
      __pyx_L14:;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":801
 *             if minpair >= end:
 *                 minpair = ring
 *         if ai <= minpair.value:             # <<<<<<<<<<<<<<
 *             minpair.value = ai
 *             minpair.death = i0 + window
 */
    __pyx_t_6 = (__pyx_v_ai <= __pyx_v_minpair->value);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":802
 *                 minpair = ring
 *         if ai <= minpair.value:
 *             minpair.value = ai             # <<<<<<<<<<<<<<
 *             minpair.death = i0 + window
 *             last = minpair
 */
      __pyx_v_minpair->value = __pyx_v_ai;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":803
 *         if ai <= minpair.value:
 *             minpair.value = ai
 *             minpair.death = i0 + window             # <<<<<<<<<<<<<<
 *             last = minpair
 *         else:
 */
      __pyx_v_minpair->death = (__pyx_v_i0 + __pyx_v_window);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":804
 *             minpair.value = ai
 *             minpair.death = i0 + window
 *             last = minpair             # <<<<<<<<<<<<<<
 *         else:
 *             while last.value >= ai:
 */
      __pyx_v_last = __pyx_v_minpair;
      goto __pyx_L15;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":806
 *             last = minpair
 *         else:
 *             while last.value >= ai:             # <<<<<<<<<<<<<<
 *                 if last == ring:
 *                     last = end
 */
      while (1) {
        __pyx_t_6 = (__pyx_v_last->value >= __pyx_v_ai);
        if (!__pyx_t_6) break;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":807
 *         else:
 *             while last.value >= ai:
 *                 if last == ring:             # <<<<<<<<<<<<<<
 *                     last = end
 *                 last -= 1
 */
        __pyx_t_6 = (__pyx_v_last == __pyx_v_ring);
        if (__pyx_t_6) {

          /* "/home/wesm/code/pandas/pandas/src/moments.pyx":808
 *             while last.value >= ai:
 *                 if last == ring:
 *                     last = end             # <<<<<<<<<<<<<<
 *                 last -= 1
 *             last += 1
 */
          __pyx_v_last = __pyx_v_end;
          goto __pyx_L18;
        }
        __pyx_L18:;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":809
 *                 if last == ring:
 *                     last = end
 *                 last -= 1             # <<<<<<<<<<<<<<
 *             last += 1
 *             if last == end:
 */
        __pyx_v_last = (__pyx_v_last - 1);
      }

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":810
 *                     last = end
 *                 last -= 1
 *             last += 1             # <<<<<<<<<<<<<<
 *             if last == end:
 *                 last = ring
 */
      __pyx_v_last = (__pyx_v_last + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":811
 *                 last -= 1
 *             last += 1
 *             if last == end:             # <<<<<<<<<<<<<<
 *                 last = ring
 *             last.value = ai
 */
      __pyx_t_6 = (__pyx_v_last == __pyx_v_end);
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":812
 *             last += 1
 *             if last == end:
 *                 last = ring             # <<<<<<<<<<<<<<
 *             last.value = ai
 *             last.death = i0 + window
 */
        __pyx_v_last = __pyx_v_ring;
        goto __pyx_L19;
      }
      __pyx_L19:;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":813
 *             if last == end:
 *                 last = ring
 *             last.value = ai             # <<<<<<<<<<<<<<
 *             last.death = i0 + window
 *         if count >= minp:
 */
      __pyx_v_last->value = __pyx_v_ai;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":814
 *                 last = ring
 *             last.value = ai
 *             last.death = i0 + window             # <<<<<<<<<<<<<<
 *         if count >= minp:
 *             y[i0] = minpair.value
 */
      __pyx_v_last->death = (__pyx_v_i0 + __pyx_v_window);
    }
    __pyx_L15:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":815
 *             last.value = ai
 *             last.death = i0 + window
 *         if count >= minp:             # <<<<<<<<<<<<<<
 *             y[i0] = minpair.value
 *         else:
 */
    __pyx_t_6 = (__pyx_v_count >= __pyx_v_minp);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":816
 *             last.death = i0 + window
 *         if count >= minp:
 *             y[i0] = minpair.value             # <<<<<<<<<<<<<<
 *         else:
 *             y[i0] = NaN
 */
      __pyx_t_16 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_y.buf, __pyx_t_16, __pyx_bstride_0_y) = __pyx_v_minpair->value;
      goto __pyx_L20;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":818
 *             y[i0] = minpair.value
 *         else:
 *             y[i0] = NaN             # <<<<<<<<<<<<<<
 *     for i0 in range(window - 1):
 *         y[i0] = NaN
 */
      __pyx_t_17 = __pyx_v_i0;
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_y.buf, __pyx_t_17, __pyx_bstride_0_y) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L20:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":819
 *         else:
 *             y[i0] = NaN
 *     for i0 in range(window - 1):             # <<<<<<<<<<<<<<
 *         y[i0] = NaN
 * 
 */
  __pyx_t_18 = (__pyx_v_window - 1);
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_18; __pyx_t_12+=1) {
    __pyx_v_i0 = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":820
 *             y[i0] = NaN
 *     for i0 in range(window - 1):
 *         y[i0] = NaN             # <<<<<<<<<<<<<<
 * 
 *     stdlib.free(ring)
 */
    __pyx_t_13 = __pyx_v_i0;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_y.buf, __pyx_t_13, __pyx_bstride_0_y) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":822
 *         y[i0] = NaN
 * 
 *     stdlib.free(ring)             # <<<<<<<<<<<<<<
 *     return y
 * 
 */
  free(__pyx_v_ring);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":823
 * 
 *     stdlib.free(ring)
 *     return y             # <<<<<<<<<<<<<<
 * 
 * cdef double_t _get_min(object skiplist, int nobs, int minp):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_y));
  __pyx_r = ((PyObject *)__pyx_v_y);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_a);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_y);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_min2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_a);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_y);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":825
 *     return y
 * 
 * cdef double_t _get_min(object skiplist, int nobs, int minp):             # <<<<<<<<<<<<<<
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(0)
 */

static __pyx_t_5numpy_double_t __pyx_f_6pandas_3lib__get_min(PyObject *__pyx_v_skiplist, int __pyx_v_nobs, int __pyx_v_minp) {
  __pyx_t_5numpy_double_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_double_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_min");

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":826
 * 
 * cdef double_t _get_min(object skiplist, int nobs, int minp):
 *     if nobs >= minp:             # <<<<<<<<<<<<<<
 *         return <IndexableSkiplist> skiplist.get(0)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_nobs >= __pyx_v_minp);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":827
 * cdef double_t _get_min(object skiplist, int nobs, int minp):
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(0)             # <<<<<<<<<<<<<<
 *     else:
 *         return NaN
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_skiplist, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":829
 *         return <IndexableSkiplist> skiplist.get(0)
 *     else:
 *         return NaN             # <<<<<<<<<<<<<<
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,
 */
    __pyx_r = __pyx_v_6pandas_3lib_NaN;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pandas.lib._get_min", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":831
 *         return NaN
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                   int minp, double quantile):
 *     '''
 */

static PyObject *__pyx_pf_6pandas_3lib_112roll_quantile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_112roll_quantile[] = "\n    O(N log(window)) implementation using skip list\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_112roll_quantile = {__Pyx_NAMESTR("roll_quantile"), (PyCFunction)__pyx_pf_6pandas_3lib_112roll_quantile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_112roll_quantile)};
static PyObject *__pyx_pf_6pandas_3lib_112roll_quantile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  double __pyx_v_quantile;
  double __pyx_v_val;
  double __pyx_v_prev;
  struct __pyx_obj_6pandas_3lib_IndexableSkiplist *__pyx_v_skiplist = 0;
  Py_ssize_t __pyx_v_nobs;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_N;
  PyArrayObject *__pyx_v_output = 0;
  PyObject *__pyx_v_idx = NULL;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  long __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  __pyx_t_5numpy_double_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,&__pyx_n_s__quantile,0};
  __Pyx_RefNannySetupContext("roll_quantile");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__quantile);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_quantile") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_quantile = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_quantile == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_quantile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_quantile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_input.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
  __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":838
 *     cdef double val, prev, midpoint
 *     cdef IndexableSkiplist skiplist
 *     cdef Py_ssize_t nobs = 0, i             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t N = len(input)
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 */
  __pyx_v_nobs = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":839
 *     cdef IndexableSkiplist skiplist
 *     cdef Py_ssize_t nobs = 0, i
 *     cdef Py_ssize_t N = len(input)             # <<<<<<<<<<<<<<
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_N = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":840
 *     cdef Py_ssize_t nobs = 0, i
 *     cdef Py_ssize_t N = len(input)
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)             # <<<<<<<<<<<<<<
 * 
 *     skiplist = IndexableSkiplist(win)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":842
 *     cdef ndarray[double_t] output = np.empty(N, dtype=float)
 * 
 *     skiplist = IndexableSkiplist(win)             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, N)
 */
  __pyx_t_5 = PyInt_FromLong(__pyx_v_win); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_IndexableSkiplist)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_skiplist = ((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":844
 *     skiplist = IndexableSkiplist(win)
 * 
 *     minp = _check_minp(minp, N)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < minp - 1:
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_N); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_minp = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":846
 *     minp = _check_minp(minp, N)
 * 
 *     for i from 0 <= i < minp - 1:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_8 = (__pyx_v_minp - 1);
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":847
 * 
 *     for i from 0 <= i < minp - 1:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         # Not NaN
 */
    __pyx_t_1 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_1 < 0) {
      __pyx_t_1 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_1 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_1 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_input.buf, __pyx_t_1, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":850
 * 
 *         # Not NaN
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":851
 *         # Not NaN
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":852
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         output[i] = NaN
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":854
 *             skiplist.insert(val)
 * 
 *         output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from minp - 1 <= i < N:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_output;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_10, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":856
 *         output[i] = NaN
 * 
 *     for i from minp - 1 <= i < N:             # <<<<<<<<<<<<<<
 *         val = input[i]
 * 
 */
  __pyx_t_11 = __pyx_v_N;
  for (__pyx_v_i = (__pyx_v_minp - 1); __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":857
 * 
 *     for i from minp - 1 <= i < N:
 *         val = input[i]             # <<<<<<<<<<<<<<
 * 
 *         if i > win - 1:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_input;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_input.buf, __pyx_t_12, __pyx_bstride_0_input));

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":859
 *         val = input[i]
 * 
 *         if i > win - 1:             # <<<<<<<<<<<<<<
 *             prev = input[i - win]
 * 
 */
    __pyx_t_9 = (__pyx_v_i > (__pyx_v_win - 1));
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":860
 * 
 *         if i > win - 1:
 *             prev = input[i - win]             # <<<<<<<<<<<<<<
 * 
 *             if prev == prev:
 */
      __pyx_t_13 = (__pyx_v_i - __pyx_v_win);
      __pyx_t_7 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_input;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_input)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_prev = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_input.buf, __pyx_t_13, __pyx_bstride_0_input));

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":862
 *             prev = input[i - win]
 * 
 *             if prev == prev:             # <<<<<<<<<<<<<<
 *                 skiplist.remove(prev)
 *                 nobs -= 1
 */
      __pyx_t_9 = (__pyx_v_prev == __pyx_v_prev);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":863
 * 
 *             if prev == prev:
 *                 skiplist.remove(prev)             # <<<<<<<<<<<<<<
 *                 nobs -= 1
 * 
 */
        __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->remove(__pyx_v_skiplist, __pyx_v_prev, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "/home/wesm/code/pandas/pandas/src/moments.pyx":864
 *             if prev == prev:
 *                 skiplist.remove(prev)
 *                 nobs -= 1             # <<<<<<<<<<<<<<
 * 
 *         if val == val:
 */
        __pyx_v_nobs = (__pyx_v_nobs - 1);
        goto __pyx_L12;
      }
      __pyx_L12:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":866
 *                 nobs -= 1
 * 
 *         if val == val:             # <<<<<<<<<<<<<<
 *             nobs += 1
 *             skiplist.insert(val)
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_val);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":867
 * 
 *         if val == val:
 *             nobs += 1             # <<<<<<<<<<<<<<
 *             skiplist.insert(val)
 * 
 */
      __pyx_v_nobs = (__pyx_v_nobs + 1);

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":868
 *         if val == val:
 *             nobs += 1
 *             skiplist.insert(val)             # <<<<<<<<<<<<<<
 * 
 *         if nobs >= minp:
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->insert(__pyx_v_skiplist, __pyx_v_val, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":870
 *             skiplist.insert(val)
 * 
 *         if nobs >= minp:             # <<<<<<<<<<<<<<
 *             idx = int((quantile / 1.) * (nobs - 1))
 *             output[i] = skiplist.get(idx)
 */
    __pyx_t_9 = (__pyx_v_nobs >= __pyx_v_minp);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":871
 * 
 *         if nobs >= minp:
 *             idx = int((quantile / 1.) * (nobs - 1))             # <<<<<<<<<<<<<<
 *             output[i] = skiplist.get(idx)
 *         else:
 */
      __pyx_t_4 = PyFloat_FromDouble(((__pyx_v_quantile / 1.) * (__pyx_v_nobs - 1))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_v_idx);
      __pyx_v_idx = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":872
 *         if nobs >= minp:
 *             idx = int((quantile / 1.) * (nobs - 1))
 *             output[i] = skiplist.get(idx)             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist *)__pyx_v_skiplist->__pyx_vtab)->get(__pyx_v_skiplist, __pyx_t_14, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_15 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_14, __pyx_bstride_0_output) = __pyx_t_15;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":874
 *             output[i] = skiplist.get(idx)
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_output)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_16, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L14:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":876
 *             output[i] = NaN
 * 
 *     return output             # <<<<<<<<<<<<<<
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input, int win,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_quantile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_skiplist);
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/moments.pyx":878
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                  int minp, object func):
 *     cdef ndarray[double_t] output, counts, bufarr
 */

static PyObject *__pyx_pf_6pandas_3lib_113roll_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_113roll_generic = {__Pyx_NAMESTR("roll_generic"), (PyCFunction)__pyx_pf_6pandas_3lib_113roll_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_113roll_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_input = 0;
  int __pyx_v_win;
  int __pyx_v_minp;
  PyObject *__pyx_v_func = 0;
  PyArrayObject *__pyx_v_output = 0;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_bufarr = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_float64_t *__pyx_v_buf;
  __pyx_t_5numpy_float64_t *__pyx_v_oldbuf;
  Py_buffer __pyx_bstruct_bufarr;
  Py_ssize_t __pyx_bstride_0_bufarr = 0;
  Py_ssize_t __pyx_bshape_0_bufarr = 0;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  Py_buffer __pyx_bstruct_input;
  Py_ssize_t __pyx_bstride_0_input = 0;
  Py_ssize_t __pyx_bshape_0_input = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  __pyx_t_5numpy_double_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__input,&__pyx_n_s__win,&__pyx_n_s__minp,&__pyx_n_s__func,0};
  __Pyx_RefNannySetupContext("roll_generic");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__input);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__win);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minp);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "roll_generic") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_input = ((PyArrayObject *)values[0]);
    __pyx_v_win = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_win == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_minp = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_minp == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_func = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("roll_generic", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.roll_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF((PyObject *)__pyx_v_input);
  __pyx_bstruct_output.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_bufarr.buf = NULL;
  __pyx_bstruct_input.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input), __pyx_ptype_5numpy_ndarray, 1, "input", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
  __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":884
 *     cdef float64_t *buf, *oldbuf
 * 
 *     if not input.flags.c_contiguous:             # <<<<<<<<<<<<<<
 *         input = input.copy('C')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_input), __pyx_n_s__flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__c_contiguous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":885
 * 
 *     if not input.flags.c_contiguous:
 *         input = input.copy('C')             # <<<<<<<<<<<<<<
 * 
 *     buf = <float64_t*> input.data
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_input), __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_input, (PyObject*)__pyx_v_input, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 1, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_input = __pyx_bstruct_input.strides[0];
      __pyx_bshape_0_input = __pyx_bstruct_input.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_input));
    __pyx_v_input = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":887
 *         input = input.copy('C')
 * 
 *     buf = <float64_t*> input.data             # <<<<<<<<<<<<<<
 * 
 *     n = len(input)
 */
  __pyx_v_buf = ((__pyx_t_5numpy_float64_t *)__pyx_v_input->data);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":889
 *     buf = <float64_t*> input.data
 * 
 *     n = len(input)             # <<<<<<<<<<<<<<
 *     if n == 0:
 *         return input
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":890
 * 
 *     n = len(input)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return input
 * 
 */
  __pyx_t_4 = (__pyx_v_n == 0);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":891
 *     n = len(input)
 *     if n == 0:
 *         return input             # <<<<<<<<<<<<<<
 * 
 *     minp = _check_minp(minp, n)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_input));
    __pyx_r = ((PyObject *)__pyx_v_input);
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":893
 *         return input
 * 
 *     minp = _check_minp(minp, n)             # <<<<<<<<<<<<<<
 *     output = np.empty(n, dtype=float)
 *     counts = roll_sum(np.isfinite(input).astype(float), win, minp)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___check_minp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_12));
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_2 = 0;
  __pyx_t_11 = 0;
  __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
  __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_11); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_v_minp = __pyx_t_6;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":894
 * 
 *     minp = _check_minp(minp, n)
 *     output = np.empty(n, dtype=float)             # <<<<<<<<<<<<<<
 *     counts = roll_sum(np.isfinite(input).astype(float), win, minp)
 * 
 */
  __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__empty); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;
  __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_12, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_v_output, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
    __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":895
 *     minp = _check_minp(minp, n)
 *     output = np.empty(n, dtype=float)
 *     counts = roll_sum(np.isfinite(input).astype(float), win, minp)             # <<<<<<<<<<<<<<
 * 
 *     bufarr = np.empty(win, dtype=float)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__roll_sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__isfinite); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  __Pyx_INCREF(((PyObject *)__pyx_v_input));
  PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_input));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_input));
  __pyx_t_12 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  __pyx_t_11 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__astype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_12));
  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
  PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)((PyObject*)(&PyFloat_Type))));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
  __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
  __pyx_t_12 = PyInt_FromLong(__pyx_v_win); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = PyInt_FromLong(__pyx_v_minp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_14));
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_1 = 0;
  __pyx_t_12 = 0;
  __pyx_t_11 = 0;
  __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
  if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":897
 *     counts = roll_sum(np.isfinite(input).astype(float), win, minp)
 * 
 *     bufarr = np.empty(win, dtype=float)             # <<<<<<<<<<<<<<
 *     oldbuf = <float64_t*> bufarr.data
 * 
 */
  __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_14 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyInt_FromLong(__pyx_v_win); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;
  __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyFloat_Type)))) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_14, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bufarr);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_bufarr, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bufarr, (PyObject*)__pyx_v_bufarr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_bufarr = __pyx_bstruct_bufarr.strides[0];
    __pyx_bshape_0_bufarr = __pyx_bstruct_bufarr.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_bufarr = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":898
 * 
 *     bufarr = np.empty(win, dtype=float)
 *     oldbuf = <float64_t*> bufarr.data             # <<<<<<<<<<<<<<
 * 
 *     n = len(input)
 */
  __pyx_v_oldbuf = ((__pyx_t_5numpy_float64_t *)__pyx_v_bufarr->data);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":900
 *     oldbuf = <float64_t*> bufarr.data
 * 
 *     n = len(input)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < win:
 *         if counts[i] >= minp:
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_input)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":901
 * 
 *     n = len(input)
 *     for i from 0 <= i < win:             # <<<<<<<<<<<<<<
 *         if counts[i] >= minp:
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1])
 */
  __pyx_t_6 = __pyx_v_win;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":902
 *     n = len(input)
 *     for i from 0 <= i < win:
 *         if counts[i] >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1])
 *         else:
 */
    __pyx_t_10 = __pyx_v_i;
    __pyx_t_15 = -1;
    if (__pyx_t_10 < 0) {
      __pyx_t_10 += __pyx_bshape_0_counts;
      if (unlikely(__pyx_t_10 < 0)) __pyx_t_15 = 0;
    } else if (unlikely(__pyx_t_10 >= __pyx_bshape_0_counts)) __pyx_t_15 = 0;
    if (unlikely(__pyx_t_15 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_15);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_counts.buf, __pyx_t_10, __pyx_bstride_0_counts)) >= __pyx_v_minp);
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":903
 *     for i from 0 <= i < win:
 *         if counts[i] >= minp:
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1])             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_12 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_input), __pyx_f_6pandas_3lib_int_max(((__pyx_v_i - __pyx_v_win) + 1), 0), (__pyx_v_i + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_11));
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(__pyx_v_func, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_15 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_output)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_17, __pyx_bstride_0_output) = __pyx_t_16;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":905
 *             output[i] = func(input[int_max(i - win + 1, 0) : i + 1])
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     for i from win <= i < n:
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_15 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_output)) __pyx_t_15 = 0;
      if (unlikely(__pyx_t_15 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_15);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_18, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L10:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":907
 *             output[i] = NaN
 * 
 *     for i from win <= i < n:             # <<<<<<<<<<<<<<
 *         buf = buf + 1
 *         bufarr.data = <char*> buf
 */
  __pyx_t_19 = __pyx_v_n;
  for (__pyx_v_i = __pyx_v_win; __pyx_v_i < __pyx_t_19; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":908
 * 
 *     for i from win <= i < n:
 *         buf = buf + 1             # <<<<<<<<<<<<<<
 *         bufarr.data = <char*> buf
 *         if counts[i] >= minp:
 */
    __pyx_v_buf = (__pyx_v_buf + 1);

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":909
 *     for i from win <= i < n:
 *         buf = buf + 1
 *         bufarr.data = <char*> buf             # <<<<<<<<<<<<<<
 *         if counts[i] >= minp:
 *             output[i] = func(bufarr)
 */
    __pyx_v_bufarr->data = ((char *)__pyx_v_buf);

    /* "/home/wesm/code/pandas/pandas/src/moments.pyx":910
 *         buf = buf + 1
 *         bufarr.data = <char*> buf
 *         if counts[i] >= minp:             # <<<<<<<<<<<<<<
 *             output[i] = func(bufarr)
 *         else:
 */
    __pyx_t_20 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_20 < 0) {
      __pyx_t_20 += __pyx_bshape_0_counts;
      if (unlikely(__pyx_t_20 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_counts)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_counts.buf, __pyx_t_20, __pyx_bstride_0_counts)) >= __pyx_v_minp);
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":911
 *         bufarr.data = <char*> buf
 *         if counts[i] >= minp:
 *             output[i] = func(bufarr)             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = NaN
 */
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_12));
      __Pyx_INCREF(((PyObject *)__pyx_v_bufarr));
      PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_bufarr));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_bufarr));
      __pyx_t_11 = PyObject_Call(__pyx_v_func, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_output)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_21, __pyx_bstride_0_output) = __pyx_t_16;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/moments.pyx":913
 *             output[i] = func(bufarr)
 *         else:
 *             output[i] = NaN             # <<<<<<<<<<<<<<
 * 
 *     bufarr.data = <char*> oldbuf
 */
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_output)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_double_t *, __pyx_bstruct_output.buf, __pyx_t_22, __pyx_bstride_0_output) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L13:;
  }

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":915
 *             output[i] = NaN
 * 
 *     bufarr.data = <char*> oldbuf             # <<<<<<<<<<<<<<
 * 
 *     return output
 */
  __pyx_v_bufarr->data = ((char *)__pyx_v_oldbuf);

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":917
 *     bufarr.data = <char*> oldbuf
 * 
 *     return output             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  __pyx_r = ((PyObject *)__pyx_v_output);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bufarr);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.roll_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bufarr);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_input);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF((PyObject *)__pyx_v_bufarr);
  __Pyx_XDECREF((PyObject *)__pyx_v_input);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reindex.pyx":1
 * def ordered_left_join(ndarray[object] left, ndarray[object] right):             # <<<<<<<<<<<<<<
 *     # cdef dict right_map = map_indices_buf(right)
 *     # return merge_indexer(left, right_map)
 */

static PyObject *__pyx_pf_6pandas_3lib_114ordered_left_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_114ordered_left_join = {__Pyx_NAMESTR("ordered_left_join"), (PyCFunction)__pyx_pf_6pandas_3lib_114ordered_left_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_114ordered_left_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_mask = 0;
  PyObject *__pyx_v_val = 0;
  Py_buffer __pyx_bstruct_right;
  Py_ssize_t __pyx_bstride_0_right = 0;
  Py_ssize_t __pyx_bshape_0_right = 0;
  Py_buffer __pyx_bstruct_mask;
  Py_ssize_t __pyx_bstride_0_mask = 0;
  Py_ssize_t __pyx_bshape_0_mask = 0;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_buffer __pyx_bstruct_left;
  Py_ssize_t __pyx_bstride_0_left = 0;
  Py_ssize_t __pyx_bshape_0_left = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__right,0};
  __Pyx_RefNannySetupContext("ordered_left_join");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ordered_left_join", 1, 2, 2, 1); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "ordered_left_join") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_left = ((PyArrayObject *)values[0]);
    __pyx_v_right = ((PyArrayObject *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ordered_left_join", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.ordered_left_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_indexer.buf = NULL;
  __pyx_bstruct_mask.buf = NULL;
  __pyx_bstruct_left.buf = NULL;
  __pyx_bstruct_right.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_left = __pyx_bstruct_left.strides[0];
  __pyx_bshape_0_left = __pyx_bstruct_left.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_right = __pyx_bstruct_right.strides[0];
  __pyx_bshape_0_right = __pyx_bstruct_right.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":10
 *         object val
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 *     j = 0
 *     n = len(left)
 */
  __pyx_v_i = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":11
 * 
 *     i = 0
 *     j = 0             # <<<<<<<<<<<<<<
 *     n = len(left)
 *     k = len(right)
 */
  __pyx_v_j = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":12
 *     i = 0
 *     j = 0
 *     n = len(left)             # <<<<<<<<<<<<<<
 *     k = len(right)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":13
 *     j = 0
 *     n = len(left)
 *     k = len(right)             # <<<<<<<<<<<<<<
 * 
 *     indexer = np.zeros(n, dtype=np.int32)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_right)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_k = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":15
 *     k = len(right)
 * 
 *     indexer = np.zeros(n, dtype=np.int32)             # <<<<<<<<<<<<<<
 *     mask = np.ones(n, dtype=np.uint8)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0];
    __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":16
 * 
 *     indexer = np.zeros(n, dtype=np.int32)
 *     mask = np.ones(n, dtype=np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ones); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_mask, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_bstride_0_mask = __pyx_bstruct_mask.strides[0];
    __pyx_bshape_0_mask = __pyx_bstruct_mask.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_mask = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":18
 *     mask = np.ones(n, dtype=np.uint8)
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         val = left[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":19
 * 
 *     for i from 0 <= i < n:
 *         val = left[i]             # <<<<<<<<<<<<<<
 * 
 *         while j < k and right[j] < val:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_left;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_left)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[9]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_left.buf, __pyx_t_13, __pyx_bstride_0_left);
    __Pyx_INCREF((PyObject*)__pyx_t_5);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":21
 *         val = left[i]
 * 
 *         while j < k and right[j] < val:             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
    while (1) {
      __pyx_t_14 = (__pyx_v_j < __pyx_v_k);
      if (__pyx_t_14) {
        __pyx_t_15 = __pyx_v_j;
        __pyx_t_8 = -1;
        if (__pyx_t_15 < 0) {
          __pyx_t_15 += __pyx_bshape_0_right;
          if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
        } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_right)) __pyx_t_8 = 0;
        if (unlikely(__pyx_t_8 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_8);
          {__pyx_filename = __pyx_f[9]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_5 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_right.buf, __pyx_t_15, __pyx_bstride_0_right);
        __Pyx_INCREF((PyObject*)__pyx_t_5);
        __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_val, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_17 = __pyx_t_16;
      } else {
        __pyx_t_17 = __pyx_t_14;
      }
      if (!__pyx_t_17) break;

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":22
 * 
 *         while j < k and right[j] < val:
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         if j == k:
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":24
 *             j += 1
 * 
 *         if j == k:             # <<<<<<<<<<<<<<
 *             break
 * 
 */
    __pyx_t_17 = (__pyx_v_j == __pyx_v_k);
    if (__pyx_t_17) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":25
 * 
 *         if j == k:
 *             break             # <<<<<<<<<<<<<<
 * 
 *         if val == right[j]:
 */
      goto __pyx_L7_break;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":27
 *             break
 * 
 *         if val == right[j]:             # <<<<<<<<<<<<<<
 *             indexer[i] = j
 *             mask[i] = 0
 */
    __pyx_t_18 = __pyx_v_j;
    __pyx_t_8 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_bshape_0_right;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_right)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[9]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_right.buf, __pyx_t_18, __pyx_bstride_0_right);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_t_6, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_17) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":28
 * 
 *         if val == right[j]:
 *             indexer[i] = j             # <<<<<<<<<<<<<<
 *             mask[i] = 0
 * 
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_indexer;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_indexer)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[9]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_indexer.buf, __pyx_t_19, __pyx_bstride_0_indexer) = __pyx_v_j;

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":29
 *         if val == right[j]:
 *             indexer[i] = j
 *             mask[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     return indexer, mask.view(np.bool_)
 */
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_mask;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_mask)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[9]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_mask.buf, __pyx_t_20, __pyx_bstride_0_mask) = 0;
      goto __pyx_L11;
    }
    __pyx_L11:;
  }
  __pyx_L7_break:;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":31
 *             mask[i] = 0
 * 
 *     return indexer, mask.view(np.bool_)             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_mask), __pyx_n_s__view); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__bool_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_indexer));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_indexer));
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.ordered_left_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_mask);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reindex.pyx":35
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_2d(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                  ndarray[float64_t, ndim=2] lvalues,
 *                  ndarray[float64_t, ndim=2] rvalues,
 */

static PyObject *__pyx_pf_6pandas_3lib_115left_join_2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_115left_join_2d = {__Pyx_NAMESTR("left_join_2d"), (PyCFunction)__pyx_pf_6pandas_3lib_115left_join_2d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_115left_join_2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  PyArrayObject *__pyx_v_lvalues = 0;
  PyArrayObject *__pyx_v_rvalues = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  Py_ssize_t __pyx_v_kright;
  Py_ssize_t __pyx_v_kleft;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  Py_buffer __pyx_bstruct_right;
  Py_ssize_t __pyx_bstride_0_right = 0;
  Py_ssize_t __pyx_bshape_0_right = 0;
  Py_buffer __pyx_bstruct_rvalues;
  Py_ssize_t __pyx_bstride_0_rvalues = 0;
  Py_ssize_t __pyx_bstride_1_rvalues = 0;
  Py_ssize_t __pyx_bshape_0_rvalues = 0;
  Py_ssize_t __pyx_bshape_1_rvalues = 0;
  Py_buffer __pyx_bstruct_lvalues;
  Py_ssize_t __pyx_bstride_0_lvalues = 0;
  Py_ssize_t __pyx_bstride_1_lvalues = 0;
  Py_ssize_t __pyx_bshape_0_lvalues = 0;
  Py_ssize_t __pyx_bshape_1_lvalues = 0;
  Py_buffer __pyx_bstruct_left;
  Py_ssize_t __pyx_bstride_0_left = 0;
  Py_ssize_t __pyx_bshape_0_left = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__right,&__pyx_n_s__lvalues,&__pyx_n_s__rvalues,&__pyx_n_s__out,0};
  __Pyx_RefNannySetupContext("left_join_2d");
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_2d", 1, 5, 5, 1); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvalues);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_2d", 1, 5, 5, 2); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rvalues);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_2d", 1, 5, 5, 3); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_2d", 1, 5, 5, 4); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "left_join_2d") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_left = ((PyArrayObject *)values[0]);
    __pyx_v_right = ((PyArrayObject *)values[1]);
    __pyx_v_lvalues = ((PyArrayObject *)values[2]);
    __pyx_v_rvalues = ((PyArrayObject *)values[3]);
    __pyx_v_out = ((PyArrayObject *)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("left_join_2d", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.left_join_2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_left.buf = NULL;
  __pyx_bstruct_right.buf = NULL;
  __pyx_bstruct_lvalues.buf = NULL;
  __pyx_bstruct_rvalues.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvalues), __pyx_ptype_5numpy_ndarray, 1, "lvalues", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rvalues), __pyx_ptype_5numpy_ndarray, 1, "rvalues", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_left = __pyx_bstruct_left.strides[0];
  __pyx_bshape_0_left = __pyx_bstruct_left.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_right = __pyx_bstruct_right.strides[0];
  __pyx_bshape_0_right = __pyx_bstruct_right.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_lvalues, (PyObject*)__pyx_v_lvalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_lvalues = __pyx_bstruct_lvalues.strides[0]; __pyx_bstride_1_lvalues = __pyx_bstruct_lvalues.strides[1];
  __pyx_bshape_0_lvalues = __pyx_bstruct_lvalues.shape[0]; __pyx_bshape_1_lvalues = __pyx_bstruct_lvalues.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rvalues, (PyObject*)__pyx_v_rvalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_rvalues = __pyx_bstruct_rvalues.strides[0]; __pyx_bstride_1_rvalues = __pyx_bstruct_rvalues.strides[1];
  __pyx_bshape_0_rvalues = __pyx_bstruct_rvalues.shape[0]; __pyx_bshape_1_rvalues = __pyx_bstruct_rvalues.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":43
 *         int64_t val
 * 
 *     nleft, kleft = (<object> lvalues).shape             # <<<<<<<<<<<<<<
 *     nright, kright = (<object> rvalues).shape
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_lvalues), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[9]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[9]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[9]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_nleft = __pyx_t_6;
  __pyx_v_kleft = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":44
 * 
 *     nleft, kleft = (<object> lvalues).shape
 *     nright, kright = (<object> rvalues).shape             # <<<<<<<<<<<<<<
 * 
 *     j = 0
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_rvalues), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L9_unpacking_done;
    __pyx_L8_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L9_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_nright = __pyx_t_7;
  __pyx_v_kright = __pyx_t_6;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":46
 *     nright, kright = (<object> rvalues).shape
 * 
 *     j = 0             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < nleft:
 *         for k from 0 <= k < kleft:
 */
  __pyx_v_j = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":47
 * 
 *     j = 0
 *     for i from 0 <= i < nleft:             # <<<<<<<<<<<<<<
 *         for k from 0 <= k < kleft:
 *             out[i, k] = lvalues[i, k]
 */
  __pyx_t_6 = __pyx_v_nleft;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":48
 *     j = 0
 *     for i from 0 <= i < nleft:
 *         for k from 0 <= k < kleft:             # <<<<<<<<<<<<<<
 *             out[i, k] = lvalues[i, k]
 * 
 */
    __pyx_t_7 = __pyx_v_kleft;
    for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_7; __pyx_v_k++) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":49
 *     for i from 0 <= i < nleft:
 *         for k from 0 <= k < kleft:
 *             out[i, k] = lvalues[i, k]             # <<<<<<<<<<<<<<
 * 
 *         val = left[i]
 */
      __pyx_t_8 = __pyx_v_i;
      __pyx_t_9 = __pyx_v_k;
      __pyx_t_10 = __pyx_v_i;
      __pyx_t_11 = __pyx_v_k;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_10, __pyx_bstride_0_out, __pyx_t_11, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_lvalues.buf, __pyx_t_8, __pyx_bstride_0_lvalues, __pyx_t_9, __pyx_bstride_1_lvalues));
    }

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":51
 *             out[i, k] = lvalues[i, k]
 * 
 *         val = left[i]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and right[j] < val:
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left.buf, __pyx_t_7, __pyx_bstride_0_left));

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":53
 *         val = left[i]
 * 
 *         while j < nright and right[j] < val:             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
    while (1) {
      __pyx_t_12 = (__pyx_v_j < __pyx_v_nright);
      if (__pyx_t_12) {
        __pyx_t_13 = __pyx_v_j;
        __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right.buf, __pyx_t_13, __pyx_bstride_0_right)) < __pyx_v_val);
        __pyx_t_15 = __pyx_t_14;
      } else {
        __pyx_t_15 = __pyx_t_12;
      }
      if (!__pyx_t_15) break;

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":54
 * 
 *         while j < nright and right[j] < val:
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":56
 *             j += 1
 * 
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             for k from kleft <= k < kleft + kright:
 *                 out[i, k] = NaN
 */
    __pyx_t_15 = (__pyx_v_j == __pyx_v_nright);
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":57
 * 
 *         if j == nright:
 *             for k from kleft <= k < kleft + kright:             # <<<<<<<<<<<<<<
 *                 out[i, k] = NaN
 *             continue
 */
      __pyx_t_16 = (__pyx_v_kleft + __pyx_v_kright);
      for (__pyx_v_k = __pyx_v_kleft; __pyx_v_k < __pyx_t_16; __pyx_v_k++) {

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":58
 *         if j == nright:
 *             for k from kleft <= k < kleft + kright:
 *                 out[i, k] = NaN             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_18 = __pyx_v_k;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_17, __pyx_bstride_0_out, __pyx_t_18, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_NaN;
      }

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":59
 *             for k from kleft <= k < kleft + kright:
 *                 out[i, k] = NaN
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if val == right[j]:
 */
      goto __pyx_L10_continue;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":61
 *             continue
 * 
 *         if val == right[j]:             # <<<<<<<<<<<<<<
 *             for k from kleft <= k < kleft + kright:
 *                 out[i, k] = rvalues[j, k - kleft]
 */
    __pyx_t_16 = __pyx_v_j;
    __pyx_t_15 = (__pyx_v_val == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right.buf, __pyx_t_16, __pyx_bstride_0_right)));
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":62
 * 
 *         if val == right[j]:
 *             for k from kleft <= k < kleft + kright:             # <<<<<<<<<<<<<<
 *                 out[i, k] = rvalues[j, k - kleft]
 *         else:
 */
      __pyx_t_19 = (__pyx_v_kleft + __pyx_v_kright);
      for (__pyx_v_k = __pyx_v_kleft; __pyx_v_k < __pyx_t_19; __pyx_v_k++) {

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":63
 *         if val == right[j]:
 *             for k from kleft <= k < kleft + kright:
 *                 out[i, k] = rvalues[j, k - kleft]             # <<<<<<<<<<<<<<
 *         else:
 *             for k from kleft <= k < kleft + kright:
 */
        __pyx_t_20 = __pyx_v_j;
        __pyx_t_21 = (__pyx_v_k - __pyx_v_kleft);
        __pyx_t_22 = __pyx_v_i;
        __pyx_t_23 = __pyx_v_k;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_22, __pyx_bstride_0_out, __pyx_t_23, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_rvalues.buf, __pyx_t_20, __pyx_bstride_0_rvalues, __pyx_t_21, __pyx_bstride_1_rvalues));
      }
      goto __pyx_L19;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":65
 *                 out[i, k] = rvalues[j, k - kleft]
 *         else:
 *             for k from kleft <= k < kleft + kright:             # <<<<<<<<<<<<<<
 *                 out[i, k] = NaN
 * 
 */
      __pyx_t_19 = (__pyx_v_kleft + __pyx_v_kright);
      for (__pyx_v_k = __pyx_v_kleft; __pyx_v_k < __pyx_t_19; __pyx_v_k++) {

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":66
 *         else:
 *             for k from kleft <= k < kleft + kright:
 *                 out[i, k] = NaN             # <<<<<<<<<<<<<<
 * 
 * @cython.wraparound(False)
 */
        __pyx_t_24 = __pyx_v_i;
        __pyx_t_25 = __pyx_v_k;
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_24, __pyx_bstride_0_out, __pyx_t_25, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_NaN;
      }
    }
    __pyx_L19:;
    __pyx_L10_continue:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rvalues);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_lvalues);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.left_join_2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rvalues);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_lvalues);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reindex.pyx":70
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_1d(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                  ndarray[float64_t] lvalues,
 *                  ndarray[float64_t] rvalues,
 */

static PyObject *__pyx_pf_6pandas_3lib_116left_join_1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_116left_join_1d = {__Pyx_NAMESTR("left_join_1d"), (PyCFunction)__pyx_pf_6pandas_3lib_116left_join_1d, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_116left_join_1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  PyArrayObject *__pyx_v_lvalues = 0;
  PyArrayObject *__pyx_v_rvalues = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_nright;
  Py_ssize_t __pyx_v_nleft;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  Py_buffer __pyx_bstruct_right;
  Py_ssize_t __pyx_bstride_0_right = 0;
  Py_ssize_t __pyx_bshape_0_right = 0;
  Py_buffer __pyx_bstruct_rvalues;
  Py_ssize_t __pyx_bstride_0_rvalues = 0;
  Py_ssize_t __pyx_bshape_0_rvalues = 0;
  Py_buffer __pyx_bstruct_lvalues;
  Py_ssize_t __pyx_bstride_0_lvalues = 0;
  Py_ssize_t __pyx_bshape_0_lvalues = 0;
  Py_buffer __pyx_bstruct_left;
  Py_ssize_t __pyx_bstride_0_left = 0;
  Py_ssize_t __pyx_bshape_0_left = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  long __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  long __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  long __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  long __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__right,&__pyx_n_s__lvalues,&__pyx_n_s__rvalues,&__pyx_n_s__out,0};
  __Pyx_RefNannySetupContext("left_join_1d");
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_1d", 1, 5, 5, 1); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvalues);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_1d", 1, 5, 5, 2); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rvalues);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_1d", 1, 5, 5, 3); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_join_1d", 1, 5, 5, 4); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "left_join_1d") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_left = ((PyArrayObject *)values[0]);
    __pyx_v_right = ((PyArrayObject *)values[1]);
    __pyx_v_lvalues = ((PyArrayObject *)values[2]);
    __pyx_v_rvalues = ((PyArrayObject *)values[3]);
    __pyx_v_out = ((PyArrayObject *)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("left_join_1d", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.left_join_1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_left.buf = NULL;
  __pyx_bstruct_right.buf = NULL;
  __pyx_bstruct_lvalues.buf = NULL;
  __pyx_bstruct_rvalues.buf = NULL;
  __pyx_bstruct_out.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvalues), __pyx_ptype_5numpy_ndarray, 1, "lvalues", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rvalues), __pyx_ptype_5numpy_ndarray, 1, "rvalues", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_left = __pyx_bstruct_left.strides[0];
  __pyx_bshape_0_left = __pyx_bstruct_left.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_right = __pyx_bstruct_right.strides[0];
  __pyx_bshape_0_right = __pyx_bstruct_right.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_lvalues, (PyObject*)__pyx_v_lvalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_lvalues = __pyx_bstruct_lvalues.strides[0];
  __pyx_bshape_0_lvalues = __pyx_bstruct_lvalues.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rvalues, (PyObject*)__pyx_v_rvalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_rvalues = __pyx_bstruct_rvalues.strides[0];
  __pyx_bshape_0_rvalues = __pyx_bstruct_rvalues.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_v_out, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
  __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":78
 *         int64_t val
 * 
 *     nleft = len(lvalues)             # <<<<<<<<<<<<<<
 *     nright = len(rvalues)
 * 
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_lvalues)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nleft = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":79
 * 
 *     nleft = len(lvalues)
 *     nright = len(rvalues)             # <<<<<<<<<<<<<<
 * 
 *     j = 0
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_rvalues)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nright = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":81
 *     nright = len(rvalues)
 * 
 *     j = 0             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < nleft:
 *         out[i, 0] = lvalues[i]
 */
  __pyx_v_j = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":82
 * 
 *     j = 0
 *     for i from 0 <= i < nleft:             # <<<<<<<<<<<<<<
 *         out[i, 0] = lvalues[i]
 * 
 */
  __pyx_t_1 = __pyx_v_nleft;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":83
 *     j = 0
 *     for i from 0 <= i < nleft:
 *         out[i, 0] = lvalues[i]             # <<<<<<<<<<<<<<
 * 
 *         val = left[i]
 */
    __pyx_t_2 = __pyx_v_i;
    __pyx_t_3 = __pyx_v_i;
    __pyx_t_4 = 0;
    *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_3, __pyx_bstride_0_out, __pyx_t_4, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_lvalues.buf, __pyx_t_2, __pyx_bstride_0_lvalues));

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":85
 *         out[i, 0] = lvalues[i]
 * 
 *         val = left[i]             # <<<<<<<<<<<<<<
 * 
 *         while j < nright and right[j] < val:
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left.buf, __pyx_t_5, __pyx_bstride_0_left));

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":87
 *         val = left[i]
 * 
 *         while j < nright and right[j] < val:             # <<<<<<<<<<<<<<
 *             j += 1
 * 
 */
    while (1) {
      __pyx_t_6 = (__pyx_v_j < __pyx_v_nright);
      if (__pyx_t_6) {
        __pyx_t_7 = __pyx_v_j;
        __pyx_t_8 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right.buf, __pyx_t_7, __pyx_bstride_0_right)) < __pyx_v_val);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_6;
      }
      if (!__pyx_t_9) break;

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":88
 * 
 *         while j < nright and right[j] < val:
 *             j += 1             # <<<<<<<<<<<<<<
 * 
 *         if j == nright:
 */
      __pyx_v_j = (__pyx_v_j + 1);
    }

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":90
 *             j += 1
 * 
 *         if j == nright:             # <<<<<<<<<<<<<<
 *             out[i, 1] = NaN
 *             continue
 */
    __pyx_t_9 = (__pyx_v_j == __pyx_v_nright);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":91
 * 
 *         if j == nright:
 *             out[i, 1] = NaN             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_t_10 = __pyx_v_i;
      __pyx_t_11 = 1;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_10, __pyx_bstride_0_out, __pyx_t_11, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_NaN;

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":92
 *         if j == nright:
 *             out[i, 1] = NaN
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if val == right[j]:
 */
      goto __pyx_L6_continue;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":94
 *             continue
 * 
 *         if val == right[j]:             # <<<<<<<<<<<<<<
 *             out[i, 1] = rvalues[j]
 *         else:
 */
    __pyx_t_12 = __pyx_v_j;
    __pyx_t_9 = (__pyx_v_val == (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right.buf, __pyx_t_12, __pyx_bstride_0_right)));
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":95
 * 
 *         if val == right[j]:
 *             out[i, 1] = rvalues[j]             # <<<<<<<<<<<<<<
 *         else:
 *             out[i, 1] = NaN
 */
      __pyx_t_13 = __pyx_v_j;
      __pyx_t_14 = __pyx_v_i;
      __pyx_t_15 = 1;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_14, __pyx_bstride_0_out, __pyx_t_15, __pyx_bstride_1_out) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_rvalues.buf, __pyx_t_13, __pyx_bstride_0_rvalues));
      goto __pyx_L11;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":97
 *             out[i, 1] = rvalues[j]
 *         else:
 *             out[i, 1] = NaN             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = 1;
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_out.buf, __pyx_t_16, __pyx_bstride_0_out, __pyx_t_17, __pyx_bstride_1_out) = __pyx_v_6pandas_3lib_NaN;
    }
    __pyx_L11:;
    __pyx_L6_continue:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rvalues);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_lvalues);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.left_join_1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rvalues);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_lvalues);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reindex.pyx":102
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_join_contiguous(ndarray[float64_t, ndim=2] lvalues,             # <<<<<<<<<<<<<<
 *                          ndarray[float64_t, ndim=2] rvalues,
 *                          ndarray[int32_t] lindexer,
 */

static PyObject *__pyx_pf_6pandas_3lib_117take_join_contiguous(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_117take_join_contiguous = {__Pyx_NAMESTR("take_join_contiguous"), (PyCFunction)__pyx_pf_6pandas_3lib_117take_join_contiguous, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_117take_join_contiguous(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_lvalues = 0;
  PyArrayObject *__pyx_v_rvalues = 0;
  PyArrayObject *__pyx_v_lindexer = 0;
  PyArrayObject *__pyx_v_rindexer = 0;
  PyArrayObject *__pyx_v_out = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_rk;
  Py_ssize_t __pyx_v_lk;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_lidx;
  Py_ssize_t __pyx_v_ridx;
  __pyx_t_5numpy_float64_t *__pyx_v_outbuf;
  Py_buffer __pyx_bstruct_lindexer;
  Py_ssize_t __pyx_bstride_0_lindexer = 0;
  Py_ssize_t __pyx_bshape_0_lindexer = 0;
  Py_buffer __pyx_bstruct_rvalues;
  Py_ssize_t __pyx_bstride_0_rvalues = 0;
  Py_ssize_t __pyx_bstride_1_rvalues = 0;
  Py_ssize_t __pyx_bshape_0_rvalues = 0;
  Py_ssize_t __pyx_bshape_1_rvalues = 0;
  Py_buffer __pyx_bstruct_rindexer;
  Py_ssize_t __pyx_bstride_0_rindexer = 0;
  Py_ssize_t __pyx_bshape_0_rindexer = 0;
  Py_buffer __pyx_bstruct_lvalues;
  Py_ssize_t __pyx_bstride_0_lvalues = 0;
  Py_ssize_t __pyx_bstride_1_lvalues = 0;
  Py_ssize_t __pyx_bshape_0_lvalues = 0;
  Py_ssize_t __pyx_bshape_1_lvalues = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lvalues,&__pyx_n_s__rvalues,&__pyx_n_s__lindexer,&__pyx_n_s__rindexer,&__pyx_n_s__out,0};
  __Pyx_RefNannySetupContext("take_join_contiguous");
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lvalues);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rvalues);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_join_contiguous", 1, 5, 5, 1); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lindexer);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_join_contiguous", 1, 5, 5, 2); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rindexer);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_join_contiguous", 1, 5, 5, 3); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__out);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_join_contiguous", 1, 5, 5, 4); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "take_join_contiguous") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_lvalues = ((PyArrayObject *)values[0]);
    __pyx_v_rvalues = ((PyArrayObject *)values[1]);
    __pyx_v_lindexer = ((PyArrayObject *)values[2]);
    __pyx_v_rindexer = ((PyArrayObject *)values[3]);
    __pyx_v_out = ((PyArrayObject *)values[4]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_join_contiguous", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.take_join_contiguous", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_lvalues.buf = NULL;
  __pyx_bstruct_rvalues.buf = NULL;
  __pyx_bstruct_lindexer.buf = NULL;
  __pyx_bstruct_rindexer.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvalues), __pyx_ptype_5numpy_ndarray, 1, "lvalues", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rvalues), __pyx_ptype_5numpy_ndarray, 1, "rvalues", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lindexer), __pyx_ptype_5numpy_ndarray, 1, "lindexer", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rindexer), __pyx_ptype_5numpy_ndarray, 1, "rindexer", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_5numpy_ndarray, 1, "out", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_lvalues, (PyObject*)__pyx_v_lvalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_lvalues = __pyx_bstruct_lvalues.strides[0]; __pyx_bstride_1_lvalues = __pyx_bstruct_lvalues.strides[1];
  __pyx_bshape_0_lvalues = __pyx_bstruct_lvalues.shape[0]; __pyx_bshape_1_lvalues = __pyx_bstruct_lvalues.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rvalues, (PyObject*)__pyx_v_rvalues, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_rvalues = __pyx_bstruct_rvalues.strides[0]; __pyx_bstride_1_rvalues = __pyx_bstruct_rvalues.strides[1];
  __pyx_bshape_0_rvalues = __pyx_bstruct_rvalues.shape[0]; __pyx_bshape_1_rvalues = __pyx_bstruct_rvalues.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_lindexer, (PyObject*)__pyx_v_lindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_lindexer = __pyx_bstruct_lindexer.strides[0];
  __pyx_bshape_0_lindexer = __pyx_bstruct_lindexer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_rindexer, (PyObject*)__pyx_v_rindexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_rindexer = __pyx_bstruct_rindexer.strides[0];
  __pyx_bshape_0_rindexer = __pyx_bstruct_rindexer.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":111
 *         float64_t *outbuf
 * 
 *     assert(out.flags.contiguous)             # <<<<<<<<<<<<<<
 * 
 *     outbuf = <float64_t*> out.data
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_out), __pyx_n_s__flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__contiguous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[9]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":113
 *     assert(out.flags.contiguous)
 * 
 *     outbuf = <float64_t*> out.data             # <<<<<<<<<<<<<<
 * 
 *     n = len(lindexer)
 */
  __pyx_v_outbuf = ((__pyx_t_5numpy_float64_t *)__pyx_v_out->data);

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":115
 *     outbuf = <float64_t*> out.data
 * 
 *     n = len(lindexer)             # <<<<<<<<<<<<<<
 *     lk = lvalues.shape[1]
 *     rk = rvalues.shape[1]
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_lindexer)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_4;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":116
 * 
 *     n = len(lindexer)
 *     lk = lvalues.shape[1]             # <<<<<<<<<<<<<<
 *     rk = rvalues.shape[1]
 * 
 */
  __pyx_v_lk = (__pyx_v_lvalues->dimensions[1]);

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":117
 *     n = len(lindexer)
 *     lk = lvalues.shape[1]
 *     rk = rvalues.shape[1]             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_v_rk = (__pyx_v_rvalues->dimensions[1]);

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":119
 *     rk = rvalues.shape[1]
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         lidx = lindexer[i]
 *         ridx = rindexer[i]
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":120
 * 
 *     for i from 0 <= i < n:
 *         lidx = lindexer[i]             # <<<<<<<<<<<<<<
 *         ridx = rindexer[i]
 * 
 */
    __pyx_t_5 = __pyx_v_i;
    __pyx_v_lidx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_lindexer.buf, __pyx_t_5, __pyx_bstride_0_lindexer));

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":121
 *     for i from 0 <= i < n:
 *         lidx = lindexer[i]
 *         ridx = rindexer[i]             # <<<<<<<<<<<<<<
 * 
 *         if lidx == -1:
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_v_ridx = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_bstruct_rindexer.buf, __pyx_t_6, __pyx_bstride_0_rindexer));

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":123
 *         ridx = rindexer[i]
 * 
 *         if lidx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < lk:
 *                 outbuf[0] = NaN
 */
    __pyx_t_3 = (__pyx_v_lidx == -1);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":124
 * 
 *         if lidx == -1:
 *             for j from 0 <= j < lk:             # <<<<<<<<<<<<<<
 *                 outbuf[0] = NaN
 *                 outbuf = outbuf + 1
 */
      __pyx_t_7 = __pyx_v_lk;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":125
 *         if lidx == -1:
 *             for j from 0 <= j < lk:
 *                 outbuf[0] = NaN             # <<<<<<<<<<<<<<
 *                 outbuf = outbuf + 1
 *         else:
 */
        (__pyx_v_outbuf[0]) = __pyx_v_6pandas_3lib_NaN;

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":126
 *             for j from 0 <= j < lk:
 *                 outbuf[0] = NaN
 *                 outbuf = outbuf + 1             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < lk:
 */
        __pyx_v_outbuf = (__pyx_v_outbuf + 1);
      }
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":128
 *                 outbuf = outbuf + 1
 *         else:
 *             for j from 0 <= j < lk:             # <<<<<<<<<<<<<<
 *                 outbuf[0] = lvalues[lidx, j]
 *                 outbuf = outbuf + 1
 */
      __pyx_t_7 = __pyx_v_lk;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":129
 *         else:
 *             for j from 0 <= j < lk:
 *                 outbuf[0] = lvalues[lidx, j]             # <<<<<<<<<<<<<<
 *                 outbuf = outbuf + 1
 * 
 */
        __pyx_t_8 = __pyx_v_lidx;
        __pyx_t_9 = __pyx_v_j;
        (__pyx_v_outbuf[0]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_lvalues.buf, __pyx_t_8, __pyx_bstride_0_lvalues, __pyx_t_9, __pyx_bstride_1_lvalues));

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":130
 *             for j from 0 <= j < lk:
 *                 outbuf[0] = lvalues[lidx, j]
 *                 outbuf = outbuf + 1             # <<<<<<<<<<<<<<
 * 
 *         if lidx == -1:
 */
        __pyx_v_outbuf = (__pyx_v_outbuf + 1);
      }
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":132
 *                 outbuf = outbuf + 1
 * 
 *         if lidx == -1:             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < rk:
 *                 outbuf[0] = NaN
 */
    __pyx_t_3 = (__pyx_v_lidx == -1);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":133
 * 
 *         if lidx == -1:
 *             for j from 0 <= j < rk:             # <<<<<<<<<<<<<<
 *                 outbuf[0] = NaN
 *                 outbuf = outbuf + 1
 */
      __pyx_t_7 = __pyx_v_rk;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":134
 *         if lidx == -1:
 *             for j from 0 <= j < rk:
 *                 outbuf[0] = NaN             # <<<<<<<<<<<<<<
 *                 outbuf = outbuf + 1
 *         else:
 */
        (__pyx_v_outbuf[0]) = __pyx_v_6pandas_3lib_NaN;

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":135
 *             for j from 0 <= j < rk:
 *                 outbuf[0] = NaN
 *                 outbuf = outbuf + 1             # <<<<<<<<<<<<<<
 *         else:
 *             for j from 0 <= j < rk:
 */
        __pyx_v_outbuf = (__pyx_v_outbuf + 1);
      }
      goto __pyx_L13;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":137
 *                 outbuf = outbuf + 1
 *         else:
 *             for j from 0 <= j < rk:             # <<<<<<<<<<<<<<
 *                 outbuf[0] = rvalues[ridx, j]
 *                 outbuf = outbuf + 1
 */
      __pyx_t_7 = __pyx_v_rk;
      for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":138
 *         else:
 *             for j from 0 <= j < rk:
 *                 outbuf[0] = rvalues[ridx, j]             # <<<<<<<<<<<<<<
 *                 outbuf = outbuf + 1
 */
        __pyx_t_10 = __pyx_v_ridx;
        __pyx_t_11 = __pyx_v_j;
        (__pyx_v_outbuf[0]) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_rvalues.buf, __pyx_t_10, __pyx_bstride_0_rvalues, __pyx_t_11, __pyx_bstride_1_rvalues));

        /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":139
 *             for j from 0 <= j < rk:
 *                 outbuf[0] = rvalues[ridx, j]
 *                 outbuf = outbuf + 1             # <<<<<<<<<<<<<<
 */
        __pyx_v_outbuf = (__pyx_v_outbuf + 1);
      }
    }
    __pyx_L13:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_lindexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rvalues);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rindexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_lvalues);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.take_join_contiguous", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_lindexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rvalues);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_rindexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_lvalues);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":14
 *         bint can_set_name
 * 
 *     def __init__(self, object arr, object f, axis=1, dummy=None,             # <<<<<<<<<<<<<<
 *                  labels=None):
 *         n, k = arr.shape
 */

static int __pyx_pf_6pandas_3lib_7Reducer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_7Reducer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_v_labels = 0;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_k = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__f,&__pyx_n_s__axis,&__pyx_n_s__dummy,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_1);
    values[3] = ((PyObject *)Py_None);

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":15
 * 
 *     def __init__(self, object arr, object f, axis=1, dummy=None,
 *                  labels=None):             # <<<<<<<<<<<<<<
 *         n, k = arr.shape
 * 
 */
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axis);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arr = values[0];
    __pyx_v_f = values[1];
    __pyx_v_axis = values[2];
    __pyx_v_dummy = values[3];
    __pyx_v_labels = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Reducer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_arr);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":16
 *     def __init__(self, object arr, object f, axis=1, dummy=None,
 *                  labels=None):
 *         n, k = arr.shape             # <<<<<<<<<<<<<<
 * 
 *         if axis == 0:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[10]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  __pyx_v_n = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_k = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":18
 *         n, k = arr.shape
 * 
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             if not arr.flags.f_contiguous:
 *                 arr = arr.copy('F')
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":19
 * 
 *         if axis == 0:
 *             if not arr.flags.f_contiguous:             # <<<<<<<<<<<<<<
 *                 arr = arr.copy('F')
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__f_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = (!__pyx_t_6);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":20
 *         if axis == 0:
 *             if not arr.flags.f_contiguous:
 *                 arr = arr.copy('F')             # <<<<<<<<<<<<<<
 * 
 *             self.nresults = k
 */
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_arr);
      __pyx_v_arr = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":22
 *                 arr = arr.copy('F')
 * 
 *             self.nresults = k             # <<<<<<<<<<<<<<
 *             self.chunksize = n
 *             self.increment = n * arr.dtype.itemsize
 */
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->nresults = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":23
 * 
 *             self.nresults = k
 *             self.chunksize = n             # <<<<<<<<<<<<<<
 *             self.increment = n * arr.dtype.itemsize
 *         else:
 */
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->chunksize = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":24
 *             self.nresults = k
 *             self.chunksize = n
 *             self.increment = n * arr.dtype.itemsize             # <<<<<<<<<<<<<<
 *         else:
 *             if not arr.flags.c_contiguous:
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->increment = __pyx_t_8;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":26
 *             self.increment = n * arr.dtype.itemsize
 *         else:
 *             if not arr.flags.c_contiguous:             # <<<<<<<<<<<<<<
 *                 arr = arr.copy('C')
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = (!__pyx_t_7);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":27
 *         else:
 *             if not arr.flags.c_contiguous:
 *                 arr = arr.copy('C')             # <<<<<<<<<<<<<<
 * 
 *             self.nresults = n
 */
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_arr);
      __pyx_v_arr = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":29
 *                 arr = arr.copy('C')
 * 
 *             self.nresults = n             # <<<<<<<<<<<<<<
 *             self.chunksize = k
 *             self.increment = k * arr.dtype.itemsize
 */
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->nresults = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":30
 * 
 *             self.nresults = n
 *             self.chunksize = k             # <<<<<<<<<<<<<<
 *             self.increment = k * arr.dtype.itemsize
 * 
 */
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->chunksize = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":31
 *             self.nresults = n
 *             self.chunksize = k
 *             self.increment = k * arr.dtype.itemsize             # <<<<<<<<<<<<<<
 * 
 *         self.f = f
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_arr, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__itemsize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_k, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->increment = __pyx_t_8;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":33
 *             self.increment = k * arr.dtype.itemsize
 * 
 *         self.f = f             # <<<<<<<<<<<<<<
 *         self.arr = arr
 *         self.dummy = self._check_dummy(dummy)
 */
  __Pyx_INCREF(__pyx_v_f);
  __Pyx_GIVEREF(__pyx_v_f);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->f);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->f);
  ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->f = __pyx_v_f;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":34
 * 
 *         self.f = f
 *         self.arr = arr             # <<<<<<<<<<<<<<
 *         self.dummy = self._check_dummy(dummy)
 *         self.labels = labels
 */
  __Pyx_INCREF(__pyx_v_arr);
  __Pyx_GIVEREF(__pyx_v_arr);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr);
  ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr = __pyx_v_arr;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":35
 *         self.f = f
 *         self.arr = arr
 *         self.dummy = self._check_dummy(dummy)             # <<<<<<<<<<<<<<
 *         self.labels = labels
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_dummy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_dummy);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy);
  __Pyx_GIVEREF(__pyx_v_dummy);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->dummy);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->dummy);
  ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->dummy = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":36
 *         self.arr = arr
 *         self.dummy = self._check_dummy(dummy)
 *         self.labels = labels             # <<<<<<<<<<<<<<
 * 
 *     def _check_dummy(self, dummy=None):
 */
  __Pyx_INCREF(__pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->labels);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->labels);
  ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->labels = __pyx_v_labels;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Reducer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":38
 *         self.labels = labels
 * 
 *     def _check_dummy(self, dummy=None):             # <<<<<<<<<<<<<<
 *         if dummy is None:
 *             dummy = np.empty(self.chunksize, dtype=self.arr.dtype)
 */

static PyObject *__pyx_pf_6pandas_3lib_7Reducer_1_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_7Reducer_1_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dummy,0};
  __Pyx_RefNannySetupContext("_check_dummy");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_check_dummy") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dummy = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Reducer._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_dummy);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":39
 * 
 *     def _check_dummy(self, dummy=None):
 *         if dummy is None:             # <<<<<<<<<<<<<<
 *             dummy = np.empty(self.chunksize, dtype=self.arr.dtype)
 *             self.can_set_name = 0
 */
  __pyx_t_1 = (__pyx_v_dummy == Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":40
 *     def _check_dummy(self, dummy=None):
 *         if dummy is None:
 *             dummy = np.empty(self.chunksize, dtype=self.arr.dtype)             # <<<<<<<<<<<<<<
 *             self.can_set_name = 0
 *         else:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->chunksize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_5 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr, __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_dummy);
    __pyx_v_dummy = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":41
 *         if dummy is None:
 *             dummy = np.empty(self.chunksize, dtype=self.arr.dtype)
 *             self.can_set_name = 0             # <<<<<<<<<<<<<<
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 */
    ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->can_set_name = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":43
 *             self.can_set_name = 0
 *         else:
 *             if dummy.dtype != self.arr.dtype:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Dummy array must be same dtype')
 *             if len(dummy) != self.chunksize:
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_dummy, __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":44
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')             # <<<<<<<<<<<<<<
 *             if len(dummy) != self.chunksize:
 *                 raise ValueError('Dummy array must be length %d' %
 */
      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[10]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":45
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')
 *             if len(dummy) != self.chunksize:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Dummy array must be length %d' %
 *                                  self.chunksize)
 */
    __pyx_t_6 = PyObject_Length(__pyx_v_dummy); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_6 != ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->chunksize);
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":47
 *             if len(dummy) != self.chunksize:
 *                 raise ValueError('Dummy array must be length %d' %
 *                                  self.chunksize)             # <<<<<<<<<<<<<<
 *             self.can_set_name = type(dummy) != np.ndarray
 * 
 */
      __pyx_t_4 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->chunksize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_105), __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[10]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":48
 *                 raise ValueError('Dummy array must be length %d' %
 *                                  self.chunksize)
 *             self.can_set_name = type(dummy) != np.ndarray             # <<<<<<<<<<<<<<
 * 
 *         return dummy
 */
    __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_dummy)), ((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->can_set_name = __pyx_t_1;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":50
 *             self.can_set_name = type(dummy) != np.ndarray
 * 
 *         return dummy             # <<<<<<<<<<<<<<
 * 
 *     def get_result(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dummy);
  __pyx_r = __pyx_v_dummy;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib.Reducer._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":52
 *         return dummy
 * 
 *     def get_result(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char* dummy_buf
 */

static PyObject *__pyx_pf_6pandas_3lib_7Reducer_2get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_7Reducer_2get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  char *__pyx_v_dummy_buf;
  PyArrayObject *__pyx_v_arr = 0;
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_chunk = 0;
  Py_ssize_t __pyx_v_i;
  PyArrayIterObject *__pyx_v_it = 0;
  PyObject *__pyx_v_res = 0;
  int __pyx_v_set_label;
  PyArrayObject *__pyx_v_labels = 0;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_result");

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":59
 *             flatiter it
 *             object res
 *             bint set_label = 0             # <<<<<<<<<<<<<<
 *             ndarray labels
 * 
 */
  __pyx_v_set_label = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":62
 *             ndarray labels
 * 
 *         arr = self.arr             # <<<<<<<<<<<<<<
 *         chunk = self.dummy
 * 
 */
  if (!(likely(((((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr) == Py_None) || likely(__Pyx_TypeTest(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr);
  __pyx_v_arr = ((PyArrayObject *)((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->arr);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":63
 * 
 *         arr = self.arr
 *         chunk = self.dummy             # <<<<<<<<<<<<<<
 * 
 *         dummy_buf = chunk.data
 */
  if (!(likely(((((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->dummy) == Py_None) || likely(__Pyx_TypeTest(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->dummy, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->dummy);
  __pyx_v_chunk = ((PyArrayObject *)((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->dummy);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":65
 *         chunk = self.dummy
 * 
 *         dummy_buf = chunk.data             # <<<<<<<<<<<<<<
 *         chunk.data = arr.data
 * 
 */
  __pyx_v_dummy_buf = __pyx_v_chunk->data;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":66
 * 
 *         dummy_buf = chunk.data
 *         chunk.data = arr.data             # <<<<<<<<<<<<<<
 * 
 *         set_label = self.labels is not None and self.can_set_name
 */
  __pyx_v_chunk->data = __pyx_v_arr->data;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":68
 *         chunk.data = arr.data
 * 
 *         set_label = self.labels is not None and self.can_set_name             # <<<<<<<<<<<<<<
 *         if set_label:
 *             labels = self.labels
 */
  __pyx_t_1 = (((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->labels != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->can_set_name;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_set_label = __pyx_t_2;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":69
 * 
 *         set_label = self.labels is not None and self.can_set_name
 *         if set_label:             # <<<<<<<<<<<<<<
 *             labels = self.labels
 * 
 */
  if (__pyx_v_set_label) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":70
 *         set_label = self.labels is not None and self.can_set_name
 *         if set_label:
 *             labels = self.labels             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    if (!(likely(((((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->labels) == Py_None) || likely(__Pyx_TypeTest(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->labels, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->labels);
    __pyx_v_labels = ((PyArrayObject *)((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->labels);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":72
 *             labels = self.labels
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             for i in range(self.nresults):
 *                 if set_label:
 */
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":73
 * 
 *         try:
 *             for i in range(self.nresults):             # <<<<<<<<<<<<<<
 *                 if set_label:
 *                     chunk.name = util.get_value_at(labels, i)
 */
        __pyx_t_6 = ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->nresults;
        for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
          __pyx_v_i = __pyx_t_7;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":74
 *         try:
 *             for i in range(self.nresults):
 *                 if set_label:             # <<<<<<<<<<<<<<
 *                     chunk.name = util.get_value_at(labels, i)
 * 
 */
          if (__pyx_v_set_label) {
            if (unlikely(!__pyx_v_labels)) { __Pyx_RaiseUnboundLocalError("labels"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_error;} }__pyx_t_8 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_error;}

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":75
 *             for i in range(self.nresults):
 *                 if set_label:
 *                     chunk.name = util.get_value_at(labels, i)             # <<<<<<<<<<<<<<
 * 
 *                 res = self.f(chunk)
 */
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_9 = __pyx_f_4util_get_value_at(__pyx_v_labels, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (PyObject_SetAttr(((PyObject *)__pyx_v_chunk), __pyx_n_s__name, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L19;
          }
          __pyx_L19:;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":77
 *                     chunk.name = util.get_value_at(labels, i)
 * 
 *                 res = self.f(chunk)             # <<<<<<<<<<<<<<
 *                 if i == 0:
 *                     result = self._get_result_array(res)
 */
          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_9));
          __Pyx_INCREF(((PyObject *)__pyx_v_chunk));
          PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_chunk));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_chunk));
          __pyx_t_8 = PyObject_Call(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->f, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_v_res);
          __pyx_v_res = __pyx_t_8;
          __pyx_t_8 = 0;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":78
 * 
 *                 res = self.f(chunk)
 *                 if i == 0:             # <<<<<<<<<<<<<<
 *                     result = self._get_result_array(res)
 *                     it = <flatiter> PyArray_IterNew(result)
 */
          __pyx_t_2 = (__pyx_v_i == 0);
          if (__pyx_t_2) {

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":79
 *                 res = self.f(chunk)
 *                 if i == 0:
 *                     result = self._get_result_array(res)             # <<<<<<<<<<<<<<
 *                     it = <flatiter> PyArray_IterNew(result)
 * 
 */
            __pyx_t_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___get_result_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_9));
            __Pyx_INCREF(__pyx_v_res);
            PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_res);
            __Pyx_GIVEREF(__pyx_v_res);
            __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
            if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_XDECREF(((PyObject *)__pyx_v_result));
            __pyx_v_result = ((PyArrayObject *)__pyx_t_10);
            __pyx_t_10 = 0;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":80
 *                 if i == 0:
 *                     result = self._get_result_array(res)
 *                     it = <flatiter> PyArray_IterNew(result)             # <<<<<<<<<<<<<<
 * 
 *                 PyArray_SETITEM(result, PyArray_ITER_DATA(it), res)
 */
            __pyx_t_10 = PyArray_IterNew(((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_t_10)));
            __Pyx_XDECREF(((PyObject *)__pyx_v_it));
            __pyx_v_it = ((PyArrayIterObject *)__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L20;
          }
          __pyx_L20:;
          if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L9_error;} }if (unlikely(!__pyx_v_it)) { __Pyx_RaiseUnboundLocalError("it"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L9_error;} }PyArray_SETITEM(__pyx_v_result, PyArray_ITER_DATA(__pyx_v_it), __pyx_v_res);

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":83
 * 
 *                 PyArray_SETITEM(result, PyArray_ITER_DATA(it), res)
 *                 chunk.data = chunk.data + self.increment             # <<<<<<<<<<<<<<
 *                 PyArray_ITER_NEXT(it)
 *         except Exception, e:
 */
          __pyx_v_chunk->data = (__pyx_v_chunk->data + ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->increment);

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":84
 *                 PyArray_SETITEM(result, PyArray_ITER_DATA(it), res)
 *                 chunk.data = chunk.data + self.increment
 *                 PyArray_ITER_NEXT(it)             # <<<<<<<<<<<<<<
 *         except Exception, e:
 *             if hasattr(e, 'args'):
 */
          PyArray_ITER_NEXT(__pyx_v_it);
        }
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L16_try_end;
      __pyx_L9_error:;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":85
 *                 chunk.data = chunk.data + self.increment
 *                 PyArray_ITER_NEXT(it)
 *         except Exception, e:             # <<<<<<<<<<<<<<
 *             if hasattr(e, 'args'):
 *                 e.args = e.args + (i,)
 */
      __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
      if (__pyx_t_11) {
        __Pyx_AddTraceback("pandas.lib.Reducer.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __pyx_v_e = __pyx_t_9;

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":86
 *                 PyArray_ITER_NEXT(it)
 *         except Exception, e:
 *             if hasattr(e, 'args'):             # <<<<<<<<<<<<<<
 *                 e.args = e.args + (i,)
 *             raise
 */
        __pyx_t_12 = ((PyObject *)__pyx_n_s__args);
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_2 = PyObject_HasAttr(__pyx_v_e, __pyx_t_12); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (__pyx_t_2) {

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":87
 *         except Exception, e:
 *             if hasattr(e, 'args'):
 *                 e.args = e.args + (i,)             # <<<<<<<<<<<<<<
 *             raise
 *         finally:
 */
          __pyx_t_12 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__args); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_14));
          PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = PyNumber_Add(__pyx_t_12, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
          if (PyObject_SetAttr(__pyx_v_e, __pyx_n_s__args, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L23;
        }
        __pyx_L23:;

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":88
 *             if hasattr(e, 'args'):
 *                 e.args = e.args + (i,)
 *             raise             # <<<<<<<<<<<<<<
 *         finally:
 *             # so we don't free the wrong memory
 */
        __Pyx_GIVEREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8);
        __Pyx_ErrRestore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; 
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L10_exception_handled;
      }
      __pyx_L11_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L7;
      __pyx_L10_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L16_try_end:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":91
 *         finally:
 *             # so we don't free the wrong memory
 *             chunk.data = dummy_buf             # <<<<<<<<<<<<<<
 * 
 *         if result.dtype == np.object_:
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L8;
    __pyx_L7: {
      __pyx_why = 4;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L8;
    }
    __pyx_L8:;
    __pyx_v_chunk->data = __pyx_v_dummy_buf;
    switch (__pyx_why) {
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }
  if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }__pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":93
 *             chunk.data = dummy_buf
 * 
 *         if result.dtype == np.object_:             # <<<<<<<<<<<<<<
 *             result = maybe_convert_objects(result)
 * 
 */
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__object_); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_10, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":94
 * 
 *         if result.dtype == np.object_:
 *             result = maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s_89); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_10));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_result));
    __pyx_v_result = ((PyArrayObject *)__pyx_t_8);
    __pyx_t_8 = 0;
    goto __pyx_L25;
  }
  __pyx_L25:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":96
 *             result = maybe_convert_objects(result)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def _get_result_array(self, object res):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("pandas.lib.Reducer.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_chunk);
  __Pyx_XDECREF((PyObject *)__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":98
 *         return result
 * 
 *     def _get_result_array(self, object res):             # <<<<<<<<<<<<<<
 *         try:
 *             assert(not isinstance(res, np.ndarray))
 */

static PyObject *__pyx_pf_6pandas_3lib_7Reducer_3_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_7Reducer_3_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_result_array");

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":99
 * 
 *     def _get_result_array(self, object res):
 *         try:             # <<<<<<<<<<<<<<
 *             assert(not isinstance(res, np.ndarray))
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":100
 *     def _get_result_array(self, object res):
 *         try:
 *             assert(not isinstance(res, np.ndarray))             # <<<<<<<<<<<<<<
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 * 
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = ((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray));
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_res, __pyx_t_4); 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!(!__pyx_t_5))) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      #endif

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":101
 *         try:
 *             assert(not isinstance(res, np.ndarray))
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))             # <<<<<<<<<<<<<<
 * 
 *             result = np.empty(self.nresults, dtype='O')
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = ((PyObject *)((PyObject*)(&PyList_Type)));
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_res, __pyx_t_4); 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {
        __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __pyx_t_4 = ((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->dummy;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_8 = (__pyx_t_6 == __pyx_t_7);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_5;
      }
      if (unlikely(!(!__pyx_t_9))) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      #endif

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":103
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 * 
 *             result = np.empty(self.nresults, dtype='O')             # <<<<<<<<<<<<<<
 *             result[0] = res
 *         except Exception:
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_Reducer *)__pyx_v_self)->nresults); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_11));
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_10, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_v_result = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":104
 * 
 *             result = np.empty(self.nresults, dtype='O')
 *             result[0] = res             # <<<<<<<<<<<<<<
 *         except Exception:
 *             raise ValueError('function does not reduce')
 */
      if (__Pyx_SetItemInt(__pyx_v_result, 0, __pyx_v_res, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":105
 *             result = np.empty(self.nresults, dtype='O')
 *             result[0] = res
 *         except Exception:             # <<<<<<<<<<<<<<
 *             raise ValueError('function does not reduce')
 *         return result
 */
    __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_13) {
      __Pyx_AddTraceback("pandas.lib.Reducer._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_4, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_11);

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":106
 *             result[0] = res
 *         except Exception:
 *             raise ValueError('function does not reduce')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
      __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      {__pyx_filename = __pyx_f[10]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L12_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":107
 *         except Exception:
 *             raise ValueError('function does not reduce')
 *         return result             # <<<<<<<<<<<<<<
 * 
 * cdef class SeriesBinGrouper:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pandas.lib.Reducer._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":120
 *         object arr, index, dummy, f, bins
 * 
 *     def __init__(self, object series, object f, object bins, object dummy):             # <<<<<<<<<<<<<<
 *         n = len(series)
 * 
 */

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_series = 0;
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_bins = 0;
  PyObject *__pyx_v_dummy = 0;
  Py_ssize_t __pyx_v_n;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__series,&__pyx_n_s__f,&__pyx_n_s__bins,&__pyx_n_s__dummy,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__series);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bins);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_series = values[0];
    __pyx_v_f = values[1];
    __pyx_v_bins = values[2];
    __pyx_v_dummy = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_series);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":121
 * 
 *     def __init__(self, object series, object f, object bins, object dummy):
 *         n = len(series)             # <<<<<<<<<<<<<<
 * 
 *         self.bins = bins
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_series); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":123
 *         n = len(series)
 * 
 *         self.bins = bins             # <<<<<<<<<<<<<<
 *         self.f = f
 *         if not series.flags.c_contiguous:
 */
  __Pyx_INCREF(__pyx_v_bins);
  __Pyx_GIVEREF(__pyx_v_bins);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins = __pyx_v_bins;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":124
 * 
 *         self.bins = bins
 *         self.f = f             # <<<<<<<<<<<<<<
 *         if not series.flags.c_contiguous:
 *             series = series.copy('C')
 */
  __Pyx_INCREF(__pyx_v_f);
  __Pyx_GIVEREF(__pyx_v_f);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f = __pyx_v_f;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":125
 *         self.bins = bins
 *         self.f = f
 *         if not series.flags.c_contiguous:             # <<<<<<<<<<<<<<
 *             series = series.copy('C')
 *         self.arr = series
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_series, __pyx_n_s__flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":126
 *         self.f = f
 *         if not series.flags.c_contiguous:
 *             series = series.copy('C')             # <<<<<<<<<<<<<<
 *         self.arr = series
 *         self.index = series.index
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_series, __pyx_n_s__copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_series);
    __pyx_v_series = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":127
 *         if not series.flags.c_contiguous:
 *             series = series.copy('C')
 *         self.arr = series             # <<<<<<<<<<<<<<
 *         self.index = series.index
 * 
 */
  __Pyx_INCREF(__pyx_v_series);
  __Pyx_GIVEREF(__pyx_v_series);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr = __pyx_v_series;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":128
 *             series = series.copy('C')
 *         self.arr = series
 *         self.index = series.index             # <<<<<<<<<<<<<<
 * 
 *         self.dummy = self._check_dummy(dummy)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_series, __pyx_n_s__index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":130
 *         self.index = series.index
 * 
 *         self.dummy = self._check_dummy(dummy)             # <<<<<<<<<<<<<<
 *         self.passed_dummy = dummy is not None
 *         self.ngroups = len(bins) + 1
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_dummy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_dummy);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy);
  __Pyx_GIVEREF(__pyx_v_dummy);
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":131
 * 
 *         self.dummy = self._check_dummy(dummy)
 *         self.passed_dummy = dummy is not None             # <<<<<<<<<<<<<<
 *         self.ngroups = len(bins) + 1
 * 
 */
  __pyx_t_5 = (__pyx_v_dummy != Py_None);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->passed_dummy = __pyx_t_5;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":132
 *         self.dummy = self._check_dummy(dummy)
 *         self.passed_dummy = dummy is not None
 *         self.ngroups = len(bins) + 1             # <<<<<<<<<<<<<<
 * 
 *     def _check_dummy(self, dummy=None):
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_bins); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->ngroups = (__pyx_t_1 + 1);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_series);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":134
 *         self.ngroups = len(bins) + 1
 * 
 *     def _check_dummy(self, dummy=None):             # <<<<<<<<<<<<<<
 *         if dummy is None:
 *             dummy = np.empty(0, dtype=self.arr.dtype)
 */

static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dummy,0};
  __Pyx_RefNannySetupContext("_check_dummy");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_check_dummy") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dummy = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_dummy);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":135
 * 
 *     def _check_dummy(self, dummy=None):
 *         if dummy is None:             # <<<<<<<<<<<<<<
 *             dummy = np.empty(0, dtype=self.arr.dtype)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_dummy == Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":136
 *     def _check_dummy(self, dummy=None):
 *         if dummy is None:
 *             dummy = np.empty(0, dtype=self.arr.dtype)             # <<<<<<<<<<<<<<
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr, __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_k_tuple_109), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_dummy);
    __pyx_v_dummy = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":138
 *             dummy = np.empty(0, dtype=self.arr.dtype)
 *         else:
 *             if dummy.dtype != self.arr.dtype:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Dummy array must be same dtype')
 *             if not dummy.flags.contiguous:
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_dummy, __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":139
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')             # <<<<<<<<<<<<<<
 *             if not dummy.flags.contiguous:
 *                 dummy = dummy.copy()
 */
      __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[10]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":140
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')
 *             if not dummy.flags.contiguous:             # <<<<<<<<<<<<<<
 *                 dummy = dummy.copy()
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_dummy, __pyx_n_s__flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__contiguous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (!__pyx_t_1);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":141
 *                 raise ValueError('Dummy array must be same dtype')
 *             if not dummy.flags.contiguous:
 *                 dummy = dummy.copy()             # <<<<<<<<<<<<<<
 * 
 *         return dummy
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_dummy, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_dummy);
      __pyx_v_dummy = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":143
 *                 dummy = dummy.copy()
 * 
 *         return dummy             # <<<<<<<<<<<<<<
 * 
 *     def get_result(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dummy);
  __pyx_r = __pyx_v_dummy;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":145
 *         return dummy
 * 
 *     def get_result(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray arr, result
 */

static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_2get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_2get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_counts = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_group_size;
  PyObject *__pyx_v_res = 0;
  PyObject *__pyx_v_chunk = 0;
  int __pyx_v_initialized;
  struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_vslider = 0;
  struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_islider = 0;
  struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_gin = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  __pyx_t_5numpy_int64_t __pyx_t_12;
  long __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_result");
  __pyx_bstruct_counts.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":151
 *             Py_ssize_t i, n, group_size
 *             object res, chunk
 *             bint initialized = 0             # <<<<<<<<<<<<<<
 *             Slider vslider, islider
 *             IndexEngine gin
 */
  __pyx_v_initialized = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":155
 *             IndexEngine gin
 * 
 *         counts = np.zeros(self.ngroups, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *         if self.ngroups > 1:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->ngroups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":157
 *         counts = np.zeros(self.ngroups, dtype=np.int64)
 * 
 *         if self.ngroups > 1:             # <<<<<<<<<<<<<<
 *             counts[0] = self.bins[0]
 *             for i in range(1, self.ngroups):
 */
  __pyx_t_11 = (((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->ngroups > 1);
  if (__pyx_t_11) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":158
 * 
 *         if self.ngroups > 1:
 *             counts[0] = self.bins[0]             # <<<<<<<<<<<<<<
 *             for i in range(1, self.ngroups):
 *                 if i == self.ngroups - 1:
 */
    __pyx_t_5 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_13 = 0;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_counts;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_counts)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[10]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_13, __pyx_bstride_0_counts) = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":159
 *         if self.ngroups > 1:
 *             counts[0] = self.bins[0]
 *             for i in range(1, self.ngroups):             # <<<<<<<<<<<<<<
 *                 if i == self.ngroups - 1:
 *                     counts[i] = len(self.arr) - self.bins[i-1]
 */
    __pyx_t_14 = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->ngroups;
    for (__pyx_t_15 = 1; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_i = __pyx_t_15;

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":160
 *             counts[0] = self.bins[0]
 *             for i in range(1, self.ngroups):
 *                 if i == self.ngroups - 1:             # <<<<<<<<<<<<<<
 *                     counts[i] = len(self.arr) - self.bins[i-1]
 *                 else:
 */
      __pyx_t_11 = (__pyx_v_i == (((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->ngroups - 1));
      if (__pyx_t_11) {

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":161
 *             for i in range(1, self.ngroups):
 *                 if i == self.ngroups - 1:
 *                     counts[i] = len(self.arr) - self.bins[i-1]             # <<<<<<<<<<<<<<
 *                 else:
 *                     counts[i] = self.bins[i] - self.bins[i-1]
 */
        __pyx_t_5 = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_16 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_16 = (__pyx_v_i - 1);
        __pyx_t_1 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins, __pyx_t_16, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_12 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_3); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_16 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_16 < 0) {
          __pyx_t_16 += __pyx_bshape_0_counts;
          if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_counts)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[10]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_16, __pyx_bstride_0_counts) = __pyx_t_12;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":163
 *                     counts[i] = len(self.arr) - self.bins[i-1]
 *                 else:
 *                     counts[i] = self.bins[i] - self.bins[i-1]             # <<<<<<<<<<<<<<
 * 
 *         chunk = self.dummy
 */
        __pyx_t_3 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins, __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_17 = (__pyx_v_i - 1);
        __pyx_t_1 = __Pyx_GetItemInt(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins, __pyx_t_17, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_12 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_5); if (unlikely((__pyx_t_12 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_17 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_17 < 0) {
          __pyx_t_17 += __pyx_bshape_0_counts;
          if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_counts)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[10]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_17, __pyx_bstride_0_counts) = __pyx_t_12;
      }
      __pyx_L8:;
    }
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":165
 *                     counts[i] = self.bins[i] - self.bins[i-1]
 * 
 *         chunk = self.dummy             # <<<<<<<<<<<<<<
 *         group_size = 0
 *         n = len(self.arr)
 */
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  __pyx_v_chunk = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":166
 * 
 *         chunk = self.dummy
 *         group_size = 0             # <<<<<<<<<<<<<<
 *         n = len(self.arr)
 * 
 */
  __pyx_v_group_size = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":167
 *         chunk = self.dummy
 *         group_size = 0
 *         n = len(self.arr)             # <<<<<<<<<<<<<<
 * 
 *         vslider = Slider(self.arr, self.dummy)
 */
  __pyx_t_5 = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr;
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_14 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_n = __pyx_t_14;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":169
 *         n = len(self.arr)
 * 
 *         vslider = Slider(self.arr, self.dummy)             # <<<<<<<<<<<<<<
 *         islider = Slider(self.index, self.dummy.index)
 * 
 */
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  __Pyx_GIVEREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  __Pyx_GIVEREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_v_vslider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":170
 * 
 *         vslider = Slider(self.arr, self.dummy)
 *         islider = Slider(self.index, self.dummy.index)             # <<<<<<<<<<<<<<
 * 
 *         gin = <IndexEngine> self.dummy.index._engine
 */
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  __Pyx_GIVEREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_v_islider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":172
 *         islider = Slider(self.index, self.dummy.index)
 * 
 *         gin = <IndexEngine> self.dummy.index._engine             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___engine); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_t_5)));
  __pyx_v_gin = ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":174
 *         gin = <IndexEngine> self.dummy.index._engine
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             for i in range(self.ngroups):
 *                 group_size = counts[i]
 */
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":175
 * 
 *         try:
 *             for i in range(self.ngroups):             # <<<<<<<<<<<<<<
 *                 group_size = counts[i]
 * 
 */
        __pyx_t_14 = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->ngroups;
        for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
          __pyx_v_i = __pyx_t_15;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":176
 *         try:
 *             for i in range(self.ngroups):
 *                 group_size = counts[i]             # <<<<<<<<<<<<<<
 * 
 *                 islider.set_length(group_size)
 */
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_18 < 0) {
            __pyx_t_18 += __pyx_bshape_0_counts;
            if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_counts)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[10]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          }
          __pyx_v_group_size = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts));

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":178
 *                 group_size = counts[i]
 * 
 *                 islider.set_length(group_size)             # <<<<<<<<<<<<<<
 *                 vslider.set_length(group_size)
 * 
 */
          __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->set_length(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":179
 * 
 *                 islider.set_length(group_size)
 *                 vslider.set_length(group_size)             # <<<<<<<<<<<<<<
 * 
 *                 res = self.f(chunk)
 */
          __pyx_t_5 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->set_length(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":181
 *                 vslider.set_length(group_size)
 * 
 *                 res = self.f(chunk)             # <<<<<<<<<<<<<<
 * 
 *                 if not initialized:
 */
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_5));
          __Pyx_INCREF(__pyx_v_chunk);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chunk);
          __Pyx_GIVEREF(__pyx_v_chunk);
          __pyx_t_1 = PyObject_Call(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_v_res);
          __pyx_v_res = __pyx_t_1;
          __pyx_t_1 = 0;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":183
 *                 res = self.f(chunk)
 * 
 *                 if not initialized:             # <<<<<<<<<<<<<<
 *                     result = self._get_result_array(res)
 *                     initialized = 1
 */
          __pyx_t_11 = (!__pyx_v_initialized);
          if (__pyx_t_11) {

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":184
 * 
 *                 if not initialized:
 *                     result = self._get_result_array(res)             # <<<<<<<<<<<<<<
 *                     initialized = 1
 * 
 */
            __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___get_result_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_5));
            __Pyx_INCREF(__pyx_v_res);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_res);
            __Pyx_GIVEREF(__pyx_v_res);
            __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
            if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
            __Pyx_XDECREF(((PyObject *)__pyx_v_result));
            __pyx_v_result = ((PyArrayObject *)__pyx_t_3);
            __pyx_t_3 = 0;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":185
 *                 if not initialized:
 *                     result = self._get_result_array(res)
 *                     initialized = 1             # <<<<<<<<<<<<<<
 * 
 *                 util.assign_value_1d(result, i, res)
 */
            __pyx_v_initialized = 1;
            goto __pyx_L22;
          }
          __pyx_L22:;
          if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L12_error;} }__pyx_t_7 = assign_value_1d(__pyx_v_result, __pyx_v_i, __pyx_v_res); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L12_error;}

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":189
 *                 util.assign_value_1d(result, i, res)
 * 
 *                 islider.advance(group_size)             # <<<<<<<<<<<<<<
 *                 vslider.advance(group_size)
 * 
 */
          __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":190
 * 
 *                 islider.advance(group_size)
 *                 vslider.advance(group_size)             # <<<<<<<<<<<<<<
 * 
 *                 gin.clear_mapping()
 */
          __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":192
 *                 vslider.advance(group_size)
 * 
 *                 gin.clear_mapping()             # <<<<<<<<<<<<<<
 *         except:
 *             raise
 */
          __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_gin), __pyx_n_s__clear_mapping); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L19_try_end;
      __pyx_L12_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":193
 * 
 *                 gin.clear_mapping()
 *         except:             # <<<<<<<<<<<<<<
 *             raise
 *         finally:
 */
      /*except:*/ {
        __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_1);

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":194
 *                 gin.clear_mapping()
 *         except:
 *             raise             # <<<<<<<<<<<<<<
 *         finally:
 *             # so we don't free the wrong memory
 */
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_1);
        __Pyx_ErrRestore(__pyx_t_5, __pyx_t_3, __pyx_t_1);
        __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; 
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L13_exception_handled;
      }
      __pyx_L14_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      goto __pyx_L10;
      __pyx_L13_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      __pyx_L19_try_end:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":197
 *         finally:
 *             # so we don't free the wrong memory
 *             islider.cleanup()             # <<<<<<<<<<<<<<
 *             vslider.cleanup()
 * 
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L11;
    __pyx_L10: {
      __pyx_why = 4;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L11;
    }
    __pyx_L11:;
    __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->cleanup(__pyx_v_islider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":198
 *             # so we don't free the wrong memory
 *             islider.cleanup()
 *             vslider.cleanup()             # <<<<<<<<<<<<<<
 * 
 *         if result.dtype == np.object_:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->cleanup(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L25_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L26;
    __pyx_L25_error:;
    if (__pyx_why == 4) {
      Py_XDECREF(__pyx_exc_type);
      Py_XDECREF(__pyx_exc_value);
      Py_XDECREF(__pyx_exc_tb);
    }
    goto __pyx_L1_error;
    __pyx_L26:;
    switch (__pyx_why) {
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }
  if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":200
 *             vslider.cleanup()
 * 
 *         if result.dtype == np.object_:             # <<<<<<<<<<<<<<
 *             result = maybe_convert_objects(result)
 * 
 */
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__object_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_11) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":201
 * 
 *         if result.dtype == np.object_:
 *             result = maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 *         return result, counts
 */
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_89); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_result));
    __pyx_v_result = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L27;
  }
  __pyx_L27:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":203
 *             result = maybe_convert_objects(result)
 * 
 *         return result, counts             # <<<<<<<<<<<<<<
 * 
 *     def _get_result_array(self, object res):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_counts));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_counts));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XDECREF((PyObject *)__pyx_v_vslider);
  __Pyx_XDECREF((PyObject *)__pyx_v_islider);
  __Pyx_XDECREF((PyObject *)__pyx_v_gin);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":205
 *         return result, counts
 * 
 *     def _get_result_array(self, object res):             # <<<<<<<<<<<<<<
 *         try:
 *             assert(not isinstance(res, np.ndarray))
 */

static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_result_array");

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":206
 * 
 *     def _get_result_array(self, object res):
 *         try:             # <<<<<<<<<<<<<<
 *             assert(not isinstance(res, np.ndarray))
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":207
 *     def _get_result_array(self, object res):
 *         try:
 *             assert(not isinstance(res, np.ndarray))             # <<<<<<<<<<<<<<
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 * 
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = ((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray));
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_res, __pyx_t_4); 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!(!__pyx_t_5))) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      #endif

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":208
 *         try:
 *             assert(not isinstance(res, np.ndarray))
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))             # <<<<<<<<<<<<<<
 * 
 *             result = np.empty(self.ngroups, dtype='O')
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = ((PyObject *)((PyObject*)(&PyList_Type)));
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_res, __pyx_t_4); 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {
        __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __pyx_t_4 = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_8 = (__pyx_t_6 == __pyx_t_7);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_5;
      }
      if (unlikely(!(!__pyx_t_9))) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      #endif

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":210
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 * 
 *             result = np.empty(self.ngroups, dtype='O')             # <<<<<<<<<<<<<<
 *         except Exception:
 *             raise ValueError('function does not reduce')
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->ngroups); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_11));
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_10, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_v_result = __pyx_t_12;
      __pyx_t_12 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":211
 * 
 *             result = np.empty(self.ngroups, dtype='O')
 *         except Exception:             # <<<<<<<<<<<<<<
 *             raise ValueError('function does not reduce')
 *         return result
 */
    __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_13) {
      __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_4, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_11);

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":212
 *             result = np.empty(self.ngroups, dtype='O')
 *         except Exception:
 *             raise ValueError('function does not reduce')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
      __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      {__pyx_filename = __pyx_f[10]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L12_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":213
 *         except Exception:
 *             raise ValueError('function does not reduce')
 *         return result             # <<<<<<<<<<<<<<
 * 
 * cdef class SeriesGrouper:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pandas.lib.SeriesBinGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":118
 * 
 *     cdef public:
 *         object arr, index, dummy, f, bins             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, object series, object f, object bins, object dummy):
 */

static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->arr = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->index = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->dummy = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->f = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins);
  ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)__pyx_v_self)->bins = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":227
 *         object arr, index, dummy, f, labels
 * 
 *     def __init__(self, object series, object f, object labels,             # <<<<<<<<<<<<<<
 *                  Py_ssize_t ngroups, object dummy):
 *         n = len(series)
 */

static int __pyx_pf_6pandas_3lib_13SeriesGrouper___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_series = 0;
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_labels = 0;
  Py_ssize_t __pyx_v_ngroups;
  PyObject *__pyx_v_dummy = 0;
  Py_ssize_t __pyx_v_n;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__series,&__pyx_n_s__f,&__pyx_n_s__labels,&__pyx_n_s__ngroups,&__pyx_n_s__dummy,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__series);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ngroups);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_series = values[0];
    __pyx_v_f = values[1];
    __pyx_v_labels = values[2];
    __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[3]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_dummy = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.SeriesGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_series);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":229
 *     def __init__(self, object series, object f, object labels,
 *                  Py_ssize_t ngroups, object dummy):
 *         n = len(series)             # <<<<<<<<<<<<<<
 * 
 *         self.labels = labels
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_series); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":231
 *         n = len(series)
 * 
 *         self.labels = labels             # <<<<<<<<<<<<<<
 *         self.f = f
 *         if not series.flags.c_contiguous:
 */
  __Pyx_INCREF(__pyx_v_labels);
  __Pyx_GIVEREF(__pyx_v_labels);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels = __pyx_v_labels;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":232
 * 
 *         self.labels = labels
 *         self.f = f             # <<<<<<<<<<<<<<
 *         if not series.flags.c_contiguous:
 *             series = series.copy('C')
 */
  __Pyx_INCREF(__pyx_v_f);
  __Pyx_GIVEREF(__pyx_v_f);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f = __pyx_v_f;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":233
 *         self.labels = labels
 *         self.f = f
 *         if not series.flags.c_contiguous:             # <<<<<<<<<<<<<<
 *             series = series.copy('C')
 *         self.arr = series
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_series, __pyx_n_s__flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__c_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":234
 *         self.f = f
 *         if not series.flags.c_contiguous:
 *             series = series.copy('C')             # <<<<<<<<<<<<<<
 *         self.arr = series
 *         self.index = series.index
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_series, __pyx_n_s__copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_series);
    __pyx_v_series = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":235
 *         if not series.flags.c_contiguous:
 *             series = series.copy('C')
 *         self.arr = series             # <<<<<<<<<<<<<<
 *         self.index = series.index
 * 
 */
  __Pyx_INCREF(__pyx_v_series);
  __Pyx_GIVEREF(__pyx_v_series);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr = __pyx_v_series;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":236
 *             series = series.copy('C')
 *         self.arr = series
 *         self.index = series.index             # <<<<<<<<<<<<<<
 * 
 *         self.dummy = self._check_dummy(dummy)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_series, __pyx_n_s__index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":238
 *         self.index = series.index
 * 
 *         self.dummy = self._check_dummy(dummy)             # <<<<<<<<<<<<<<
 *         self.passed_dummy = dummy is not None
 *         self.ngroups = ngroups
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___check_dummy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_dummy);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dummy);
  __Pyx_GIVEREF(__pyx_v_dummy);
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":239
 * 
 *         self.dummy = self._check_dummy(dummy)
 *         self.passed_dummy = dummy is not None             # <<<<<<<<<<<<<<
 *         self.ngroups = ngroups
 * 
 */
  __pyx_t_5 = (__pyx_v_dummy != Py_None);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->passed_dummy = __pyx_t_5;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":240
 *         self.dummy = self._check_dummy(dummy)
 *         self.passed_dummy = dummy is not None
 *         self.ngroups = ngroups             # <<<<<<<<<<<<<<
 * 
 *     def _check_dummy(self, dummy=None):
 */
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->ngroups = __pyx_v_ngroups;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.SeriesGrouper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_series);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":242
 *         self.ngroups = ngroups
 * 
 *     def _check_dummy(self, dummy=None):             # <<<<<<<<<<<<<<
 *         if dummy is None:
 *             dummy = np.empty(0, dtype=self.arr.dtype)
 */

static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_1_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_1_check_dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dummy,0};
  __Pyx_RefNannySetupContext("_check_dummy");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_check_dummy") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dummy = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_check_dummy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.SeriesGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_dummy);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":243
 * 
 *     def _check_dummy(self, dummy=None):
 *         if dummy is None:             # <<<<<<<<<<<<<<
 *             dummy = np.empty(0, dtype=self.arr.dtype)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_dummy == Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":244
 *     def _check_dummy(self, dummy=None):
 *         if dummy is None:
 *             dummy = np.empty(0, dtype=self.arr.dtype)             # <<<<<<<<<<<<<<
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr, __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_k_tuple_113), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_dummy);
    __pyx_v_dummy = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":246
 *             dummy = np.empty(0, dtype=self.arr.dtype)
 *         else:
 *             if dummy.dtype != self.arr.dtype:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Dummy array must be same dtype')
 *             if not dummy.flags.contiguous:
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_dummy, __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":247
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')             # <<<<<<<<<<<<<<
 *             if not dummy.flags.contiguous:
 *                 dummy = dummy.copy()
 */
      __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[10]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":248
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')
 *             if not dummy.flags.contiguous:             # <<<<<<<<<<<<<<
 *                 dummy = dummy.copy()
 * 
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_dummy, __pyx_n_s__flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__contiguous); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (!__pyx_t_1);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":249
 *                 raise ValueError('Dummy array must be same dtype')
 *             if not dummy.flags.contiguous:
 *                 dummy = dummy.copy()             # <<<<<<<<<<<<<<
 * 
 *         return dummy
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_dummy, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_dummy);
      __pyx_v_dummy = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":251
 *                 dummy = dummy.copy()
 * 
 *         return dummy             # <<<<<<<<<<<<<<
 * 
 *     def get_result(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_dummy);
  __pyx_r = __pyx_v_dummy;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.SeriesGrouper._check_dummy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":253
 *         return dummy
 * 
 *     def get_result(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray arr, result
 */

static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_2get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_2get_result(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_labels = 0;
  PyArrayObject *__pyx_v_counts = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_group_size;
  Py_ssize_t __pyx_v_lab;
  PyObject *__pyx_v_res = 0;
  PyObject *__pyx_v_chunk = 0;
  int __pyx_v_initialized;
  struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_vslider = 0;
  struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_islider = 0;
  struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_gin = 0;
  Py_buffer __pyx_bstruct_labels;
  Py_ssize_t __pyx_bstride_0_labels = 0;
  Py_ssize_t __pyx_bshape_0_labels = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArrayObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_result");
  __pyx_bstruct_labels.buf = NULL;
  __pyx_bstruct_counts.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":259
 *             Py_ssize_t i, n, group_size, lab
 *             object res, chunk
 *             bint initialized = 0             # <<<<<<<<<<<<<<
 *             Slider vslider, islider
 *             IndexEngine gin
 */
  __pyx_v_initialized = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":263
 *             IndexEngine gin
 * 
 *         labels = self.labels             # <<<<<<<<<<<<<<
 *         counts = np.zeros(self.ngroups, dtype=np.int64)
 *         chunk = self.dummy
 */
  if (!(likely(((((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels) == Py_None) || likely(__Pyx_TypeTest(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyArrayObject *)((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_t_1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_2 < 0)) {
      PyErr_Fetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_labels, (PyObject*)__pyx_v_labels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_3); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      }
    }
    __pyx_bstride_0_labels = __pyx_bstruct_labels.strides[0];
    __pyx_bshape_0_labels = __pyx_bstruct_labels.shape[0];
    if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = 0;
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  __pyx_v_labels = ((PyArrayObject *)((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":264
 * 
 *         labels = self.labels
 *         counts = np.zeros(self.ngroups, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         chunk = self.dummy
 *         group_size = 0
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__zeros); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->ngroups); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__int64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_2 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_2 < 0)) {
      PyErr_Fetch(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_3);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_5, __pyx_t_4, __pyx_t_3);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":265
 *         labels = self.labels
 *         counts = np.zeros(self.ngroups, dtype=np.int64)
 *         chunk = self.dummy             # <<<<<<<<<<<<<<
 *         group_size = 0
 *         n = len(self.arr)
 */
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  __pyx_v_chunk = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":266
 *         counts = np.zeros(self.ngroups, dtype=np.int64)
 *         chunk = self.dummy
 *         group_size = 0             # <<<<<<<<<<<<<<
 *         n = len(self.arr)
 * 
 */
  __pyx_v_group_size = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":267
 *         chunk = self.dummy
 *         group_size = 0
 *         n = len(self.arr)             # <<<<<<<<<<<<<<
 * 
 *         vslider = Slider(self.arr, self.dummy)
 */
  __pyx_t_10 = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr;
  __Pyx_INCREF(__pyx_t_10);
  __pyx_t_11 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_n = __pyx_t_11;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":269
 *         n = len(self.arr)
 * 
 *         vslider = Slider(self.arr, self.dummy)             # <<<<<<<<<<<<<<
 *         islider = Slider(self.index, self.dummy.index)
 * 
 */
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  PyTuple_SET_ITEM(__pyx_t_10, 0, ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  __Pyx_GIVEREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  __Pyx_GIVEREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_v_vslider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":270
 * 
 *         vslider = Slider(self.arr, self.dummy)
 *         islider = Slider(self.index, self.dummy.index)             # <<<<<<<<<<<<<<
 * 
 *         gin = <IndexEngine> self.dummy.index._engine
 */
  __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy, __pyx_n_s__index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  PyTuple_SET_ITEM(__pyx_t_10, 0, ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  __Pyx_GIVEREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Slider)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_v_islider = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":272
 *         islider = Slider(self.index, self.dummy.index)
 * 
 *         gin = <IndexEngine> self.dummy.index._engine             # <<<<<<<<<<<<<<
 *         try:
 *             for i in range(n):
 */
  __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy, __pyx_n_s__index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s___engine); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_t_10)));
  __pyx_v_gin = ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":273
 * 
 *         gin = <IndexEngine> self.dummy.index._engine
 *         try:             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 group_size += 1
 */
  /*try:*/ {
    {
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":274
 *         gin = <IndexEngine> self.dummy.index._engine
 *         try:
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 group_size += 1
 * 
 */
        __pyx_t_11 = __pyx_v_n;
        for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
          __pyx_v_i = __pyx_t_12;

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":275
 *         try:
 *             for i in range(n):
 *                 group_size += 1             # <<<<<<<<<<<<<<
 * 
 *                 lab = labels[i]
 */
          __pyx_v_group_size = (__pyx_v_group_size + 1);

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":277
 *                 group_size += 1
 * 
 *                 lab = labels[i]             # <<<<<<<<<<<<<<
 * 
 *                 if i == n - 1 or lab != labels[i + 1]:
 */
          __pyx_t_13 = __pyx_v_i;
          __pyx_t_2 = -1;
          if (__pyx_t_13 < 0) {
            __pyx_t_13 += __pyx_bshape_0_labels;
            if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0;
          } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_labels)) __pyx_t_2 = 0;
          if (unlikely(__pyx_t_2 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_2);
            {__pyx_filename = __pyx_f[10]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          }
          __pyx_v_lab = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_13, __pyx_bstride_0_labels));

          /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":279
 *                 lab = labels[i]
 * 
 *                 if i == n - 1 or lab != labels[i + 1]:             # <<<<<<<<<<<<<<
 *                     if lab == -1:
 *                         islider.advance(group_size)
 */
          __pyx_t_14 = (__pyx_v_i == (__pyx_v_n - 1));
          if (!__pyx_t_14) {
            __pyx_t_15 = (__pyx_v_i + 1);
            __pyx_t_2 = -1;
            if (__pyx_t_15 < 0) {
              __pyx_t_15 += __pyx_bshape_0_labels;
              if (unlikely(__pyx_t_15 < 0)) __pyx_t_2 = 0;
            } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_labels)) __pyx_t_2 = 0;
            if (unlikely(__pyx_t_2 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_2);
              {__pyx_filename = __pyx_f[10]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            }
            __pyx_t_16 = (__pyx_v_lab != (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_labels.buf, __pyx_t_15, __pyx_bstride_0_labels)));
            __pyx_t_17 = __pyx_t_16;
          } else {
            __pyx_t_17 = __pyx_t_14;
          }
          if (__pyx_t_17) {

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":280
 * 
 *                 if i == n - 1 or lab != labels[i + 1]:
 *                     if lab == -1:             # <<<<<<<<<<<<<<
 *                         islider.advance(group_size)
 *                         vslider.advance(group_size)
 */
            __pyx_t_17 = (__pyx_v_lab == -1);
            if (__pyx_t_17) {

              /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":281
 *                 if i == n - 1 or lab != labels[i + 1]:
 *                     if lab == -1:
 *                         islider.advance(group_size)             # <<<<<<<<<<<<<<
 *                         vslider.advance(group_size)
 *                         group_size = 0
 */
              __pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":282
 *                     if lab == -1:
 *                         islider.advance(group_size)
 *                         vslider.advance(group_size)             # <<<<<<<<<<<<<<
 *                         group_size = 0
 *                         continue
 */
              __pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

              /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":283
 *                         islider.advance(group_size)
 *                         vslider.advance(group_size)
 *                         group_size = 0             # <<<<<<<<<<<<<<
 *                         continue
 * 
 */
              __pyx_v_group_size = 0;

              /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":284
 *                         vslider.advance(group_size)
 *                         group_size = 0
 *                         continue             # <<<<<<<<<<<<<<
 * 
 *                     islider.set_length(group_size)
 */
              goto __pyx_L16_continue;
              goto __pyx_L19;
            }
            __pyx_L19:;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":286
 *                         continue
 * 
 *                     islider.set_length(group_size)             # <<<<<<<<<<<<<<
 *                     vslider.set_length(group_size)
 * 
 */
            __pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->set_length(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":287
 * 
 *                     islider.set_length(group_size)
 *                     vslider.set_length(group_size)             # <<<<<<<<<<<<<<
 * 
 *                     res = self.f(chunk)
 */
            __pyx_t_10 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->set_length(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":289
 *                     vslider.set_length(group_size)
 * 
 *                     res = self.f(chunk)             # <<<<<<<<<<<<<<
 * 
 *                     if not initialized:
 */
            __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_10));
            __Pyx_INCREF(__pyx_v_chunk);
            PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chunk);
            __Pyx_GIVEREF(__pyx_v_chunk);
            __pyx_t_6 = PyObject_Call(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_v_res);
            __pyx_v_res = __pyx_t_6;
            __pyx_t_6 = 0;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":291
 *                     res = self.f(chunk)
 * 
 *                     if not initialized:             # <<<<<<<<<<<<<<
 *                         result = self._get_result_array(res)
 *                         initialized = 1
 */
            __pyx_t_17 = (!__pyx_v_initialized);
            if (__pyx_t_17) {

              /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":292
 * 
 *                     if not initialized:
 *                         result = self._get_result_array(res)             # <<<<<<<<<<<<<<
 *                         initialized = 1
 * 
 */
              __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___get_result_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(((PyObject *)__pyx_t_10));
              __Pyx_INCREF(__pyx_v_res);
              PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_res);
              __Pyx_GIVEREF(__pyx_v_res);
              __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
              if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
              __Pyx_XDECREF(((PyObject *)__pyx_v_result));
              __pyx_v_result = ((PyArrayObject *)__pyx_t_8);
              __pyx_t_8 = 0;

              /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":293
 *                     if not initialized:
 *                         result = self._get_result_array(res)
 *                         initialized = 1             # <<<<<<<<<<<<<<
 * 
 *                     util.assign_value_1d(result, lab, res)
 */
              __pyx_v_initialized = 1;
              goto __pyx_L20;
            }
            __pyx_L20:;
            if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} }__pyx_t_2 = assign_value_1d(__pyx_v_result, __pyx_v_lab, __pyx_v_res); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;}

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":296
 * 
 *                     util.assign_value_1d(result, lab, res)
 *                     counts[lab] = group_size             # <<<<<<<<<<<<<<
 *                     islider.advance(group_size)
 *                     vslider.advance(group_size)
 */
            __pyx_t_18 = __pyx_v_lab;
            __pyx_t_2 = -1;
            if (__pyx_t_18 < 0) {
              __pyx_t_18 += __pyx_bshape_0_counts;
              if (unlikely(__pyx_t_18 < 0)) __pyx_t_2 = 0;
            } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_counts)) __pyx_t_2 = 0;
            if (unlikely(__pyx_t_2 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_2);
              {__pyx_filename = __pyx_f[10]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            }
            *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_18, __pyx_bstride_0_counts) = __pyx_v_group_size;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":297
 *                     util.assign_value_1d(result, lab, res)
 *                     counts[lab] = group_size
 *                     islider.advance(group_size)             # <<<<<<<<<<<<<<
 *                     vslider.advance(group_size)
 * 
 */
            __pyx_t_8 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->advance(__pyx_v_islider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":298
 *                     counts[lab] = group_size
 *                     islider.advance(group_size)
 *                     vslider.advance(group_size)             # <<<<<<<<<<<<<<
 * 
 *                     group_size = 0
 */
            __pyx_t_8 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->advance(__pyx_v_vslider, __pyx_v_group_size, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":300
 *                     vslider.advance(group_size)
 * 
 *                     group_size = 0             # <<<<<<<<<<<<<<
 * 
 *                     gin.clear_mapping()
 */
            __pyx_v_group_size = 0;

            /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":302
 *                     group_size = 0
 * 
 *                     gin.clear_mapping()             # <<<<<<<<<<<<<<
 * 
 *         except:
 */
            __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_gin), __pyx_n_s__clear_mapping); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L18;
          }
          __pyx_L18:;
          __pyx_L16_continue:;
        }
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":304
 *                     gin.clear_mapping()
 * 
 *         except:             # <<<<<<<<<<<<<<
 *             raise
 *         finally:
 */
      /*except:*/ {
        __Pyx_AddTraceback("pandas.lib.SeriesGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_6);

        /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":305
 * 
 *         except:
 *             raise             # <<<<<<<<<<<<<<
 *         finally:
 *             # so we don't free the wrong memory
 */
        __Pyx_GIVEREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_6);
        __Pyx_ErrRestore(__pyx_t_10, __pyx_t_8, __pyx_t_6);
        __pyx_t_10 = 0; __pyx_t_8 = 0; __pyx_t_6 = 0; 
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L9_exception_handled;
      }
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L6;
      __pyx_L9_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L15_try_end:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":308
 *         finally:
 *             # so we don't free the wrong memory
 *             islider.cleanup()             # <<<<<<<<<<<<<<
 *             vslider.cleanup()
 * 
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L7;
    __pyx_L6: {
      __pyx_why = 4;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L7;
    }
    __pyx_L7:;
    __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_islider->__pyx_vtab)->cleanup(__pyx_v_islider, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":309
 *             # so we don't free the wrong memory
 *             islider.cleanup()
 *             vslider.cleanup()             # <<<<<<<<<<<<<<
 * 
 *         if result.dtype == np.object_:
 */
    __pyx_t_6 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)__pyx_v_vslider->__pyx_vtab)->cleanup(__pyx_v_vslider, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L24;
    __pyx_L23_error:;
    if (__pyx_why == 4) {
      Py_XDECREF(__pyx_exc_type);
      Py_XDECREF(__pyx_exc_value);
      Py_XDECREF(__pyx_exc_tb);
    }
    goto __pyx_L1_error;
    __pyx_L24:;
    switch (__pyx_why) {
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }
  if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }__pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":311
 *             vslider.cleanup()
 * 
 *         if result.dtype == np.object_:             # <<<<<<<<<<<<<<
 *             result = maybe_convert_objects(result)
 * 
 */
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__object_); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_RichCompare(__pyx_t_6, __pyx_t_10, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_17 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_17) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":312
 * 
 *         if result.dtype == np.object_:
 *             result = maybe_convert_objects(result)             # <<<<<<<<<<<<<<
 * 
 *         return result, counts
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s_89); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_10));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_result));
    __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L25;
  }
  __pyx_L25:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":314
 *             result = maybe_convert_objects(result)
 * 
 *         return result, counts             # <<<<<<<<<<<<<<
 * 
 *     def _get_result_array(self, object res):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_counts));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_counts));
  __pyx_r = ((PyObject *)__pyx_t_6);
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.SeriesGrouper.get_result", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_labels);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_labels);
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_chunk);
  __Pyx_XDECREF((PyObject *)__pyx_v_vslider);
  __Pyx_XDECREF((PyObject *)__pyx_v_islider);
  __Pyx_XDECREF((PyObject *)__pyx_v_gin);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":316
 *         return result, counts
 * 
 *     def _get_result_array(self, object res):             # <<<<<<<<<<<<<<
 *         try:
 *             assert(not isinstance(res, np.ndarray))
 */

static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3_get_result_array(PyObject *__pyx_v_self, PyObject *__pyx_v_res) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_result_array");

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":317
 * 
 *     def _get_result_array(self, object res):
 *         try:             # <<<<<<<<<<<<<<
 *             assert(not isinstance(res, np.ndarray))
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":318
 *     def _get_result_array(self, object res):
 *         try:
 *             assert(not isinstance(res, np.ndarray))             # <<<<<<<<<<<<<<
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 * 
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = ((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray));
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_res, __pyx_t_4); 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!(!__pyx_t_5))) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      #endif

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":319
 *         try:
 *             assert(not isinstance(res, np.ndarray))
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))             # <<<<<<<<<<<<<<
 * 
 *             result = np.empty(self.ngroups, dtype='O')
 */
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      __pyx_t_4 = ((PyObject *)((PyObject*)(&PyList_Type)));
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_res, __pyx_t_4); 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {
        __pyx_t_6 = PyObject_Length(__pyx_v_res); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __pyx_t_4 = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_8 = (__pyx_t_6 == __pyx_t_7);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_5;
      }
      if (unlikely(!(!__pyx_t_9))) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[10]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      #endif

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":321
 *             assert(not (isinstance(res, list) and len(res) == len(self.dummy)))
 * 
 *             result = np.empty(self.ngroups, dtype='O')             # <<<<<<<<<<<<<<
 *         except Exception:
 *             raise ValueError('function does not reduce')
 */
      __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->ngroups); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_11));
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_10, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_v_result = __pyx_t_12;
      __pyx_t_12 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":322
 * 
 *             result = np.empty(self.ngroups, dtype='O')
 *         except Exception:             # <<<<<<<<<<<<<<
 *             raise ValueError('function does not reduce')
 *         return result
 */
    __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_13) {
      __Pyx_AddTraceback("pandas.lib.SeriesGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_4, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_11);

      /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":323
 *             result = np.empty(self.ngroups, dtype='O')
 *         except Exception:
 *             raise ValueError('function does not reduce')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
      __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_Raise(__pyx_t_10, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      {__pyx_filename = __pyx_f[10]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L12_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":324
 *         except Exception:
 *             raise ValueError('function does not reduce')
 *         return result             # <<<<<<<<<<<<<<
 * 
 * cdef class Slider:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pandas.lib.SeriesGrouper._get_result_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":225
 * 
 *     cdef public:
 *         object arr, index, dummy, f, labels             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, object series, object f, object labels,
 */

static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->arr = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->index = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->dummy = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->f = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__");
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels);
  ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)__pyx_v_self)->labels = Py_None;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":335
 *         char *orig_data
 * 
 *     def __init__(self, object values, object buf):             # <<<<<<<<<<<<<<
 *         assert(values.ndim == 1)
 *         if not values.flags.contiguous:
 */

static int __pyx_pf_6pandas_3lib_6Slider___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_6Slider___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_buf = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__buf,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buf);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = values[0];
    __pyx_v_buf = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Slider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_values);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":336
 * 
 *     def __init__(self, object values, object buf):
 *         assert(values.ndim == 1)             # <<<<<<<<<<<<<<
 *         if not values.flags.contiguous:
 *             values = values.copy()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_3)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[10]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":337
 *     def __init__(self, object values, object buf):
 *         assert(values.ndim == 1)
 *         if not values.flags.contiguous:             # <<<<<<<<<<<<<<
 *             values = values.copy()
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":338
 *         assert(values.ndim == 1)
 *         if not values.flags.contiguous:
 *             values = values.copy()             # <<<<<<<<<<<<<<
 * 
 *         assert(values.dtype == buf.dtype)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_values);
    __pyx_v_values = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":340
 *             values = values.copy()
 * 
 *         assert(values.dtype == buf.dtype)             # <<<<<<<<<<<<<<
 *         self.values = values
 *         self.buf = buf
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_buf, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[10]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":341
 * 
 *         assert(values.dtype == buf.dtype)
 *         self.values = values             # <<<<<<<<<<<<<<
 *         self.buf = buf
 *         self.stride = values.dtype.itemsize
 */
  if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->values);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->values));
  ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->values = ((PyArrayObject *)__pyx_v_values);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":342
 *         assert(values.dtype == buf.dtype)
 *         self.values = values
 *         self.buf = buf             # <<<<<<<<<<<<<<
 *         self.stride = values.dtype.itemsize
 * 
 */
  if (!(likely(((__pyx_v_buf) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_buf, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_buf);
  __Pyx_GIVEREF(__pyx_v_buf);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->buf);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->buf));
  ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->buf = ((PyArrayObject *)__pyx_v_buf);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":343
 *         self.values = values
 *         self.buf = buf
 *         self.stride = values.dtype.itemsize             # <<<<<<<<<<<<<<
 * 
 *         self.orig_data = self.buf.data
 */
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->stride = __pyx_t_6;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":345
 *         self.stride = values.dtype.itemsize
 * 
 *         self.orig_data = self.buf.data             # <<<<<<<<<<<<<<
 *         self.orig_len = self.buf.shape[0]
 * 
 */
  ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->orig_data = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->buf->data;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":346
 * 
 *         self.orig_data = self.buf.data
 *         self.orig_len = self.buf.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         self.buf.data = self.values.data
 */
  ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->orig_len = (((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->buf->dimensions[0]);

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":348
 *         self.orig_len = self.buf.shape[0]
 * 
 *         self.buf.data = self.values.data             # <<<<<<<<<<<<<<
 * 
 *     cpdef advance(self, Py_ssize_t k):
 */
  ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->buf->data = ((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->values->data;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib.Slider.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":350
 *         self.buf.data = self.values.data
 * 
 *     cpdef advance(self, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *         self.buf.data = <char*> self.buf.data + self.stride * k
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_6Slider_1advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_6Slider_advance(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_k, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("advance");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_6Slider_1advance)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":351
 * 
 *     cpdef advance(self, Py_ssize_t k):
 *         self.buf.data = <char*> self.buf.data + self.stride * k             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_length(self, Py_ssize_t length):
 */
  __pyx_v_self->buf->data = (((char *)__pyx_v_self->buf->data) + (__pyx_v_self->stride * __pyx_v_k));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":350
 *         self.buf.data = self.values.data
 * 
 *     cpdef advance(self, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *         self.buf.data = <char*> self.buf.data + self.stride * k
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_6Slider_1advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_6Slider_1advance(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
  Py_ssize_t __pyx_v_k;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("advance");
  assert(__pyx_arg_k); {
    __pyx_v_k = __Pyx_PyIndex_AsSsize_t(__pyx_arg_k); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->__pyx_vtab)->advance(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Slider.advance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":353
 *         self.buf.data = <char*> self.buf.data + self.stride * k
 * 
 *     cpdef set_length(self, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *         self.buf.shape[0] = length
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_6Slider_2set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_6Slider_set_length(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, Py_ssize_t __pyx_v_length, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_length");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_6Slider_2set_length)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":354
 * 
 *     cpdef set_length(self, Py_ssize_t length):
 *         self.buf.shape[0] = length             # <<<<<<<<<<<<<<
 * 
 *     cpdef cleanup(self):
 */
  (__pyx_v_self->buf->dimensions[0]) = __pyx_v_length;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":353
 *         self.buf.data = <char*> self.buf.data + self.stride * k
 * 
 *     cpdef set_length(self, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *         self.buf.shape[0] = length
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_6Slider_2set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_6Slider_2set_length(PyObject *__pyx_v_self, PyObject *__pyx_arg_length) {
  Py_ssize_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_length");
  assert(__pyx_arg_length); {
    __pyx_v_length = __Pyx_PyIndex_AsSsize_t(__pyx_arg_length); if (unlikely((__pyx_v_length == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->__pyx_vtab)->set_length(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), __pyx_v_length, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Slider.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":356
 *         self.buf.shape[0] = length
 * 
 *     cpdef cleanup(self):             # <<<<<<<<<<<<<<
 *         self.buf.shape[0] = self.orig_len
 *         self.buf.data = self.orig_data
 */

static PyObject *__pyx_pf_6pandas_3lib_6Slider_3cleanup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_6Slider_cleanup(struct __pyx_obj_6pandas_3lib_Slider *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cleanup");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__cleanup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_6Slider_3cleanup)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":357
 * 
 *     cpdef cleanup(self):
 *         self.buf.shape[0] = self.orig_len             # <<<<<<<<<<<<<<
 *         self.buf.data = self.orig_data
 * 
 */
  (__pyx_v_self->buf->dimensions[0]) = __pyx_v_self->orig_len;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":358
 *     cpdef cleanup(self):
 *         self.buf.shape[0] = self.orig_len
 *         self.buf.data = self.orig_data             # <<<<<<<<<<<<<<
 * 
 * def reduce(arr, f, axis=0, dummy=None, labels=None):
 */
  __pyx_v_self->buf->data = __pyx_v_self->orig_data;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.Slider.cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":356
 *         self.buf.shape[0] = length
 * 
 *     cpdef cleanup(self):             # <<<<<<<<<<<<<<
 *         self.buf.shape[0] = self.orig_len
 *         self.buf.data = self.orig_data
 */

static PyObject *__pyx_pf_6pandas_3lib_6Slider_3cleanup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_6Slider_3cleanup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("cleanup");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Slider *)((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self)->__pyx_vtab)->cleanup(((struct __pyx_obj_6pandas_3lib_Slider *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.Slider.cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/reduce.pyx":360
 *         self.buf.data = self.orig_data
 * 
 * def reduce(arr, f, axis=0, dummy=None, labels=None):             # <<<<<<<<<<<<<<
 *     if labels._has_complex_internals:
 *         raise Exception('Cannot use shortcut')
 */

static PyObject *__pyx_pf_6pandas_3lib_118reduce(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_118reduce = {__Pyx_NAMESTR("reduce"), (PyCFunction)__pyx_pf_6pandas_3lib_118reduce, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_118reduce(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_f = 0;
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_v_labels = 0;
  PyObject *__pyx_v_reducer = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__f,&__pyx_n_s__axis,&__pyx_n_s__dummy,&__pyx_n_s__labels,0};
  __Pyx_RefNannySetupContext("reduce");
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("reduce", 0, 2, 5, 1); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axis);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dummy);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__labels);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "reduce") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arr = values[0];
    __pyx_v_f = values[1];
    __pyx_v_axis = values[2];
    __pyx_v_dummy = values[3];
    __pyx_v_labels = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reduce", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.reduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":361
 * 
 * def reduce(arr, f, axis=0, dummy=None, labels=None):
 *     if labels._has_complex_internals:             # <<<<<<<<<<<<<<
 *         raise Exception('Cannot use shortcut')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_labels, __pyx_n_s_116); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":362
 * def reduce(arr, f, axis=0, dummy=None, labels=None):
 *     if labels._has_complex_internals:
 *         raise Exception('Cannot use shortcut')             # <<<<<<<<<<<<<<
 * 
 *     reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels)
 */
    __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_118), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[10]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":364
 *         raise Exception('Cannot use shortcut')
 * 
 *     reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels)             # <<<<<<<<<<<<<<
 *     return reducer.get_result()
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_arr);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr);
  __Pyx_GIVEREF(__pyx_v_arr);
  __Pyx_INCREF(__pyx_v_f);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_f);
  __Pyx_GIVEREF(__pyx_v_f);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__axis), __pyx_v_axis) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dummy), __pyx_v_dummy) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__labels), __pyx_v_labels) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Reducer)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_reducer = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":365
 * 
 *     reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels)
 *     return reducer.get_result()             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_reducer, __pyx_n_s__get_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.reduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_reducer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":27
 * # from cython cimport floating, integral
 * 
 * cdef _take_2d_float64(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                       object idx):
 *     cdef:
 */

static PyObject *__pyx_f_6pandas_3lib__take_2d_float64(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bstride_1_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_ssize_t __pyx_bshape_1_indexer = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArrayObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_take_2d_float64");
  __pyx_bstruct_indexer.buf = NULL;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":31
 *     cdef:
 *         Py_ssize_t i, j, N, K
 *         ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx             # <<<<<<<<<<<<<<
 *         ndarray[float64_t, ndim=2] result
 *         object val
 */
  if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyArrayObject *)__pyx_v_idx);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_t_1, &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {
      __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_indexer.buf = NULL;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0]; __pyx_bstride_1_indexer = __pyx_bstruct_indexer.strides[1];
      __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0]; __pyx_bshape_1_indexer = __pyx_bstruct_indexer.shape[1];
    }
  }
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_v_idx);
  __pyx_v_indexer = ((PyArrayObject *)__pyx_v_idx);

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":35
 *         object val
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     result = np.empty_like(values)
 *     for i in range(N):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_7;
  __pyx_v_K = __pyx_t_8;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":36
 * 
 *     N, K = (<object> values).shape
 *     result = np.empty_like(values)             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":37
 *     N, K = (<object> values).shape
 *     result = np.empty_like(values)
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]
 */
  __pyx_t_8 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":38
 *     result = np.empty_like(values)
 *     for i in range(N):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             result[i, j] = values[i, indexer[i, j]]
 *     return result
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":39
 *     for i in range(N):
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_indexer;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_indexer)) __pyx_t_10 = 0;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_1_indexer;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_indexer)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_19 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_bstruct_indexer.buf, __pyx_t_16, __pyx_bstride_0_indexer, __pyx_t_17, __pyx_bstride_1_indexer));
      __pyx_t_10 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_1_values;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_1_values)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_21 = __pyx_v_j;
      __pyx_t_10 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_1_result;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_1_result)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_result.buf, __pyx_t_20, __pyx_bstride_0_result, __pyx_t_21, __pyx_bstride_1_result) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":40
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]
 *     return result             # <<<<<<<<<<<<<<
 * 
 * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib._take_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":42
 *     return result
 * 
 * cdef _take_2d_int64(ndarray[int64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                       object idx):
 *     cdef:
 */

static PyObject *__pyx_f_6pandas_3lib__take_2d_int64(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bstride_1_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_ssize_t __pyx_bshape_1_indexer = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArrayObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_take_2d_int64");
  __pyx_bstruct_indexer.buf = NULL;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":46
 *     cdef:
 *         Py_ssize_t i, j, N, K
 *         ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx             # <<<<<<<<<<<<<<
 *         ndarray[int64_t, ndim=2] result
 *         object val
 */
  if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyArrayObject *)__pyx_v_idx);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_t_1, &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {
      __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_indexer.buf = NULL;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0]; __pyx_bstride_1_indexer = __pyx_bstruct_indexer.strides[1];
      __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0]; __pyx_bshape_1_indexer = __pyx_bstruct_indexer.shape[1];
    }
  }
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_v_idx);
  __pyx_v_indexer = ((PyArrayObject *)__pyx_v_idx);

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":50
 *         object val
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     result = np.empty_like(values)
 *     for i in range(N):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_7;
  __pyx_v_K = __pyx_t_8;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":51
 * 
 *     N, K = (<object> values).shape
 *     result = np.empty_like(values)             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":52
 *     N, K = (<object> values).shape
 *     result = np.empty_like(values)
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]
 */
  __pyx_t_8 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":53
 *     result = np.empty_like(values)
 *     for i in range(N):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             result[i, j] = values[i, indexer[i, j]]
 *     return result
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":54
 *     for i in range(N):
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_indexer;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_indexer)) __pyx_t_10 = 0;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_1_indexer;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_indexer)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_19 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_bstruct_indexer.buf, __pyx_t_16, __pyx_bstride_0_indexer, __pyx_t_17, __pyx_bstride_1_indexer));
      __pyx_t_10 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_1_values;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_1_values)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_21 = __pyx_v_j;
      __pyx_t_10 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_1_result;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_1_result)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_20, __pyx_bstride_0_result, __pyx_t_21, __pyx_bstride_1_result) = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values));
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":55
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]
 *     return result             # <<<<<<<<<<<<<<
 * 
 * cdef _take_2d_object(ndarray[object, ndim=2] values,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib._take_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":57
 *     return result
 * 
 * cdef _take_2d_object(ndarray[object, ndim=2] values,             # <<<<<<<<<<<<<<
 *                      object idx):
 *     cdef:
 */

static PyObject *__pyx_f_6pandas_3lib__take_2d_object(PyArrayObject *__pyx_v_values, PyObject *__pyx_v_idx) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_N;
  Py_ssize_t __pyx_v_K;
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bstride_1_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_ssize_t __pyx_bshape_1_indexer = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyArrayObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  PyObject **__pyx_t_22;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_take_2d_object");
  __pyx_bstruct_indexer.buf = NULL;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":61
 *     cdef:
 *         Py_ssize_t i, j, N, K
 *         ndarray[Py_ssize_t, ndim=2, cast=True] indexer = idx             # <<<<<<<<<<<<<<
 *         ndarray[object, ndim=2] result
 *         object val
 */
  if (!(likely(((__pyx_v_idx) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_idx, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((PyArrayObject *)__pyx_v_idx);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_t_1, &__Pyx_TypeInfo_Py_ssize_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {
      __pyx_v_indexer = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_indexer.buf = NULL;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0]; __pyx_bstride_1_indexer = __pyx_bstruct_indexer.strides[1];
      __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0]; __pyx_bshape_1_indexer = __pyx_bstruct_indexer.shape[1];
    }
  }
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_v_idx);
  __pyx_v_indexer = ((PyArrayObject *)__pyx_v_idx);

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":65
 *         object val
 * 
 *     N, K = (<object> values).shape             # <<<<<<<<<<<<<<
 *     result = values.copy()
 *     for i in range(N):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_7;
  __pyx_v_K = __pyx_t_8;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":66
 * 
 *     N, K = (<object> values).shape
 *     result = values.copy()             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for j in range(K):
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":67
 *     N, K = (<object> values).shape
 *     result = values.copy()
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]
 */
  __pyx_t_8 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":68
 *     result = values.copy()
 *     for i in range(N):
 *         for j in range(K):             # <<<<<<<<<<<<<<
 *             result[i, j] = values[i, indexer[i, j]]
 *     return result
 */
    __pyx_t_14 = __pyx_v_K;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":69
 *     for i in range(N):
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_t_10 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_indexer;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_indexer)) __pyx_t_10 = 0;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_1_indexer;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_indexer)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_19 = (*__Pyx_BufPtrStrided2d(Py_ssize_t *, __pyx_bstruct_indexer.buf, __pyx_t_16, __pyx_bstride_0_indexer, __pyx_t_17, __pyx_bstride_1_indexer));
      __pyx_t_10 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_1_values;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_1_values)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = *__Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_18, __pyx_bstride_0_values, __pyx_t_19, __pyx_bstride_1_values);
      __Pyx_INCREF((PyObject*)__pyx_t_4);
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_21 = __pyx_v_j;
      __pyx_t_10 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_1_result;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 1;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_1_result)) __pyx_t_10 = 1;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_22 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_20, __pyx_bstride_0_result, __pyx_t_21, __pyx_bstride_1_result);
      __Pyx_GOTREF(*__pyx_t_22);
      __Pyx_DECREF(*__pyx_t_22); __Pyx_INCREF(__pyx_t_4);
      *__pyx_t_22 = __pyx_t_4;
      __Pyx_GIVEREF(*__pyx_t_22);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":70
 *         for j in range(K):
 *             result[i, j] = values[i, indexer[i, j]]
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib._take_2d_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":73
 * 
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */

static PyObject *__pyx_pf_6pandas_3lib_119rank_1d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_119rank_1d_float64[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_119rank_1d_float64 = {__Pyx_NAMESTR("rank_1d_float64"), (PyCFunction)__pyx_pf_6pandas_3lib_119rank_1d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_119rank_1d_float64)};
static PyObject *__pyx_pf_6pandas_3lib_119rank_1d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_arr = 0;
  PyObject *__pyx_v_ties_method = 0;
  PyObject *__pyx_v_ascending = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_dups;
  PyArrayObject *__pyx_v_sorted_data = 0;
  PyArrayObject *__pyx_v_ranks = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_argsorted = 0;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_nan_value;
  __pyx_t_5numpy_float64_t __pyx_v_sum_ranks;
  int __pyx_v_tiebreak;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v__as = NULL;
  Py_buffer __pyx_bstruct_sorted_data;
  Py_ssize_t __pyx_bstride_0_sorted_data = 0;
  Py_ssize_t __pyx_bshape_0_sorted_data = 0;
  Py_buffer __pyx_bstruct_ranks;
  Py_ssize_t __pyx_bstride_0_ranks = 0;
  Py_ssize_t __pyx_bshape_0_ranks = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_argsorted;
  Py_ssize_t __pyx_bstride_0_argsorted = 0;
  Py_ssize_t __pyx_bshape_0_argsorted = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __pyx_t_5numpy_float64_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyArrayObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  __pyx_t_5numpy_int64_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __pyx_t_5numpy_int64_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  __pyx_t_5numpy_int64_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  __pyx_t_5numpy_int64_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  __pyx_t_5numpy_int64_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  __pyx_t_5numpy_int64_t __pyx_t_32;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in_arr,&__pyx_n_s__ties_method,&__pyx_n_s__ascending,0};
  __Pyx_RefNannySetupContext("rank_1d_float64");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_s__average);
    values[2] = __pyx_k_119;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in_arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ties_method);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascending);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "rank_1d_float64") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_in_arr = values[0];
    __pyx_v_ties_method = values[1];
    __pyx_v_ascending = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_1d_float64", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.rank_1d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_sorted_data.buf = NULL;
  __pyx_bstruct_ranks.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_argsorted.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":79
 * 
 *     cdef:
 *         Py_ssize_t i, j, n, dups = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t] sorted_data, ranks, values
 *         ndarray[int64_t] argsorted
 */
  __pyx_v_dups = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":83
 *         ndarray[int64_t] argsorted
 *         float64_t val, nan_value
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_sum_ranks = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":84
 *         float64_t val, nan_value
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_tiebreak = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":85
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     values = np.asarray(in_arr).copy()
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (!__pyx_t_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":87
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     values = np.asarray(in_arr).copy()             # <<<<<<<<<<<<<<
 * 
 *     if ascending:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_in_arr);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr);
  __Pyx_GIVEREF(__pyx_v_in_arr);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
    __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":89
 *     values = np.asarray(in_arr).copy()
 * 
 *     if ascending:             # <<<<<<<<<<<<<<
 *         nan_value = np.inf
 *     else:
 */
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_9) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":90
 * 
 *     if ascending:
 *         nan_value = np.inf             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = -np.inf
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nan_value = __pyx_t_10;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":92
 *         nan_value = np.inf
 *     else:
 *         nan_value = -np.inf             # <<<<<<<<<<<<<<
 *     mask = np.isnan(values)
 *     np.putmask(values, mask, nan_value)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nan_value = __pyx_t_10;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":93
 *     else:
 *         nan_value = -np.inf
 *     mask = np.isnan(values)             # <<<<<<<<<<<<<<
 *     np.putmask(values, mask, nan_value)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__isnan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_mask = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":94
 *         nan_value = -np.inf
 *     mask = np.isnan(values)
 *     np.putmask(values, mask, nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__putmask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nan_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __Pyx_INCREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_mask);
  __Pyx_GIVEREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":96
 *     np.putmask(values, mask, nan_value)
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     ranks = np.empty(n, dtype='f8')
 * 
 */
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_11;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":97
 * 
 *     n = len(values)
 *     ranks = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     # py2.5/win32 hack, can't pass i8
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_ranks = __pyx_bstruct_ranks.strides[0];
    __pyx_bshape_0_ranks = __pyx_bstruct_ranks.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":100
 * 
 *     # py2.5/win32 hack, can't pass i8
 *     if tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *         # need to use a stable sort here
 *         _as = values.argsort(kind='mergesort')
 */
  __pyx_t_9 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
  if (__pyx_t_9) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":102
 *     if tiebreak == TIEBREAK_FIRST:
 *         # need to use a stable sort here
 *         _as = values.argsort(kind='mergesort')             # <<<<<<<<<<<<<<
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 */
    __pyx_t_12 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__kind), ((PyObject *)__pyx_n_s__mergesort)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v__as = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":103
 *         # need to use a stable sort here
 *         _as = values.argsort(kind='mergesort')
 *         if not ascending:             # <<<<<<<<<<<<<<
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 */
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = (!__pyx_t_9);
    if (__pyx_t_13) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":104
 *         _as = values.argsort(kind='mergesort')
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING             # <<<<<<<<<<<<<<
 *     else:
 *         _as = values.argsort()
 */
      __pyx_v_tiebreak = __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING;
      goto __pyx_L8;
    }
    __pyx_L8:;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":106
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v__as = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":108
 *         _as = values.argsort()
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[::-1]
 * 
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = (!__pyx_t_13);
  if (__pyx_t_9) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":109
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v__as, __pyx_k_slice_120); if (!__pyx_t_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v__as);
    __pyx_v__as = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":111
 *         _as = _as[::-1]
 * 
 *     sorted_data = values.take(_as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v__as);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__as);
  __Pyx_GIVEREF(__pyx_v__as);
  __pyx_t_12 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_12);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sorted_data);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sorted_data, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sorted_data, (PyObject*)__pyx_v_sorted_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_sorted_data = __pyx_bstruct_sorted_data.strides[0];
    __pyx_bshape_0_sorted_data = __pyx_bstruct_sorted_data.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":112
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_12 = PyObject_GetAttr(__pyx_v__as, __pyx_n_s__astype); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_k_tuple_121), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_argsorted = __pyx_bstruct_argsorted.strides[0];
    __pyx_bshape_0_argsorted = __pyx_bstruct_argsorted.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":114
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         sum_ranks += i + 1
 *         dups += 1
 */
  __pyx_t_11 = __pyx_v_n;
  for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_11; __pyx_t_15+=1) {
    __pyx_v_i = __pyx_t_15;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":115
 * 
 *     for i in range(n):
 *         sum_ranks += i + 1             # <<<<<<<<<<<<<<
 *         dups += 1
 *         val = sorted_data[i]
 */
    __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1));

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":116
 *     for i in range(n):
 *         sum_ranks += i + 1
 *         dups += 1             # <<<<<<<<<<<<<<
 *         val = sorted_data[i]
 *         if val == nan_value:
 */
    __pyx_v_dups = (__pyx_v_dups + 1);

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":117
 *         sum_ranks += i + 1
 *         dups += 1
 *         val = sorted_data[i]             # <<<<<<<<<<<<<<
 *         if val == nan_value:
 *             ranks[argsorted[i]] = nan
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_3 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_bshape_0_sorted_data;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_sorted_data)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sorted_data.buf, __pyx_t_16, __pyx_bstride_0_sorted_data));

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":118
 *         dups += 1
 *         val = sorted_data[i]
 *         if val == nan_value:             # <<<<<<<<<<<<<<
 *             ranks[argsorted[i]] = nan
 *             continue
 */
    __pyx_t_9 = (__pyx_v_val == __pyx_v_nan_value);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":119
 *         val = sorted_data[i]
 *         if val == nan_value:
 *             ranks[argsorted[i]] = nan             # <<<<<<<<<<<<<<
 *             continue
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > FP_ERR:
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_argsorted;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_17, __pyx_bstride_0_argsorted));
      __pyx_t_3 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_ranks;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_18, __pyx_bstride_0_ranks) = __pyx_v_6pandas_3lib_nan;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":120
 *         if val == nan_value:
 *             ranks[argsorted[i]] = nan
 *             continue             # <<<<<<<<<<<<<<
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > FP_ERR:
 *             if tiebreak == TIEBREAK_AVERAGE:
 */
      goto __pyx_L10_continue;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":121
 *             ranks[argsorted[i]] = nan
 *             continue
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > FP_ERR:             # <<<<<<<<<<<<<<
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 */
    __pyx_t_9 = (__pyx_v_i == (__pyx_v_n - 1));
    if (!__pyx_t_9) {
      __pyx_t_19 = (__pyx_v_i + 1);
      __pyx_t_3 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_sorted_data;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_sorted_data)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = (fabs(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_sorted_data.buf, __pyx_t_19, __pyx_bstride_0_sorted_data)) - __pyx_v_val)) > __pyx_v_6pandas_3lib_FP_ERR);
      __pyx_t_20 = __pyx_t_13;
    } else {
      __pyx_t_20 = __pyx_t_9;
    }
    if (__pyx_t_20) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":122
 *             continue
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > FP_ERR:
 *             if tiebreak == TIEBREAK_AVERAGE:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups
 */
      __pyx_t_20 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_AVERAGE);
      if (__pyx_t_20) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":123
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > FP_ERR:
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:
 */
        __pyx_t_21 = (__pyx_v_i + 1);
        for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
          __pyx_v_j = __pyx_t_22;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":124
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):
 */
          if (unlikely(__pyx_v_dups == 0)) {
            PyErr_Format(PyExc_ZeroDivisionError, "float division");
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_23 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_23, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_24, __pyx_bstride_0_ranks) = (__pyx_v_sum_ranks / __pyx_v_dups);
        }
        goto __pyx_L14;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":125
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2
 */
      __pyx_t_20 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MIN);
      if (__pyx_t_20) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":126
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:
 */
        __pyx_t_21 = (__pyx_v_i + 1);
        for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
          __pyx_v_j = __pyx_t_22;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":127
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):
 */
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_25, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_26, __pyx_bstride_0_ranks) = ((__pyx_v_i - __pyx_v_dups) + 2);
        }
        goto __pyx_L14;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":128
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1
 */
      __pyx_t_20 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MAX);
      if (__pyx_t_20) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":129
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 */
        __pyx_t_21 = (__pyx_v_i + 1);
        for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
          __pyx_v_j = __pyx_t_22;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":130
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 for j in range(i - dups + 1, i + 1):
 */
          __pyx_t_27 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_27, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_28, __pyx_bstride_0_ranks) = (__pyx_v_i + 1);
        }
        goto __pyx_L14;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":131
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = j + 1
 */
      __pyx_t_20 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
      if (__pyx_t_20) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":132
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = j + 1
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 */
        __pyx_t_21 = (__pyx_v_i + 1);
        for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
          __pyx_v_j = __pyx_t_22;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":133
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = j + 1             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                 for j in range(i - dups + 1, i + 1):
 */
          __pyx_t_29 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_29 < 0) {
            __pyx_t_29 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_29, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_30, __pyx_bstride_0_ranks) = (__pyx_v_j + 1);
        }
        goto __pyx_L14;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":134
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = j + 1
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 */
      __pyx_t_20 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING);
      if (__pyx_t_20) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":135
 *                     ranks[argsorted[j]] = j + 1
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             sum_ranks = dups = 0
 */
        __pyx_t_21 = (__pyx_v_i + 1);
        for (__pyx_t_22 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
          __pyx_v_j = __pyx_t_22;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":136
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2             # <<<<<<<<<<<<<<
 *             sum_ranks = dups = 0
 *     return ranks
 */
          __pyx_t_31 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_31, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_32 < 0) {
            __pyx_t_32 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_32 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_32, __pyx_bstride_0_ranks) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2);
        }
        goto __pyx_L14;
      }
      __pyx_L14:;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":137
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *     return ranks
 * 
 */
      __pyx_v_sum_ranks = 0;
      __pyx_v_dups = 0;
      goto __pyx_L13;
    }
    __pyx_L13:;
    __pyx_L10_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":138
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             sum_ranks = dups = 0
 *     return ranks             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
  __pyx_r = ((PyObject *)__pyx_v_ranks);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sorted_data);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.rank_1d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sorted_data);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_ranks);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_argsorted);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v__as);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":141
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */

static PyObject *__pyx_pf_6pandas_3lib_120rank_1d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_120rank_1d_int64[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_120rank_1d_int64 = {__Pyx_NAMESTR("rank_1d_int64"), (PyCFunction)__pyx_pf_6pandas_3lib_120rank_1d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_120rank_1d_int64)};
static PyObject *__pyx_pf_6pandas_3lib_120rank_1d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_arr = 0;
  PyObject *__pyx_v_ties_method = 0;
  PyObject *__pyx_v_ascending = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_dups;
  PyArrayObject *__pyx_v_sorted_data = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_ranks = 0;
  PyArrayObject *__pyx_v_argsorted = 0;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_sum_ranks;
  int __pyx_v_tiebreak;
  PyObject *__pyx_v__as = NULL;
  Py_buffer __pyx_bstruct_sorted_data;
  Py_ssize_t __pyx_bstride_0_sorted_data = 0;
  Py_ssize_t __pyx_bshape_0_sorted_data = 0;
  Py_buffer __pyx_bstruct_ranks;
  Py_ssize_t __pyx_bstride_0_ranks = 0;
  Py_ssize_t __pyx_bshape_0_ranks = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_argsorted;
  Py_ssize_t __pyx_bstride_0_argsorted = 0;
  Py_ssize_t __pyx_bshape_0_argsorted = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyArrayObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_t_13;
  PyArrayObject *__pyx_t_14 = NULL;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  __pyx_t_5numpy_int64_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __pyx_t_5numpy_int64_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  __pyx_t_5numpy_int64_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  __pyx_t_5numpy_int64_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  __pyx_t_5numpy_int64_t __pyx_t_30;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in_arr,&__pyx_n_s__ties_method,&__pyx_n_s__ascending,0};
  __Pyx_RefNannySetupContext("rank_1d_int64");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)__pyx_n_s__average);
    values[2] = __pyx_k_122;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in_arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ties_method);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascending);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "rank_1d_int64") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_in_arr = values[0];
    __pyx_v_ties_method = values[1];
    __pyx_v_ascending = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_1d_int64", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.rank_1d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_sorted_data.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_ranks.buf = NULL;
  __pyx_bstruct_argsorted.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":147
 * 
 *     cdef:
 *         Py_ssize_t i, j, n, dups = 0             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] sorted_data, values
 *         ndarray[float64_t] ranks
 */
  __pyx_v_dups = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":152
 *         ndarray[int64_t] argsorted
 *         int64_t val
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_sum_ranks = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":153
 *         int64_t val
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_tiebreak = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":154
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     values = np.asarray(in_arr)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (!__pyx_t_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":156
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     values = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_in_arr);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr);
  __Pyx_GIVEREF(__pyx_v_in_arr);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
    __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":158
 *     values = np.asarray(in_arr)
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     ranks = np.empty(n, dtype='f8')
 * 
 */
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_9;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":159
 * 
 *     n = len(values)
 *     ranks = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     # py2.5/win32 hack, can't pass i8
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_ranks = __pyx_bstruct_ranks.strides[0];
    __pyx_bshape_0_ranks = __pyx_bstruct_ranks.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":162
 * 
 *     # py2.5/win32 hack, can't pass i8
 *     if tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *         # need to use a stable sort here
 *         _as = values.argsort(kind='mergesort')
 */
  __pyx_t_12 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":164
 *     if tiebreak == TIEBREAK_FIRST:
 *         # need to use a stable sort here
 *         _as = values.argsort(kind='mergesort')             # <<<<<<<<<<<<<<
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 */
    __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__kind), ((PyObject *)__pyx_n_s__mergesort)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v__as = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":165
 *         # need to use a stable sort here
 *         _as = values.argsort(kind='mergesort')
 *         if not ascending:             # <<<<<<<<<<<<<<
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 */
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_13 = (!__pyx_t_12);
    if (__pyx_t_13) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":166
 *         _as = values.argsort(kind='mergesort')
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING             # <<<<<<<<<<<<<<
 *     else:
 *         _as = values.argsort()
 */
      __pyx_v_tiebreak = __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":168
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v__as = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":170
 *         _as = values.argsort()
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[::-1]
 * 
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = (!__pyx_t_13);
  if (__pyx_t_12) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":171
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v__as, __pyx_k_slice_123); if (!__pyx_t_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_v__as);
    __pyx_v__as = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":173
 *         _as = _as[::-1]
 * 
 *     sorted_data = values.take(_as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v__as);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__as);
  __Pyx_GIVEREF(__pyx_v__as);
  __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sorted_data);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_sorted_data, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_sorted_data, (PyObject*)__pyx_v_sorted_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    __pyx_bstride_0_sorted_data = __pyx_bstruct_sorted_data.strides[0];
    __pyx_bshape_0_sorted_data = __pyx_bstruct_sorted_data.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":174
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_10 = PyObject_GetAttr(__pyx_v__as, __pyx_n_s__astype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_7, __pyx_t_6);
      }
    }
    __pyx_bstride_0_argsorted = __pyx_bstruct_argsorted.strides[0];
    __pyx_bshape_0_argsorted = __pyx_bstruct_argsorted.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":176
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         sum_ranks += i + 1
 *         dups += 1
 */
  __pyx_t_9 = __pyx_v_n;
  for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_9; __pyx_t_15+=1) {
    __pyx_v_i = __pyx_t_15;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":177
 * 
 *     for i in range(n):
 *         sum_ranks += i + 1             # <<<<<<<<<<<<<<
 *         dups += 1
 *         val = sorted_data[i]
 */
    __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1));

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":178
 *     for i in range(n):
 *         sum_ranks += i + 1
 *         dups += 1             # <<<<<<<<<<<<<<
 *         val = sorted_data[i]
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0:
 */
    __pyx_v_dups = (__pyx_v_dups + 1);

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":179
 *         sum_ranks += i + 1
 *         dups += 1
 *         val = sorted_data[i]             # <<<<<<<<<<<<<<
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0:
 *             if tiebreak == TIEBREAK_AVERAGE:
 */
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_3 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_bshape_0_sorted_data;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_sorted_data)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_sorted_data.buf, __pyx_t_16, __pyx_bstride_0_sorted_data));

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":180
 *         dups += 1
 *         val = sorted_data[i]
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0:             # <<<<<<<<<<<<<<
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 */
    __pyx_t_12 = (__pyx_v_i == (__pyx_v_n - 1));
    if (!__pyx_t_12) {
      __pyx_t_17 = (__pyx_v_i + 1);
      __pyx_t_3 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_sorted_data;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_sorted_data)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = (fabs(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_sorted_data.buf, __pyx_t_17, __pyx_bstride_0_sorted_data)) - __pyx_v_val)) > 0.0);
      __pyx_t_18 = __pyx_t_13;
    } else {
      __pyx_t_18 = __pyx_t_12;
    }
    if (__pyx_t_18) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":181
 *         val = sorted_data[i]
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0:
 *             if tiebreak == TIEBREAK_AVERAGE:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups
 */
      __pyx_t_18 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_AVERAGE);
      if (__pyx_t_18) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":182
 *         if i == n - 1 or fabs(sorted_data[i + 1] - val) > 0:
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:
 */
        __pyx_t_19 = (__pyx_v_i + 1);
        for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_j = __pyx_t_20;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":183
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):
 */
          if (unlikely(__pyx_v_dups == 0)) {
            PyErr_Format(PyExc_ZeroDivisionError, "float division");
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_21 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_21 < 0) {
            __pyx_t_21 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_22 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_21, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_22 < 0) {
            __pyx_t_22 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_22, __pyx_bstride_0_ranks) = (__pyx_v_sum_ranks / __pyx_v_dups);
        }
        goto __pyx_L12;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":184
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2
 */
      __pyx_t_18 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MIN);
      if (__pyx_t_18) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":185
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:
 */
        __pyx_t_19 = (__pyx_v_i + 1);
        for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_j = __pyx_t_20;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":186
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):
 */
          __pyx_t_23 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_23 < 0) {
            __pyx_t_23 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_23, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_24, __pyx_bstride_0_ranks) = ((__pyx_v_i - __pyx_v_dups) + 2);
        }
        goto __pyx_L12;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":187
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1
 */
      __pyx_t_18 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MAX);
      if (__pyx_t_18) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":188
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 */
        __pyx_t_19 = (__pyx_v_i + 1);
        for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_j = __pyx_t_20;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":189
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 for j in range(i - dups + 1, i + 1):
 */
          __pyx_t_25 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_25, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_26, __pyx_bstride_0_ranks) = (__pyx_v_i + 1);
        }
        goto __pyx_L12;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":190
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = j + 1
 */
      __pyx_t_18 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
      if (__pyx_t_18) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":191
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = j + 1
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 */
        __pyx_t_19 = (__pyx_v_i + 1);
        for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_j = __pyx_t_20;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":192
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = j + 1             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                 for j in range(i - dups + 1, i + 1):
 */
          __pyx_t_27 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_28 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_27, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_28, __pyx_bstride_0_ranks) = (__pyx_v_j + 1);
        }
        goto __pyx_L12;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":193
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = j + 1
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 */
      __pyx_t_18 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING);
      if (__pyx_t_18) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":194
 *                     ranks[argsorted[j]] = j + 1
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             sum_ranks = dups = 0
 */
        __pyx_t_19 = (__pyx_v_i + 1);
        for (__pyx_t_20 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
          __pyx_v_j = __pyx_t_20;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":195
 *             elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2             # <<<<<<<<<<<<<<
 *             sum_ranks = dups = 0
 *     return ranks
 */
          __pyx_t_29 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_29 < 0) {
            __pyx_t_29 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_29, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_30, __pyx_bstride_0_ranks) = ((((2 * __pyx_v_i) - __pyx_v_j) - __pyx_v_dups) + 2);
        }
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":196
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *     return ranks
 * 
 */
      __pyx_v_sum_ranks = 0;
      __pyx_v_dups = 0;
      goto __pyx_L11;
    }
    __pyx_L11:;
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":197
 *                     ranks[argsorted[j]] = 2 * i - j - dups + 2
 *             sum_ranks = dups = 0
 *     return ranks             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
  __pyx_r = ((PyObject *)__pyx_v_ranks);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sorted_data);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.rank_1d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_sorted_data);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_ranks);
  __Pyx_XDECREF((PyObject *)__pyx_v_argsorted);
  __Pyx_XDECREF(__pyx_v__as);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":200
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True):
 *     """
 */

static PyObject *__pyx_pf_6pandas_3lib_121rank_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_121rank_2d_float64[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_121rank_2d_float64 = {__Pyx_NAMESTR("rank_2d_float64"), (PyCFunction)__pyx_pf_6pandas_3lib_121rank_2d_float64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_121rank_2d_float64)};
static PyObject *__pyx_pf_6pandas_3lib_121rank_2d_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_arr = 0;
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_v_ties_method = 0;
  PyObject *__pyx_v_ascending = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_z;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_dups;
  PyArrayObject *__pyx_v_ranks = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_argsorted = 0;
  __pyx_t_5numpy_float64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_nan_value;
  __pyx_t_5numpy_float64_t __pyx_v_sum_ranks;
  int __pyx_v_tiebreak;
  PyObject *__pyx_v__as = NULL;
  Py_buffer __pyx_bstruct_ranks;
  Py_ssize_t __pyx_bstride_0_ranks = 0;
  Py_ssize_t __pyx_bstride_1_ranks = 0;
  Py_ssize_t __pyx_bshape_0_ranks = 0;
  Py_ssize_t __pyx_bshape_1_ranks = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_argsorted;
  Py_ssize_t __pyx_bstride_0_argsorted = 0;
  Py_ssize_t __pyx_bstride_1_argsorted = 0;
  Py_ssize_t __pyx_bshape_0_argsorted = 0;
  Py_ssize_t __pyx_bshape_1_argsorted = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyArrayObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_5numpy_float64_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  PyArrayObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __pyx_t_5numpy_int64_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  int __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  __pyx_t_5numpy_int64_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  __pyx_t_5numpy_int64_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  __pyx_t_5numpy_int64_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  __pyx_t_5numpy_int64_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  Py_ssize_t __pyx_t_47;
  Py_ssize_t __pyx_t_48;
  __pyx_t_5numpy_int64_t __pyx_t_49;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in_arr,&__pyx_n_s__axis,&__pyx_n_s__ties_method,&__pyx_n_s__ascending,0};
  __Pyx_RefNannySetupContext("rank_2d_float64");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_n_s__average);
    values[3] = __pyx_k_125;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in_arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axis);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ties_method);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascending);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "rank_2d_float64") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_in_arr = values[0];
    __pyx_v_axis = values[1];
    __pyx_v_ties_method = values[2];
    __pyx_v_ascending = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_2d_float64", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.rank_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_in_arr);
  __pyx_bstruct_ranks.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_argsorted.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":207
 * 
 *     cdef:
 *         Py_ssize_t i, j, z, k, n, dups = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t, ndim=2] ranks, values
 *         ndarray[int64_t, ndim=2] argsorted
 */
  __pyx_v_dups = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":211
 *         ndarray[int64_t, ndim=2] argsorted
 *         float64_t val, nan_value
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_sum_ranks = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":212
 *         float64_t val, nan_value
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_tiebreak = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":213
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     in_arr = np.asarray(in_arr)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (!__pyx_t_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":215
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     in_arr = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_in_arr);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr);
  __Pyx_GIVEREF(__pyx_v_in_arr);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_in_arr);
  __pyx_v_in_arr = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":217
 *     in_arr = np.asarray(in_arr)
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         values = in_arr.T.copy()
 *     else:
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":218
 * 
 *     if axis == 0:
 *         values = in_arr.T.copy()             # <<<<<<<<<<<<<<
 *     else:
 *         values = in_arr.copy()
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_in_arr, __pyx_n_s__T); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
      __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":220
 *         values = in_arr.T.copy()
 *     else:
 *         values = in_arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if ascending:
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_in_arr, __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
      __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":222
 *         values = in_arr.copy()
 * 
 *     if ascending:             # <<<<<<<<<<<<<<
 *         nan_value = np.inf
 *     else:
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":223
 * 
 *     if ascending:
 *         nan_value = np.inf             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = -np.inf
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__inf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_nan_value = __pyx_t_10;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":225
 *         nan_value = np.inf
 *     else:
 *         nan_value = -np.inf             # <<<<<<<<<<<<<<
 * 
 *     np.putmask(values, np.isnan(values), nan_value)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_nan_value = __pyx_t_10;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":227
 *         nan_value = -np.inf
 * 
 *     np.putmask(values, np.isnan(values), nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n, k = (<object> values).shape
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__putmask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__isnan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_nan_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_11 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":229
 *     np.putmask(values, np.isnan(values), nan_value)
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
    PyObject* sequence = __pyx_t_4;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L9_unpacking_done;
    __pyx_L8_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L9_unpacking_done:;
  }
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_13;
  __pyx_v_k = __pyx_t_14;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":230
 * 
 *     n, k = (<object> values).shape
 *     ranks = np.empty((n, k), dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     if tiebreak == TIEBREAK_FIRST:
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
  __pyx_t_11 = 0;
  __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_ranks = __pyx_bstruct_ranks.strides[0]; __pyx_bstride_1_ranks = __pyx_bstruct_ranks.strides[1];
    __pyx_bshape_0_ranks = __pyx_bstruct_ranks.shape[0]; __pyx_bshape_1_ranks = __pyx_bstruct_ranks.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":232
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 *     if tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *         # need to use a stable sort here
 *         _as = values.argsort(axis=1, kind='mergesort')
 */
  __pyx_t_5 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":234
 *     if tiebreak == TIEBREAK_FIRST:
 *         # need to use a stable sort here
 *         _as = values.argsort(axis=1, kind='mergesort')             # <<<<<<<<<<<<<<
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_11));
    if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__axis), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__kind), ((PyObject *)__pyx_n_s__mergesort)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
    __pyx_v__as = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":235
 *         # need to use a stable sort here
 *         _as = values.argsort(axis=1, kind='mergesort')
 *         if not ascending:             # <<<<<<<<<<<<<<
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 */
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = (!__pyx_t_5);
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":236
 *         _as = values.argsort(axis=1, kind='mergesort')
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING             # <<<<<<<<<<<<<<
 *     else:
 *         _as = values.argsort(1)
 */
      __pyx_v_tiebreak = __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING;
      goto __pyx_L11;
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":238
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v__as = __pyx_t_11;
    __pyx_t_11 = 0;
  }
  __pyx_L10:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":240
 *         _as = values.argsort(1)
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[:, ::-1]
 * 
 */
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = (!__pyx_t_15);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":241
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_float64(values, _as)
 */
    __pyx_t_11 = PyObject_GetItem(__pyx_v__as, ((PyObject *)__pyx_k_tuple_129)); if (!__pyx_t_11) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_v__as);
    __pyx_v__as = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":243
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_float64(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_11 = __pyx_f_6pandas_3lib__take_2d_float64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
    __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_values));
  __pyx_v_values = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":244
 * 
 *     values = _take_2d_float64(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_11 = PyObject_GetAttr(__pyx_v__as, __pyx_n_s__astype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_argsorted = __pyx_bstruct_argsorted.strides[0]; __pyx_bstride_1_argsorted = __pyx_bstruct_argsorted.strides[1];
    __pyx_bshape_0_argsorted = __pyx_bstruct_argsorted.shape[0]; __pyx_bshape_1_argsorted = __pyx_bstruct_argsorted.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":246
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         dups = sum_ranks = 0
 *         for j in range(k):
 */
  __pyx_t_14 = __pyx_v_n;
  for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) {
    __pyx_v_i = __pyx_t_13;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":247
 * 
 *     for i in range(n):
 *         dups = sum_ranks = 0             # <<<<<<<<<<<<<<
 *         for j in range(k):
 *             sum_ranks += j + 1
 */
    __pyx_v_dups = 0;
    __pyx_v_sum_ranks = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":248
 *     for i in range(n):
 *         dups = sum_ranks = 0
 *         for j in range(k):             # <<<<<<<<<<<<<<
 *             sum_ranks += j + 1
 *             dups += 1
 */
    __pyx_t_17 = __pyx_v_k;
    for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
      __pyx_v_j = __pyx_t_18;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":249
 *         dups = sum_ranks = 0
 *         for j in range(k):
 *             sum_ranks += j + 1             # <<<<<<<<<<<<<<
 *             dups += 1
 *             val = values[i, j]
 */
      __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_j + 1));

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":250
 *         for j in range(k):
 *             sum_ranks += j + 1
 *             dups += 1             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 *             if val == nan_value:
 */
      __pyx_v_dups = (__pyx_v_dups + 1);

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":251
 *             sum_ranks += j + 1
 *             dups += 1
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 *             if val == nan_value:
 *                 ranks[i, argsorted[i, j]] = nan
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_values)) __pyx_t_3 = 0;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_1_values;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 1;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_1_values)) __pyx_t_3 = 1;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_19, __pyx_bstride_0_values, __pyx_t_20, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":252
 *             dups += 1
 *             val = values[i, j]
 *             if val == nan_value:             # <<<<<<<<<<<<<<
 *                 ranks[i, argsorted[i, j]] = nan
 *                 continue
 */
      __pyx_t_5 = (__pyx_v_val == __pyx_v_nan_value);
      if (__pyx_t_5) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":253
 *             val = values[i, j]
 *             if val == nan_value:
 *                 ranks[i, argsorted[i, j]] = nan             # <<<<<<<<<<<<<<
 *                 continue
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 */
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_22 = __pyx_v_j;
        __pyx_t_3 = -1;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_bshape_0_argsorted;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
        if (__pyx_t_22 < 0) {
          __pyx_t_22 += __pyx_bshape_1_argsorted;
          if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_22 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_24 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_21, __pyx_bstride_0_argsorted, __pyx_t_22, __pyx_bstride_1_argsorted));
        __pyx_t_3 = -1;
        if (__pyx_t_23 < 0) {
          __pyx_t_23 += __pyx_bshape_0_ranks;
          if (unlikely(__pyx_t_23 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
        if (__pyx_t_24 < 0) {
          __pyx_t_24 += __pyx_bshape_1_ranks;
          if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_24 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_23, __pyx_bstride_0_ranks, __pyx_t_24, __pyx_bstride_1_ranks) = __pyx_v_6pandas_3lib_nan;

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":254
 *             if val == nan_value:
 *                 ranks[i, argsorted[i, j]] = nan
 *                 continue             # <<<<<<<<<<<<<<
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 *                 if tiebreak == TIEBREAK_AVERAGE:
 */
        goto __pyx_L15_continue;
        goto __pyx_L17;
      }
      __pyx_L17:;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":255
 *                 ranks[i, argsorted[i, j]] = nan
 *                 continue
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:             # <<<<<<<<<<<<<<
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):
 */
      __pyx_t_5 = (__pyx_v_j == (__pyx_v_k - 1));
      if (!__pyx_t_5) {
        __pyx_t_25 = __pyx_v_i;
        __pyx_t_26 = (__pyx_v_j + 1);
        __pyx_t_3 = -1;
        if (__pyx_t_25 < 0) {
          __pyx_t_25 += __pyx_bshape_0_values;
          if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_values)) __pyx_t_3 = 0;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_bshape_1_values;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_26 >= __pyx_bshape_1_values)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[1]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_15 = (fabs(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_values.buf, __pyx_t_25, __pyx_bstride_0_values, __pyx_t_26, __pyx_bstride_1_values)) - __pyx_v_val)) > __pyx_v_6pandas_3lib_FP_ERR);
        __pyx_t_27 = __pyx_t_15;
      } else {
        __pyx_t_27 = __pyx_t_5;
      }
      if (__pyx_t_27) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":256
 *                 continue
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 *                 if tiebreak == TIEBREAK_AVERAGE:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 */
        __pyx_t_27 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_AVERAGE);
        if (__pyx_t_27) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":257
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:
 */
          __pyx_t_28 = (__pyx_v_j + 1);
          for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
            __pyx_v_z = __pyx_t_29;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":258
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):
 */
            if (unlikely(__pyx_v_dups == 0)) {
              PyErr_Format(PyExc_ZeroDivisionError, "float division");
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_30 = __pyx_v_i;
            __pyx_t_31 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_31 < 0) {
              __pyx_t_31 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_31 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_32 = __pyx_v_i;
            __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_30, __pyx_bstride_0_argsorted, __pyx_t_31, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_32 < 0) {
              __pyx_t_32 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_32 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_33 < 0) {
              __pyx_t_33 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_33 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_32, __pyx_bstride_0_ranks, __pyx_t_33, __pyx_bstride_1_ranks) = (__pyx_v_sum_ranks / __pyx_v_dups);
          }
          goto __pyx_L19;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":259
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 */
        __pyx_t_27 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MIN);
        if (__pyx_t_27) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":260
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:
 */
          __pyx_t_28 = (__pyx_v_j + 1);
          for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
            __pyx_v_z = __pyx_t_29;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":261
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):
 */
            __pyx_t_34 = __pyx_v_i;
            __pyx_t_35 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_34 < 0) {
              __pyx_t_34 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_34 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_35 < 0) {
              __pyx_t_35 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_35 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_36 = __pyx_v_i;
            __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_34, __pyx_bstride_0_argsorted, __pyx_t_35, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_36 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_37 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_36, __pyx_bstride_0_ranks, __pyx_t_37, __pyx_bstride_1_ranks) = ((__pyx_v_j - __pyx_v_dups) + 2);
          }
          goto __pyx_L19;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":262
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1
 */
        __pyx_t_27 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MAX);
        if (__pyx_t_27) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":263
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 */
          __pyx_t_28 = (__pyx_v_j + 1);
          for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
            __pyx_v_z = __pyx_t_29;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":264
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     for z in range(j - dups + 1, j + 1):
 */
            __pyx_t_38 = __pyx_v_i;
            __pyx_t_39 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_38 < 0) {
              __pyx_t_38 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_38 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_39 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_40 = __pyx_v_i;
            __pyx_t_41 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_38, __pyx_bstride_0_argsorted, __pyx_t_39, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_40 < 0) {
              __pyx_t_40 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_40 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_41 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_40, __pyx_bstride_0_ranks, __pyx_t_41, __pyx_bstride_1_ranks) = (__pyx_v_j + 1);
          }
          goto __pyx_L19;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":265
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = z + 1
 */
        __pyx_t_27 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
        if (__pyx_t_27) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":266
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = z + 1
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 */
          __pyx_t_28 = (__pyx_v_j + 1);
          for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
            __pyx_v_z = __pyx_t_29;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":267
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = z + 1             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                     for z in range(j - dups + 1, j + 1):
 */
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_43 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_42 < 0) {
              __pyx_t_42 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_42 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_43 < 0) {
              __pyx_t_43 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_43 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_44 = __pyx_v_i;
            __pyx_t_45 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_42, __pyx_bstride_0_argsorted, __pyx_t_43, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_44 < 0) {
              __pyx_t_44 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_44 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_45 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_44, __pyx_bstride_0_ranks, __pyx_t_45, __pyx_bstride_1_ranks) = (__pyx_v_z + 1);
          }
          goto __pyx_L19;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":268
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = z + 1
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 */
        __pyx_t_27 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING);
        if (__pyx_t_27) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":269
 *                         ranks[i, argsorted[i, z]] = z + 1
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 *                 sum_ranks = dups = 0
 */
          __pyx_t_28 = (__pyx_v_j + 1);
          for (__pyx_t_29 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
            __pyx_v_z = __pyx_t_29;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":270
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2             # <<<<<<<<<<<<<<
 *                 sum_ranks = dups = 0
 * 
 */
            __pyx_t_46 = __pyx_v_i;
            __pyx_t_47 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_46 < 0) {
              __pyx_t_46 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_46 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_47 < 0) {
              __pyx_t_47 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_47 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_48 = __pyx_v_i;
            __pyx_t_49 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_46, __pyx_bstride_0_argsorted, __pyx_t_47, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_48 < 0) {
              __pyx_t_48 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_48 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_48 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_49 < 0) {
              __pyx_t_49 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_49 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_49 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_48, __pyx_bstride_0_ranks, __pyx_t_49, __pyx_bstride_1_ranks) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2);
          }
          goto __pyx_L19;
        }
        __pyx_L19:;

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":271
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 *                 sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
        __pyx_v_sum_ranks = 0;
        __pyx_v_dups = 0;
        goto __pyx_L18;
      }
      __pyx_L18:;
      __pyx_L15_continue:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":273
 *                 sum_ranks = dups = 0
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         return ranks.T
 *     else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_27) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":274
 * 
 *     if axis == 0:
 *         return ranks.T             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_ranks), __pyx_n_s__T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L30;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":276
 *         return ranks.T
 *     else:
 *         return ranks             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
    __pyx_r = ((PyObject *)__pyx_v_ranks);
    goto __pyx_L0;
  }
  __pyx_L30:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.rank_2d_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ranks);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_argsorted);
  __Pyx_XDECREF(__pyx_v__as);
  __Pyx_XDECREF(__pyx_v_in_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":279
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True):
 *     """
 */

static PyObject *__pyx_pf_6pandas_3lib_122rank_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_122rank_2d_int64[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_122rank_2d_int64 = {__Pyx_NAMESTR("rank_2d_int64"), (PyCFunction)__pyx_pf_6pandas_3lib_122rank_2d_int64, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_122rank_2d_int64)};
static PyObject *__pyx_pf_6pandas_3lib_122rank_2d_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_arr = 0;
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_v_ties_method = 0;
  PyObject *__pyx_v_ascending = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_z;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_dups;
  PyArrayObject *__pyx_v_ranks = 0;
  PyArrayObject *__pyx_v_argsorted = 0;
  PyArrayObject *__pyx_v_values = 0;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  __pyx_t_5numpy_float64_t __pyx_v_sum_ranks;
  int __pyx_v_tiebreak;
  PyObject *__pyx_v__as = NULL;
  Py_buffer __pyx_bstruct_ranks;
  Py_ssize_t __pyx_bstride_0_ranks = 0;
  Py_ssize_t __pyx_bstride_1_ranks = 0;
  Py_ssize_t __pyx_bshape_0_ranks = 0;
  Py_ssize_t __pyx_bshape_1_ranks = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_argsorted;
  Py_ssize_t __pyx_bstride_0_argsorted = 0;
  Py_ssize_t __pyx_bstride_1_argsorted = 0;
  Py_ssize_t __pyx_bshape_0_argsorted = 0;
  Py_ssize_t __pyx_bshape_1_argsorted = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyArrayObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyArrayObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  int __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  __pyx_t_5numpy_int64_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  __pyx_t_5numpy_int64_t __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  __pyx_t_5numpy_int64_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  Py_ssize_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  __pyx_t_5numpy_int64_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  Py_ssize_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  __pyx_t_5numpy_int64_t __pyx_t_45;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in_arr,&__pyx_n_s__axis,&__pyx_n_s__ties_method,&__pyx_n_s__ascending,0};
  __Pyx_RefNannySetupContext("rank_2d_int64");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_n_s__average);
    values[3] = __pyx_k_131;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in_arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axis);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ties_method);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascending);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "rank_2d_int64") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_in_arr = values[0];
    __pyx_v_axis = values[1];
    __pyx_v_ties_method = values[2];
    __pyx_v_ascending = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_2d_int64", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.rank_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_ranks.buf = NULL;
  __pyx_bstruct_argsorted.buf = NULL;
  __pyx_bstruct_values.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":286
 * 
 *     cdef:
 *         Py_ssize_t i, j, z, k, n, dups = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t, ndim=2] ranks
 *         ndarray[int64_t, ndim=2] argsorted
 */
  __pyx_v_dups = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":291
 *         ndarray[int64_t, ndim=2, cast=True] values
 *         int64_t val
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_sum_ranks = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":292
 *         int64_t val
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_tiebreak = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":293
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (!__pyx_t_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":295
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         values = np.asarray(in_arr).T
 *     else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":296
 * 
 *     if axis == 0:
 *         values = np.asarray(in_arr).T             # <<<<<<<<<<<<<<
 *     else:
 *         values = np.asarray(in_arr)
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_in_arr);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr);
    __Pyx_GIVEREF(__pyx_v_in_arr);
    __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
      __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":298
 *         values = np.asarray(in_arr).T
 *     else:
 *         values = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     n, k = (<object> values).shape
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_in_arr);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr);
    __Pyx_GIVEREF(__pyx_v_in_arr);
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
      __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":300
 *         values = np.asarray(in_arr)
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_n = __pyx_t_12;
  __pyx_v_k = __pyx_t_13;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":301
 * 
 *     n, k = (<object> values).shape
 *     ranks = np.empty((n, k), dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     if tiebreak == TIEBREAK_FIRST:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_10));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
  __pyx_t_10 = 0;
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_ranks = __pyx_bstruct_ranks.strides[0]; __pyx_bstride_1_ranks = __pyx_bstruct_ranks.strides[1];
    __pyx_bshape_0_ranks = __pyx_bstruct_ranks.shape[0]; __pyx_bshape_1_ranks = __pyx_bstruct_ranks.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":303
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 *     if tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *         # need to use a stable sort here
 *         _as = values.argsort(axis=1, kind='mergesort')
 */
  __pyx_t_4 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":305
 *     if tiebreak == TIEBREAK_FIRST:
 *         # need to use a stable sort here
 *         _as = values.argsort(axis=1, kind='mergesort')             # <<<<<<<<<<<<<<
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_10));
    if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__axis), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__kind), ((PyObject *)__pyx_n_s__mergesort)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    __pyx_v__as = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":306
 *         # need to use a stable sort here
 *         _as = values.argsort(axis=1, kind='mergesort')
 *         if not ascending:             # <<<<<<<<<<<<<<
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = (!__pyx_t_4);
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":307
 *         _as = values.argsort(axis=1, kind='mergesort')
 *         if not ascending:
 *             tiebreak = TIEBREAK_FIRST_DESCENDING             # <<<<<<<<<<<<<<
 *     else:
 *         _as = values.argsort(1)
 */
      __pyx_v_tiebreak = __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING;
      goto __pyx_L10;
    }
    __pyx_L10:;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":309
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_132), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v__as = __pyx_t_10;
    __pyx_t_10 = 0;
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":311
 *         _as = values.argsort(1)
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[:, ::-1]
 * 
 */
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (!__pyx_t_15);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":312
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_int64(values, _as)
 */
    __pyx_t_10 = PyObject_GetItem(__pyx_v__as, ((PyObject *)__pyx_k_tuple_135)); if (!__pyx_t_10) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_v__as);
    __pyx_v__as = __pyx_t_10;
    __pyx_t_10 = 0;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":314
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_int64(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_10 = __pyx_f_6pandas_3lib__take_2d_int64(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_10);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
    __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_values));
  __pyx_v_values = ((PyArrayObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":315
 * 
 *     values = _take_2d_int64(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_10 = PyObject_GetAttr(__pyx_v__as, __pyx_n_s__astype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_136), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_argsorted = __pyx_bstruct_argsorted.strides[0]; __pyx_bstride_1_argsorted = __pyx_bstruct_argsorted.strides[1];
    __pyx_bshape_0_argsorted = __pyx_bstruct_argsorted.shape[0]; __pyx_bshape_1_argsorted = __pyx_bstruct_argsorted.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":317
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         dups = sum_ranks = 0
 *         for j in range(k):
 */
  __pyx_t_13 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":318
 * 
 *     for i in range(n):
 *         dups = sum_ranks = 0             # <<<<<<<<<<<<<<
 *         for j in range(k):
 *             sum_ranks += j + 1
 */
    __pyx_v_dups = 0;
    __pyx_v_sum_ranks = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":319
 *     for i in range(n):
 *         dups = sum_ranks = 0
 *         for j in range(k):             # <<<<<<<<<<<<<<
 *             sum_ranks += j + 1
 *             dups += 1
 */
    __pyx_t_17 = __pyx_v_k;
    for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
      __pyx_v_j = __pyx_t_18;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":320
 *         dups = sum_ranks = 0
 *         for j in range(k):
 *             sum_ranks += j + 1             # <<<<<<<<<<<<<<
 *             dups += 1
 *             val = values[i, j]
 */
      __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_j + 1));

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":321
 *         for j in range(k):
 *             sum_ranks += j + 1
 *             dups += 1             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 */
      __pyx_v_dups = (__pyx_v_dups + 1);

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":322
 *             sum_ranks += j + 1
 *             dups += 1
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 *                 if tiebreak == TIEBREAK_AVERAGE:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_20 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_values)) __pyx_t_3 = 0;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_1_values;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 1;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_1_values)) __pyx_t_3 = 1;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_val = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_19, __pyx_bstride_0_values, __pyx_t_20, __pyx_bstride_1_values));

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":323
 *             dups += 1
 *             val = values[i, j]
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:             # <<<<<<<<<<<<<<
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):
 */
      __pyx_t_4 = (__pyx_v_j == (__pyx_v_k - 1));
      if (!__pyx_t_4) {
        __pyx_t_21 = __pyx_v_i;
        __pyx_t_22 = (__pyx_v_j + 1);
        __pyx_t_3 = -1;
        if (__pyx_t_21 < 0) {
          __pyx_t_21 += __pyx_bshape_0_values;
          if (unlikely(__pyx_t_21 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_values)) __pyx_t_3 = 0;
        if (__pyx_t_22 < 0) {
          __pyx_t_22 += __pyx_bshape_1_values;
          if (unlikely(__pyx_t_22 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_22 >= __pyx_bshape_1_values)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_15 = (fabs(((*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_21, __pyx_bstride_0_values, __pyx_t_22, __pyx_bstride_1_values)) - __pyx_v_val)) > __pyx_v_6pandas_3lib_FP_ERR);
        __pyx_t_23 = __pyx_t_15;
      } else {
        __pyx_t_23 = __pyx_t_4;
      }
      if (__pyx_t_23) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":324
 *             val = values[i, j]
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 *                 if tiebreak == TIEBREAK_AVERAGE:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 */
        __pyx_t_23 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_AVERAGE);
        if (__pyx_t_23) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":325
 *             if j == k - 1 or fabs(values[i, j + 1] - val) > FP_ERR:
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:
 */
          __pyx_t_24 = (__pyx_v_j + 1);
          for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
            __pyx_v_z = __pyx_t_25;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":326
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):
 */
            if (unlikely(__pyx_v_dups == 0)) {
              PyErr_Format(PyExc_ZeroDivisionError, "float division");
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_26 = __pyx_v_i;
            __pyx_t_27 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_26 < 0) {
              __pyx_t_26 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_27 < 0) {
              __pyx_t_27 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_27 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_28 = __pyx_v_i;
            __pyx_t_29 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_26, __pyx_bstride_0_argsorted, __pyx_t_27, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_28 < 0) {
              __pyx_t_28 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_29 < 0) {
              __pyx_t_29 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_29 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_28, __pyx_bstride_0_ranks, __pyx_t_29, __pyx_bstride_1_ranks) = (__pyx_v_sum_ranks / __pyx_v_dups);
          }
          goto __pyx_L17;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":327
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 */
        __pyx_t_23 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MIN);
        if (__pyx_t_23) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":328
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:
 */
          __pyx_t_24 = (__pyx_v_j + 1);
          for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
            __pyx_v_z = __pyx_t_25;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":329
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):
 */
            __pyx_t_30 = __pyx_v_i;
            __pyx_t_31 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_30 < 0) {
              __pyx_t_30 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_30 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_31 < 0) {
              __pyx_t_31 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_31 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_32 = __pyx_v_i;
            __pyx_t_33 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_30, __pyx_bstride_0_argsorted, __pyx_t_31, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_32 < 0) {
              __pyx_t_32 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_32 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_33 < 0) {
              __pyx_t_33 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_33 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_33 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_32, __pyx_bstride_0_ranks, __pyx_t_33, __pyx_bstride_1_ranks) = ((__pyx_v_j - __pyx_v_dups) + 2);
          }
          goto __pyx_L17;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":330
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1
 */
        __pyx_t_23 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MAX);
        if (__pyx_t_23) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":331
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 */
          __pyx_t_24 = (__pyx_v_j + 1);
          for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
            __pyx_v_z = __pyx_t_25;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":332
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     for z in range(j - dups + 1, j + 1):
 */
            __pyx_t_34 = __pyx_v_i;
            __pyx_t_35 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_34 < 0) {
              __pyx_t_34 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_34 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_34 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_35 < 0) {
              __pyx_t_35 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_35 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_35 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_36 = __pyx_v_i;
            __pyx_t_37 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_34, __pyx_bstride_0_argsorted, __pyx_t_35, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_36 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_37 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_36, __pyx_bstride_0_ranks, __pyx_t_37, __pyx_bstride_1_ranks) = (__pyx_v_j + 1);
          }
          goto __pyx_L17;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":333
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = z + 1
 */
        __pyx_t_23 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
        if (__pyx_t_23) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":334
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = z + 1
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 */
          __pyx_t_24 = (__pyx_v_j + 1);
          for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
            __pyx_v_z = __pyx_t_25;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":335
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = z + 1             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                     for z in range(j - dups + 1, j + 1):
 */
            __pyx_t_38 = __pyx_v_i;
            __pyx_t_39 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_38 < 0) {
              __pyx_t_38 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_38 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_39 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_40 = __pyx_v_i;
            __pyx_t_41 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_38, __pyx_bstride_0_argsorted, __pyx_t_39, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_40 < 0) {
              __pyx_t_40 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_40 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_41 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_40, __pyx_bstride_0_ranks, __pyx_t_41, __pyx_bstride_1_ranks) = (__pyx_v_z + 1);
          }
          goto __pyx_L17;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":336
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = z + 1
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 */
        __pyx_t_23 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING);
        if (__pyx_t_23) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":337
 *                         ranks[i, argsorted[i, z]] = z + 1
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 *                 sum_ranks = dups = 0
 */
          __pyx_t_24 = (__pyx_v_j + 1);
          for (__pyx_t_25 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
            __pyx_v_z = __pyx_t_25;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":338
 *                 elif tiebreak == TIEBREAK_FIRST_DESCENDING:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2             # <<<<<<<<<<<<<<
 *                 sum_ranks = dups = 0
 * 
 */
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_43 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_42 < 0) {
              __pyx_t_42 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_42 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_43 < 0) {
              __pyx_t_43 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_43 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_44 = __pyx_v_i;
            __pyx_t_45 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_42, __pyx_bstride_0_argsorted, __pyx_t_43, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_44 < 0) {
              __pyx_t_44 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_44 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_45 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_44, __pyx_bstride_0_ranks, __pyx_t_45, __pyx_bstride_1_ranks) = ((((2 * __pyx_v_j) - __pyx_v_z) - __pyx_v_dups) + 2);
          }
          goto __pyx_L17;
        }
        __pyx_L17:;

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":339
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = 2 * j - z - dups + 2
 *                 sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
        __pyx_v_sum_ranks = 0;
        __pyx_v_dups = 0;
        goto __pyx_L16;
      }
      __pyx_L16:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":341
 *                 sum_ranks = dups = 0
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         return ranks.T
 *     else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_23 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_23) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":342
 * 
 *     if axis == 0:
 *         return ranks.T             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_ranks), __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L28;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":344
 *         return ranks.T
 *     else:
 *         return ranks             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
    __pyx_r = ((PyObject *)__pyx_v_ranks);
    goto __pyx_L0;
  }
  __pyx_L28:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.rank_2d_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ranks);
  __Pyx_XDECREF((PyObject *)__pyx_v_argsorted);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF(__pyx_v__as);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":347
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True):
 *     """
 */

static PyObject *__pyx_pf_6pandas_3lib_123rank_1d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_123rank_1d_generic[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_123rank_1d_generic = {__Pyx_NAMESTR("rank_1d_generic"), (PyCFunction)__pyx_pf_6pandas_3lib_123rank_1d_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_123rank_1d_generic)};
static PyObject *__pyx_pf_6pandas_3lib_123rank_1d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_arr = 0;
  int __pyx_v_retry;
  PyObject *__pyx_v_ties_method = 0;
  PyObject *__pyx_v_ascending = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_dups;
  PyArrayObject *__pyx_v_ranks = 0;
  PyArrayObject *__pyx_v_sorted_data = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_argsorted = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_nan_value = 0;
  __pyx_t_5numpy_float64_t __pyx_v_sum_ranks;
  int __pyx_v_tiebreak;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v__as = NULL;
  PyObject *__pyx_v_valid_locs = NULL;
  Py_buffer __pyx_bstruct_ranks;
  Py_ssize_t __pyx_bstride_0_ranks = 0;
  Py_ssize_t __pyx_bshape_0_ranks = 0;
  Py_buffer __pyx_bstruct_argsorted;
  Py_ssize_t __pyx_bstride_0_argsorted = 0;
  Py_ssize_t __pyx_bshape_0_argsorted = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyArrayObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  PyArrayObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  __pyx_t_5numpy_int64_t __pyx_t_20;
  int __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  __pyx_t_5numpy_int64_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  __pyx_t_5numpy_int64_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  __pyx_t_5numpy_int64_t __pyx_t_29;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in_arr,&__pyx_n_s__retry,&__pyx_n_s__ties_method,&__pyx_n_s__ascending,0};
  __Pyx_RefNannySetupContext("rank_1d_generic");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)__pyx_n_s__average);
    values[3] = __pyx_k_137;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in_arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__retry);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ties_method);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascending);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "rank_1d_generic") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_in_arr = values[0];
    if (values[1]) {
      __pyx_v_retry = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_retry == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_retry = ((int)1);
    }
    __pyx_v_ties_method = values[2];
    __pyx_v_ascending = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_1d_generic", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_ranks.buf = NULL;
  __pyx_bstruct_argsorted.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":354
 * 
 *     cdef:
 *         Py_ssize_t i, j, n, dups = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t] ranks
 *         ndarray sorted_data, values
 */
  __pyx_v_dups = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":359
 *         ndarray[int64_t] argsorted
 *         object val, nan_value
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_sum_ranks = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":360
 *         object val, nan_value
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_tiebreak = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":361
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     values = np.array(in_arr, copy=True)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (!__pyx_t_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":363
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     values = np.array(in_arr, copy=True)             # <<<<<<<<<<<<<<
 * 
 *     if values.dtype != np.object_:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_in_arr);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr);
  __Pyx_GIVEREF(__pyx_v_in_arr);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_5 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__copy), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":365
 *     values = np.array(in_arr, copy=True)
 * 
 *     if values.dtype != np.object_:             # <<<<<<<<<<<<<<
 *         values = values.astype('O')
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__object_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":366
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending:
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_values));
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":368
 *         values = values.astype('O')
 * 
 *     if ascending:             # <<<<<<<<<<<<<<
 *         # always greater than everything
 *         nan_value = Infinity()
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":370
 *     if ascending:
 *         # always greater than everything
 *         nan_value = Infinity()             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = NegInfinity()
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Infinity); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_nan_value = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":372
 *         nan_value = Infinity()
 *     else:
 *         nan_value = NegInfinity()             # <<<<<<<<<<<<<<
 * 
 *     mask = isnullobj(values)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__NegInfinity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_nan_value = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":374
 *         nan_value = NegInfinity()
 * 
 *     mask = isnullobj(values)             # <<<<<<<<<<<<<<
 *     np.putmask(values, mask, nan_value)
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__isnullobj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_mask = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":375
 * 
 *     mask = isnullobj(values)
 *     np.putmask(values, mask, nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __Pyx_INCREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_mask);
  __Pyx_GIVEREF(__pyx_v_mask);
  __Pyx_INCREF(__pyx_v_nan_value);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_nan_value);
  __Pyx_GIVEREF(__pyx_v_nan_value);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":377
 *     np.putmask(values, mask, nan_value)
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     ranks = np.empty(n, dtype='f8')
 * 
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":378
 * 
 *     n = len(values)
 *     ranks = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     # py2.5/win32 hack, can't pass i8
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_ranks = __pyx_bstruct_ranks.strides[0];
    __pyx_bshape_0_ranks = __pyx_bstruct_ranks.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":381
 * 
 *     # py2.5/win32 hack, can't pass i8
 *     try:             # <<<<<<<<<<<<<<
 *         _as = values.argsort()
 *     except TypeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":382
 *     # py2.5/win32 hack, can't pass i8
 *     try:
 *         _as = values.argsort()             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         if not retry:
 */
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v__as = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L15_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":383
 *     try:
 *         _as = values.argsort()
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         if not retry:
 *             raise
 */
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("pandas.lib.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":384
 *         _as = values.argsort()
 *     except TypeError:
 *         if not retry:             # <<<<<<<<<<<<<<
 *             raise
 * 
 */
      __pyx_t_6 = (!__pyx_v_retry);
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":385
 *     except TypeError:
 *         if not retry:
 *             raise             # <<<<<<<<<<<<<<
 * 
 *         valid_locs = (-mask).nonzero()[0]
 */
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_ErrRestore(__pyx_t_2, __pyx_t_1, __pyx_t_4);
        __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; 
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        goto __pyx_L18;
      }
      __pyx_L18:;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":387
 *             raise
 * 
 *         valid_locs = (-mask).nonzero()[0]             # <<<<<<<<<<<<<<
 *         ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0,
 *                                               ties_method=ties_method,
 */
      __pyx_t_5 = PyNumber_Negative(__pyx_v_mask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_12 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__nonzero); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_valid_locs = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":388
 * 
 *         valid_locs = (-mask).nonzero()[0]
 *         ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0,             # <<<<<<<<<<<<<<
 *                                               ties_method=ties_method,
 *                                               ascending=ascending))
 */
      __pyx_t_12 = PyObject_GetAttr(((PyObject *)__pyx_v_ranks), __pyx_n_s__put); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__rank_1d_generic); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__take); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      __Pyx_INCREF(__pyx_v_valid_locs);
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_valid_locs);
      __Pyx_GIVEREF(__pyx_v_valid_locs);
      __pyx_t_15 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_14));
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      __pyx_t_15 = 0;
      __pyx_t_15 = PyDict_New(); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_15));

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":389
 *         valid_locs = (-mask).nonzero()[0]
 *         ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0,
 *                                               ties_method=ties_method,             # <<<<<<<<<<<<<<
 *                                               ascending=ascending))
 *         np.putmask(ranks, mask, np.nan)
 */
      if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__ties_method), __pyx_v_ties_method) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":390
 *         ranks.put(valid_locs, rank_1d_generic(values.take(valid_locs), 0,
 *                                               ties_method=ties_method,
 *                                               ascending=ascending))             # <<<<<<<<<<<<<<
 *         np.putmask(ranks, mask, np.nan)
 *         return ranks
 */
      if (PyDict_SetItem(__pyx_t_15, ((PyObject *)__pyx_n_s__ascending), __pyx_v_ascending) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __pyx_t_13 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_14), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
      __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_15));
      __Pyx_INCREF(__pyx_v_valid_locs);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_valid_locs);
      __Pyx_GIVEREF(__pyx_v_valid_locs);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_13 = 0;
      __pyx_t_13 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":391
 *                                               ties_method=ties_method,
 *                                               ascending=ascending))
 *         np.putmask(ranks, mask, np.nan)             # <<<<<<<<<<<<<<
 *         return ranks
 * 
 */
      __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_15 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__putmask); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__nan); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_13));
      __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
      PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_ranks));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_ranks));
      __Pyx_INCREF(__pyx_v_mask);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_mask);
      __Pyx_GIVEREF(__pyx_v_mask);
      PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":392
 *                                               ascending=ascending))
 *         np.putmask(ranks, mask, np.nan)
 *         return ranks             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
      __pyx_r = ((PyObject *)__pyx_v_ranks);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L11_except_return;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L9_exception_handled;
    }
    __pyx_L10_except_error:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L11_except_return:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    goto __pyx_L0;
    __pyx_L9_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    __pyx_L15_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":394
 *         return ranks
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[::-1]
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_16 = (!__pyx_t_6);
  if (__pyx_t_16) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":395
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
    __pyx_t_4 = PyObject_GetItem(__pyx_v__as, __pyx_k_slice_139); if (!__pyx_t_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_v__as);
    __pyx_v__as = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L19;
  }
  __pyx_L19:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":397
 *         _as = _as[::-1]
 * 
 *     sorted_data = values.take(_as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v__as);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__as);
  __Pyx_GIVEREF(__pyx_v__as);
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_sorted_data = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":398
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v__as, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_argsorted = __pyx_bstruct_argsorted.strides[0];
    __pyx_bshape_0_argsorted = __pyx_bstruct_argsorted.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_17 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":400
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         sum_ranks += i + 1
 *         dups += 1
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_7; __pyx_t_18+=1) {
    __pyx_v_i = __pyx_t_18;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":401
 * 
 *     for i in range(n):
 *         sum_ranks += i + 1             # <<<<<<<<<<<<<<
 *         dups += 1
 *         val = util.get_value_at(sorted_data, i)
 */
    __pyx_v_sum_ranks = (__pyx_v_sum_ranks + (__pyx_v_i + 1));

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":402
 *     for i in range(n):
 *         sum_ranks += i + 1
 *         dups += 1             # <<<<<<<<<<<<<<
 *         val = util.get_value_at(sorted_data, i)
 *         if val is nan_value:
 */
    __pyx_v_dups = (__pyx_v_dups + 1);

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":403
 *         sum_ranks += i + 1
 *         dups += 1
 *         val = util.get_value_at(sorted_data, i)             # <<<<<<<<<<<<<<
 *         if val is nan_value:
 *             ranks[argsorted[i]] = nan
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_sorted_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":404
 *         dups += 1
 *         val = util.get_value_at(sorted_data, i)
 *         if val is nan_value:             # <<<<<<<<<<<<<<
 *             ranks[argsorted[i]] = nan
 *             continue
 */
    __pyx_t_16 = (__pyx_v_val == __pyx_v_nan_value);
    if (__pyx_t_16) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":405
 *         val = util.get_value_at(sorted_data, i)
 *         if val is nan_value:
 *             ranks[argsorted[i]] = nan             # <<<<<<<<<<<<<<
 *             continue
 *         if (i == n - 1 or
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_argsorted;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_19, __pyx_bstride_0_argsorted));
      __pyx_t_3 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_ranks;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_20, __pyx_bstride_0_ranks) = __pyx_v_6pandas_3lib_nan;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":406
 *         if val is nan_value:
 *             ranks[argsorted[i]] = nan
 *             continue             # <<<<<<<<<<<<<<
 *         if (i == n - 1 or
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):
 */
      goto __pyx_L20_continue;
      goto __pyx_L22;
    }
    __pyx_L22:;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":407
 *             ranks[argsorted[i]] = nan
 *             continue
 *         if (i == n - 1 or             # <<<<<<<<<<<<<<
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):
 *             if tiebreak == TIEBREAK_AVERAGE:
 */
    __pyx_t_16 = (__pyx_v_i == (__pyx_v_n - 1));
    if (!__pyx_t_16) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":408
 *             continue
 *         if (i == n - 1 or
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):             # <<<<<<<<<<<<<<
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 */
      __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_i + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __pyx_f_4util_get_value_at(__pyx_v_sorted_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_f_6pandas_3lib_are_diff(__pyx_t_1, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_21 = __pyx_t_6;
    } else {
      __pyx_t_21 = __pyx_t_16;
    }
    if (__pyx_t_21) {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":409
 *         if (i == n - 1 or
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):
 *             if tiebreak == TIEBREAK_AVERAGE:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups
 */
      __pyx_t_21 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_AVERAGE);
      if (__pyx_t_21) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":410
 *             are_diff(util.get_value_at(sorted_data, i + 1), val)):
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:
 */
        __pyx_t_22 = (__pyx_v_i + 1);
        for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
          __pyx_v_j = __pyx_t_23;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":411
 *             if tiebreak == TIEBREAK_AVERAGE:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):
 */
          if (unlikely(__pyx_v_dups == 0)) {
            PyErr_Format(PyExc_ZeroDivisionError, "float division");
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_24 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_24 < 0) {
            __pyx_t_24 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_24 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_25 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_24, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_25 < 0) {
            __pyx_t_25 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_25, __pyx_bstride_0_ranks) = (__pyx_v_sum_ranks / __pyx_v_dups);
        }
        goto __pyx_L24;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":412
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2
 */
      __pyx_t_21 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MIN);
      if (__pyx_t_21) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":413
 *                     ranks[argsorted[j]] = sum_ranks / dups
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:
 */
        __pyx_t_22 = (__pyx_v_i + 1);
        for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
          __pyx_v_j = __pyx_t_23;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":414
 *             elif tiebreak == TIEBREAK_MIN:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):
 */
          __pyx_t_26 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_26 < 0) {
            __pyx_t_26 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_27 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_26, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_27, __pyx_bstride_0_ranks) = ((__pyx_v_i - __pyx_v_dups) + 2);
        }
        goto __pyx_L24;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":415
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:             # <<<<<<<<<<<<<<
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1
 */
      __pyx_t_21 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MAX);
      if (__pyx_t_21) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":416
 *                     ranks[argsorted[j]] = i - dups + 2
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):             # <<<<<<<<<<<<<<
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 */
        __pyx_t_22 = (__pyx_v_i + 1);
        for (__pyx_t_23 = ((__pyx_v_i - __pyx_v_dups) + 1); __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
          __pyx_v_j = __pyx_t_23;

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":417
 *             elif tiebreak == TIEBREAK_MAX:
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1             # <<<<<<<<<<<<<<
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 raise ValueError('first not supported for non-numeric data')
 */
          __pyx_t_28 = __pyx_v_j;
          __pyx_t_3 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_bshape_0_argsorted;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_29 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_28, __pyx_bstride_0_argsorted));
          __pyx_t_3 = -1;
          if (__pyx_t_29 < 0) {
            __pyx_t_29 += __pyx_bshape_0_ranks;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
          } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
          if (unlikely(__pyx_t_3 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_3);
            {__pyx_filename = __pyx_f[1]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_29, __pyx_bstride_0_ranks) = (__pyx_v_i + 1);
        }
        goto __pyx_L24;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":418
 *                 for j in range(i - dups + 1, i + 1):
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *                 raise ValueError('first not supported for non-numeric data')
 *             sum_ranks = dups = 0
 */
      __pyx_t_21 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
      if (__pyx_t_21) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":419
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 raise ValueError('first not supported for non-numeric data')             # <<<<<<<<<<<<<<
 *             sum_ranks = dups = 0
 *     return ranks
 */
        __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L24;
      }
      __pyx_L24:;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":420
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 raise ValueError('first not supported for non-numeric data')
 *             sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 *     return ranks
 * 
 */
      __pyx_v_sum_ranks = 0;
      __pyx_v_dups = 0;
      goto __pyx_L23;
    }
    __pyx_L23:;
    __pyx_L20_continue:;
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":421
 *                 raise ValueError('first not supported for non-numeric data')
 *             sum_ranks = dups = 0
 *     return ranks             # <<<<<<<<<<<<<<
 * 
 * cdef inline are_diff(object left, object right):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
  __pyx_r = ((PyObject *)__pyx_v_ranks);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.rank_1d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ranks);
  __Pyx_XDECREF((PyObject *)__pyx_v_sorted_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_argsorted);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_nan_value);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v__as);
  __Pyx_XDECREF(__pyx_v_valid_locs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":423
 *     return ranks
 * 
 * cdef inline are_diff(object left, object right):             # <<<<<<<<<<<<<<
 *     try:
 *         return fabs(left - right) > FP_ERR
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_are_diff(PyObject *__pyx_v_left, PyObject *__pyx_v_right) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  double __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("are_diff");

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":424
 * 
 * cdef inline are_diff(object left, object right):
 *     try:             # <<<<<<<<<<<<<<
 *         return fabs(left - right) > FP_ERR
 *     except TypeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":425
 * cdef inline are_diff(object left, object right):
 *     try:
 *         return fabs(left - right) > FP_ERR             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         return left != right
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = PyNumber_Subtract(__pyx_v_left, __pyx_v_right); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyBool_FromLong((fabs(__pyx_t_5) > __pyx_v_6pandas_3lib_FP_ERR)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":426
 *     try:
 *         return fabs(left - right) > FP_ERR
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         return left != right
 * 
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("pandas.lib.are_diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":427
 *         return fabs(left - right) > FP_ERR
 *     except TypeError:
 *         return left != right             # <<<<<<<<<<<<<<
 * 
 * _return_false = lambda self, other: False
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_9 = PyObject_RichCompare(__pyx_v_left, __pyx_v_right, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_r = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pandas.lib.are_diff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/stats.pyx":452
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True):
 *     """
 */

static PyObject *__pyx_pf_6pandas_3lib_124rank_2d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_124rank_2d_generic[] = "\n    Fast NaN-friendly version of scipy.stats.rankdata\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_124rank_2d_generic = {__Pyx_NAMESTR("rank_2d_generic"), (PyCFunction)__pyx_pf_6pandas_3lib_124rank_2d_generic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_124rank_2d_generic)};
static PyObject *__pyx_pf_6pandas_3lib_124rank_2d_generic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_in_arr = 0;
  PyObject *__pyx_v_axis = 0;
  PyObject *__pyx_v_ties_method = 0;
  PyObject *__pyx_v_ascending = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_z;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_infs;
  Py_ssize_t __pyx_v_dups;
  PyArrayObject *__pyx_v_ranks = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyArrayObject *__pyx_v_argsorted = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_nan_value = 0;
  __pyx_t_5numpy_float64_t __pyx_v_sum_ranks;
  int __pyx_v_tiebreak;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v__as = NULL;
  Py_buffer __pyx_bstruct_ranks;
  Py_ssize_t __pyx_bstride_0_ranks = 0;
  Py_ssize_t __pyx_bstride_1_ranks = 0;
  Py_ssize_t __pyx_bshape_0_ranks = 0;
  Py_ssize_t __pyx_bshape_1_ranks = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bstride_1_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_ssize_t __pyx_bshape_1_values = 0;
  Py_buffer __pyx_bstruct_argsorted;
  Py_ssize_t __pyx_bstride_0_argsorted = 0;
  Py_ssize_t __pyx_bstride_1_argsorted = 0;
  Py_ssize_t __pyx_bshape_0_argsorted = 0;
  Py_ssize_t __pyx_bshape_1_argsorted = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyArrayObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyArrayObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  PyArrayObject *__pyx_t_22 = NULL;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  __pyx_t_5numpy_int64_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  int __pyx_t_33;
  Py_ssize_t __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  Py_ssize_t __pyx_t_37;
  Py_ssize_t __pyx_t_38;
  __pyx_t_5numpy_int64_t __pyx_t_39;
  Py_ssize_t __pyx_t_40;
  Py_ssize_t __pyx_t_41;
  Py_ssize_t __pyx_t_42;
  __pyx_t_5numpy_int64_t __pyx_t_43;
  Py_ssize_t __pyx_t_44;
  Py_ssize_t __pyx_t_45;
  Py_ssize_t __pyx_t_46;
  __pyx_t_5numpy_int64_t __pyx_t_47;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__in_arr,&__pyx_n_s__axis,&__pyx_n_s__ties_method,&__pyx_n_s__ascending,0};
  __Pyx_RefNannySetupContext("rank_2d_generic");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_n_s__average);
    values[3] = __pyx_k_143;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__in_arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axis);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ties_method);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ascending);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "rank_2d_generic") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_in_arr = values[0];
    __pyx_v_axis = values[1];
    __pyx_v_ties_method = values[2];
    __pyx_v_ascending = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rank_2d_generic", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_in_arr);
  __pyx_bstruct_ranks.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  __pyx_bstruct_argsorted.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":459
 * 
 *     cdef:
 *         Py_ssize_t i, j, z, k, n, infs, dups = 0             # <<<<<<<<<<<<<<
 *         ndarray[float64_t, ndim=2] ranks
 *         ndarray[object, ndim=2] values
 */
  __pyx_v_dups = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":464
 *         ndarray[int64_t, ndim=2] argsorted
 *         object val, nan_value
 *         float64_t sum_ranks = 0             # <<<<<<<<<<<<<<
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]
 */
  __pyx_v_sum_ranks = 0.0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":465
 *         object val, nan_value
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0             # <<<<<<<<<<<<<<
 *     tiebreak = tiebreakers[ties_method]
 * 
 */
  __pyx_v_tiebreak = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":466
 *         float64_t sum_ranks = 0
 *         int tiebreak = 0
 *     tiebreak = tiebreakers[ties_method]             # <<<<<<<<<<<<<<
 * 
 *     in_arr = np.asarray(in_arr)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__tiebreakers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_ties_method); if (!__pyx_t_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tiebreak = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":468
 *     tiebreak = tiebreakers[ties_method]
 * 
 *     in_arr = np.asarray(in_arr)             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_in_arr);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_in_arr);
  __Pyx_GIVEREF(__pyx_v_in_arr);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_in_arr);
  __pyx_v_in_arr = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":470
 *     in_arr = np.asarray(in_arr)
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         values = in_arr.T.copy()
 *     else:
 */
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":471
 * 
 *     if axis == 0:
 *         values = in_arr.T.copy()             # <<<<<<<<<<<<<<
 *     else:
 *         values = in_arr.copy()
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_in_arr, __pyx_n_s__T); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
      __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":473
 *         values = in_arr.T.copy()
 *     else:
 *         values = in_arr.copy()             # <<<<<<<<<<<<<<
 * 
 *     if values.dtype != np.object_:
 */
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_in_arr, __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
        }
      }
      __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
      __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":475
 *         values = in_arr.copy()
 * 
 *     if values.dtype != np.object_:             # <<<<<<<<<<<<<<
 *         values = values.astype('O')
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__object_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":476
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending:
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__astype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
      __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
      if (unlikely(__pyx_t_3 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
      __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
      if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_values));
    __pyx_v_values = ((PyArrayObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":478
 *         values = values.astype('O')
 * 
 *     if ascending:             # <<<<<<<<<<<<<<
 *         # always greater than everything
 *         nan_value = Infinity()
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":480
 *     if ascending:
 *         # always greater than everything
 *         nan_value = Infinity()             # <<<<<<<<<<<<<<
 *     else:
 *         nan_value = NegInfinity()
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Infinity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_nan_value = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":482
 *         nan_value = Infinity()
 *     else:
 *         nan_value = NegInfinity()             # <<<<<<<<<<<<<<
 * 
 *     mask = isnullobj2d(values)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__NegInfinity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_nan_value = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":484
 *         nan_value = NegInfinity()
 * 
 *     mask = isnullobj2d(values)             # <<<<<<<<<<<<<<
 *     np.putmask(values, mask, nan_value)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__isnullobj2d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_v_mask = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":485
 * 
 *     mask = isnullobj2d(values)
 *     np.putmask(values, mask, nan_value)             # <<<<<<<<<<<<<<
 * 
 *     n, k = (<object> values).shape
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__putmask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_values));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_values));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
  __Pyx_INCREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mask);
  __Pyx_GIVEREF(__pyx_v_mask);
  __Pyx_INCREF(__pyx_v_nan_value);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_nan_value);
  __Pyx_GIVEREF(__pyx_v_nan_value);
  __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":487
 *     np.putmask(values, mask, nan_value)
 * 
 *     n, k = (<object> values).shape             # <<<<<<<<<<<<<<
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L10_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_n = __pyx_t_12;
  __pyx_v_k = __pyx_t_13;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":488
 * 
 *     n, k = (<object> values).shape
 *     ranks = np.empty((n, k), dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_10));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
  __pyx_t_10 = 0;
  __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ranks, (PyObject*)__pyx_v_ranks, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_ranks = __pyx_bstruct_ranks.strides[0]; __pyx_bstride_1_ranks = __pyx_bstruct_ranks.strides[1];
    __pyx_bshape_0_ranks = __pyx_bstruct_ranks.shape[0]; __pyx_bshape_1_ranks = __pyx_bstruct_ranks.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_ranks = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":490
 *     ranks = np.empty((n, k), dtype='f8')
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         _as = values.argsort(1)
 *     except TypeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":491
 * 
 *     try:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         values = in_arr
 */
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__argsort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_145), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v__as = __pyx_t_10;
      __pyx_t_10 = 0;
    }
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L18_try_end;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":492
 *     try:
 *         _as = values.argsort(1)
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         values = in_arr
 *         for i in range(len(values)):
 */
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("pandas.lib.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":493
 *         _as = values.argsort(1)
 *     except TypeError:
 *         values = in_arr             # <<<<<<<<<<<<<<
 *         for i in range(len(values)):
 *             ranks[i] = rank_1d_generic(in_arr[i],
 */
      if (!(likely(((__pyx_v_in_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_in_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      __pyx_t_6 = ((PyArrayObject *)__pyx_v_in_arr);
      {
        __Pyx_BufFmt_StackElem __pyx_stack[1];
        __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
        __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
        if (unlikely(__pyx_t_3 < 0)) {
          PyErr_Fetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
            Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_17);
            __Pyx_RaiseBufferFallbackError();
          } else {
            PyErr_Restore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          }
        }
        __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
        __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
        if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      }
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_v_in_arr);
      __Pyx_DECREF(((PyObject *)__pyx_v_values));
      __pyx_v_values = ((PyArrayObject *)__pyx_v_in_arr);

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":494
 *     except TypeError:
 *         values = in_arr
 *         for i in range(len(values)):             # <<<<<<<<<<<<<<
 *             ranks[i] = rank_1d_generic(in_arr[i],
 *                                        ties_method=ties_method,
 */
      __pyx_t_13 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) {
        __pyx_v_i = __pyx_t_12;

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":495
 *         values = in_arr
 *         for i in range(len(values)):
 *             ranks[i] = rank_1d_generic(in_arr[i],             # <<<<<<<<<<<<<<
 *                                        ties_method=ties_method,
 *                                        ascending=ascending)
 */
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__rank_1d_generic); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_in_arr, __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_18) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
        __Pyx_GOTREF(__pyx_t_18);
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_19));
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18);
        __Pyx_GIVEREF(__pyx_t_18);
        __pyx_t_18 = 0;
        __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_18));

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":496
 *         for i in range(len(values)):
 *             ranks[i] = rank_1d_generic(in_arr[i],
 *                                        ties_method=ties_method,             # <<<<<<<<<<<<<<
 *                                        ascending=ascending)
 *         if axis == 0:
 */
        if (PyDict_SetItem(__pyx_t_18, ((PyObject *)__pyx_n_s__ties_method), __pyx_v_ties_method) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":497
 *             ranks[i] = rank_1d_generic(in_arr[i],
 *                                        ties_method=ties_method,
 *                                        ascending=ascending)             # <<<<<<<<<<<<<<
 *         if axis == 0:
 *             return ranks.T
 */
        if (PyDict_SetItem(__pyx_t_18, ((PyObject *)__pyx_n_s__ascending), __pyx_v_ascending) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
        __pyx_t_20 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_19), ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":495
 *         values = in_arr
 *         for i in range(len(values)):
 *             ranks[i] = rank_1d_generic(in_arr[i],             # <<<<<<<<<<<<<<
 *                                        ties_method=ties_method,
 *                                        ascending=ascending)
 */
        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_ranks), __pyx_v_i, __pyx_t_20, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":498
 *                                        ties_method=ties_method,
 *                                        ascending=ascending)
 *         if axis == 0:             # <<<<<<<<<<<<<<
 *             return ranks.T
 *         else:
 */
      __pyx_t_20 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (__pyx_t_5) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":499
 *                                        ascending=ascending)
 *         if axis == 0:
 *             return ranks.T             # <<<<<<<<<<<<<<
 *         else:
 *             return ranks
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_20 = PyObject_GetAttr(((PyObject *)__pyx_v_ranks), __pyx_n_s__T); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_r = __pyx_t_20;
        __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_except_return;
        goto __pyx_L23;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":501
 *             return ranks.T
 *         else:
 *             return ranks             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
        __pyx_r = ((PyObject *)__pyx_v_ranks);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L14_except_return;
      }
      __pyx_L23:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L12_exception_handled;
    }
    __pyx_L13_except_error:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L14_except_return:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    goto __pyx_L0;
    __pyx_L12_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
    __pyx_L18_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":503
 *             return ranks
 * 
 *     if not ascending:             # <<<<<<<<<<<<<<
 *         _as = _as[:, ::-1]
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ascending); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = (!__pyx_t_5);
  if (__pyx_t_21) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":504
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_object(values, _as)
 */
    __pyx_t_2 = PyObject_GetItem(__pyx_v__as, ((PyObject *)__pyx_k_tuple_148)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v__as);
    __pyx_v__as = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L24;
  }
  __pyx_L24:;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":506
 *         _as = _as[:, ::-1]
 * 
 *     values = _take_2d_object(values, _as)             # <<<<<<<<<<<<<<
 *     argsorted = _as.astype('i8')
 * 
 */
  __pyx_t_2 = __pyx_f_6pandas_3lib__take_2d_object(((PyArrayObject *)__pyx_v_values), __pyx_v__as); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_values = __pyx_bstruct_values.strides[0]; __pyx_bstride_1_values = __pyx_bstruct_values.strides[1];
    __pyx_bshape_0_values = __pyx_bstruct_values.shape[0]; __pyx_bshape_1_values = __pyx_bstruct_values.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_values));
  __pyx_v_values = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":507
 * 
 *     values = _take_2d_object(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v__as, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_22 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_argsorted, (PyObject*)__pyx_v_argsorted, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_argsorted = __pyx_bstruct_argsorted.strides[0]; __pyx_bstride_1_argsorted = __pyx_bstruct_argsorted.strides[1];
    __pyx_bshape_0_argsorted = __pyx_bstruct_argsorted.shape[0]; __pyx_bshape_1_argsorted = __pyx_bstruct_argsorted.shape[1];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_22 = 0;
  __pyx_v_argsorted = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":509
 *     argsorted = _as.astype('i8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         dups = sum_ranks = infs = 0
 *         for j in range(k):
 */
  __pyx_t_13 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":510
 * 
 *     for i in range(n):
 *         dups = sum_ranks = infs = 0             # <<<<<<<<<<<<<<
 *         for j in range(k):
 *             val = values[i, j]
 */
    __pyx_v_dups = 0;
    __pyx_v_sum_ranks = 0;
    __pyx_v_infs = 0;

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":511
 *     for i in range(n):
 *         dups = sum_ranks = infs = 0
 *         for j in range(k):             # <<<<<<<<<<<<<<
 *             val = values[i, j]
 *             if val is nan_value:
 */
    __pyx_t_23 = __pyx_v_k;
    for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
      __pyx_v_j = __pyx_t_24;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":512
 *         dups = sum_ranks = infs = 0
 *         for j in range(k):
 *             val = values[i, j]             # <<<<<<<<<<<<<<
 *             if val is nan_value:
 *                 ranks[i, argsorted[i, j]] = nan
 */
      __pyx_t_25 = __pyx_v_i;
      __pyx_t_26 = __pyx_v_j;
      __pyx_t_3 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_values)) __pyx_t_3 = 0;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_bshape_1_values;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_3 = 1;
      } else if (unlikely(__pyx_t_26 >= __pyx_bshape_1_values)) __pyx_t_3 = 1;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = *__Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_25, __pyx_bstride_0_values, __pyx_t_26, __pyx_bstride_1_values);
      __Pyx_INCREF((PyObject*)__pyx_t_1);
      __Pyx_XDECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":513
 *         for j in range(k):
 *             val = values[i, j]
 *             if val is nan_value:             # <<<<<<<<<<<<<<
 *                 ranks[i, argsorted[i, j]] = nan
 *                 infs += 1
 */
      __pyx_t_21 = (__pyx_v_val == __pyx_v_nan_value);
      if (__pyx_t_21) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":514
 *             val = values[i, j]
 *             if val is nan_value:
 *                 ranks[i, argsorted[i, j]] = nan             # <<<<<<<<<<<<<<
 *                 infs += 1
 *                 continue
 */
        __pyx_t_27 = __pyx_v_i;
        __pyx_t_28 = __pyx_v_j;
        __pyx_t_3 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_bshape_0_argsorted;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_bshape_1_argsorted;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_28 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_29 = __pyx_v_i;
        __pyx_t_30 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_27, __pyx_bstride_0_argsorted, __pyx_t_28, __pyx_bstride_1_argsorted));
        __pyx_t_3 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_bshape_0_ranks;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
        if (__pyx_t_30 < 0) {
          __pyx_t_30 += __pyx_bshape_1_ranks;
          if (unlikely(__pyx_t_30 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_30 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_29, __pyx_bstride_0_ranks, __pyx_t_30, __pyx_bstride_1_ranks) = __pyx_v_6pandas_3lib_nan;

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":515
 *             if val is nan_value:
 *                 ranks[i, argsorted[i, j]] = nan
 *                 infs += 1             # <<<<<<<<<<<<<<
 *                 continue
 *             sum_ranks += (j - infs) + 1
 */
        __pyx_v_infs = (__pyx_v_infs + 1);

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":516
 *                 ranks[i, argsorted[i, j]] = nan
 *                 infs += 1
 *                 continue             # <<<<<<<<<<<<<<
 *             sum_ranks += (j - infs) + 1
 *             dups += 1
 */
        goto __pyx_L27_continue;
        goto __pyx_L29;
      }
      __pyx_L29:;

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":517
 *                 infs += 1
 *                 continue
 *             sum_ranks += (j - infs) + 1             # <<<<<<<<<<<<<<
 *             dups += 1
 *             if j == k - 1 or are_diff(values[i, j + 1], val):
 */
      __pyx_v_sum_ranks = (__pyx_v_sum_ranks + ((__pyx_v_j - __pyx_v_infs) + 1));

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":518
 *                 continue
 *             sum_ranks += (j - infs) + 1
 *             dups += 1             # <<<<<<<<<<<<<<
 *             if j == k - 1 or are_diff(values[i, j + 1], val):
 *                 if tiebreak == TIEBREAK_AVERAGE:
 */
      __pyx_v_dups = (__pyx_v_dups + 1);

      /* "/home/wesm/code/pandas/pandas/src/stats.pyx":519
 *             sum_ranks += (j - infs) + 1
 *             dups += 1
 *             if j == k - 1 or are_diff(values[i, j + 1], val):             # <<<<<<<<<<<<<<
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):
 */
      __pyx_t_21 = (__pyx_v_j == (__pyx_v_k - 1));
      if (!__pyx_t_21) {
        __pyx_t_31 = __pyx_v_i;
        __pyx_t_32 = (__pyx_v_j + 1);
        __pyx_t_3 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_bshape_0_values;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_3 = 0;
        } else if (unlikely(__pyx_t_31 >= __pyx_bshape_0_values)) __pyx_t_3 = 0;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_bshape_1_values;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_3 = 1;
        } else if (unlikely(__pyx_t_32 >= __pyx_bshape_1_values)) __pyx_t_3 = 1;
        if (unlikely(__pyx_t_3 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_3);
          {__pyx_filename = __pyx_f[1]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_1 = *__Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_31, __pyx_bstride_0_values, __pyx_t_32, __pyx_bstride_1_values);
        __Pyx_INCREF((PyObject*)__pyx_t_1);
        __pyx_t_2 = __pyx_f_6pandas_3lib_are_diff(__pyx_t_1, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_33 = __pyx_t_5;
      } else {
        __pyx_t_33 = __pyx_t_21;
      }
      if (__pyx_t_33) {

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":520
 *             dups += 1
 *             if j == k - 1 or are_diff(values[i, j + 1], val):
 *                 if tiebreak == TIEBREAK_AVERAGE:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 */
        __pyx_t_33 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_AVERAGE);
        if (__pyx_t_33) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":521
 *             if j == k - 1 or are_diff(values[i, j + 1], val):
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:
 */
          __pyx_t_34 = (__pyx_v_j + 1);
          for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
            __pyx_v_z = __pyx_t_35;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":522
 *                 if tiebreak == TIEBREAK_AVERAGE:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):
 */
            if (unlikely(__pyx_v_dups == 0)) {
              PyErr_Format(PyExc_ZeroDivisionError, "float division");
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_36 = __pyx_v_i;
            __pyx_t_37 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_36 < 0) {
              __pyx_t_36 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_36 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_36 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_37 < 0) {
              __pyx_t_37 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_37 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_37 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_38 = __pyx_v_i;
            __pyx_t_39 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_36, __pyx_bstride_0_argsorted, __pyx_t_37, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_38 < 0) {
              __pyx_t_38 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_38 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_38 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_39 < 0) {
              __pyx_t_39 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_39 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_39 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_38, __pyx_bstride_0_ranks, __pyx_t_39, __pyx_bstride_1_ranks) = (__pyx_v_sum_ranks / __pyx_v_dups);
          }
          goto __pyx_L31;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":523
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 */
        __pyx_t_33 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MIN);
        if (__pyx_t_33) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":524
 *                         ranks[i, argsorted[i, z]] = sum_ranks / dups
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:
 */
          __pyx_t_34 = (__pyx_v_j + 1);
          for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
            __pyx_v_z = __pyx_t_35;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":525
 *                 elif tiebreak == TIEBREAK_MIN:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):
 */
            __pyx_t_40 = __pyx_v_i;
            __pyx_t_41 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_40 < 0) {
              __pyx_t_40 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_40 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_40 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_41 < 0) {
              __pyx_t_41 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_41 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_41 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_42 = __pyx_v_i;
            __pyx_t_43 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_40, __pyx_bstride_0_argsorted, __pyx_t_41, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_42 < 0) {
              __pyx_t_42 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_42 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_42 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_43 < 0) {
              __pyx_t_43 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_43 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_43 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_42, __pyx_bstride_0_ranks, __pyx_t_43, __pyx_bstride_1_ranks) = ((__pyx_v_j - __pyx_v_dups) + 2);
          }
          goto __pyx_L31;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":526
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:             # <<<<<<<<<<<<<<
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1
 */
        __pyx_t_33 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_MAX);
        if (__pyx_t_33) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":527
 *                         ranks[i, argsorted[i, z]] = j - dups + 2
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):             # <<<<<<<<<<<<<<
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 */
          __pyx_t_34 = (__pyx_v_j + 1);
          for (__pyx_t_35 = ((__pyx_v_j - __pyx_v_dups) + 1); __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
            __pyx_v_z = __pyx_t_35;

            /* "/home/wesm/code/pandas/pandas/src/stats.pyx":528
 *                 elif tiebreak == TIEBREAK_MAX:
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1             # <<<<<<<<<<<<<<
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     raise ValueError('first not supported for '
 */
            __pyx_t_44 = __pyx_v_i;
            __pyx_t_45 = __pyx_v_z;
            __pyx_t_3 = -1;
            if (__pyx_t_44 < 0) {
              __pyx_t_44 += __pyx_bshape_0_argsorted;
              if (unlikely(__pyx_t_44 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_44 >= __pyx_bshape_0_argsorted)) __pyx_t_3 = 0;
            if (__pyx_t_45 < 0) {
              __pyx_t_45 += __pyx_bshape_1_argsorted;
              if (unlikely(__pyx_t_45 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_45 >= __pyx_bshape_1_argsorted)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_46 = __pyx_v_i;
            __pyx_t_47 = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_argsorted.buf, __pyx_t_44, __pyx_bstride_0_argsorted, __pyx_t_45, __pyx_bstride_1_argsorted));
            __pyx_t_3 = -1;
            if (__pyx_t_46 < 0) {
              __pyx_t_46 += __pyx_bshape_0_ranks;
              if (unlikely(__pyx_t_46 < 0)) __pyx_t_3 = 0;
            } else if (unlikely(__pyx_t_46 >= __pyx_bshape_0_ranks)) __pyx_t_3 = 0;
            if (__pyx_t_47 < 0) {
              __pyx_t_47 += __pyx_bshape_1_ranks;
              if (unlikely(__pyx_t_47 < 0)) __pyx_t_3 = 1;
            } else if (unlikely(__pyx_t_47 >= __pyx_bshape_1_ranks)) __pyx_t_3 = 1;
            if (unlikely(__pyx_t_3 != -1)) {
              __Pyx_RaiseBufferIndexError(__pyx_t_3);
              {__pyx_filename = __pyx_f[1]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_ranks.buf, __pyx_t_46, __pyx_bstride_0_ranks, __pyx_t_47, __pyx_bstride_1_ranks) = (__pyx_v_j + 1);
          }
          goto __pyx_L31;
        }

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":529
 *                     for z in range(j - dups + 1, j + 1):
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:             # <<<<<<<<<<<<<<
 *                     raise ValueError('first not supported for '
 *                                      'non-numeric data')
 */
        __pyx_t_33 = (__pyx_v_tiebreak == __pyx_v_6pandas_3lib_TIEBREAK_FIRST);
        if (__pyx_t_33) {

          /* "/home/wesm/code/pandas/pandas/src/stats.pyx":530
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     raise ValueError('first not supported for '             # <<<<<<<<<<<<<<
 *                                      'non-numeric data')
 *                 sum_ranks = dups = 0
 */
          __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_Raise(__pyx_t_2, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          {__pyx_filename = __pyx_f[1]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L31;
        }
        __pyx_L31:;

        /* "/home/wesm/code/pandas/pandas/src/stats.pyx":532
 *                     raise ValueError('first not supported for '
 *                                      'non-numeric data')
 *                 sum_ranks = dups = 0             # <<<<<<<<<<<<<<
 * 
 *     if axis == 0:
 */
        __pyx_v_sum_ranks = 0;
        __pyx_v_dups = 0;
        goto __pyx_L30;
      }
      __pyx_L30:;
      __pyx_L27_continue:;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":534
 *                 sum_ranks = dups = 0
 * 
 *     if axis == 0:             # <<<<<<<<<<<<<<
 *         return ranks.T
 *     else:
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_axis, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_33 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_33 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_33) {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":535
 * 
 *     if axis == 0:
 *         return ranks.T             # <<<<<<<<<<<<<<
 *     else:
 *         return ranks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_ranks), __pyx_n_s__T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L38;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/stats.pyx":537
 *         return ranks.T
 *     else:
 *         return ranks             # <<<<<<<<<<<<<<
 * 
 * # def _take_indexer_2d(ndarray[float64_t, ndim=2] values,
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_ranks));
    __pyx_r = ((PyObject *)__pyx_v_ranks);
    goto __pyx_L0;
  }
  __pyx_L38:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.rank_2d_generic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ranks);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_argsorted);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ranks);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF((PyObject *)__pyx_v_argsorted);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_nan_value);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v__as);
  __Pyx_XDECREF(__pyx_v_in_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":8
 *         object fget, name
 * 
 *     def __init__(self, func):             # <<<<<<<<<<<<<<
 *         self.fget = func
 *         self.name = func.__name__
 */

static int __pyx_pf_6pandas_3lib_14cache_readonly___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_14cache_readonly___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_func = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__func,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_func = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.cache_readonly.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":9
 * 
 *     def __init__(self, func):
 *         self.fget = func             # <<<<<<<<<<<<<<
 *         self.name = func.__name__
 * 
 */
  __Pyx_INCREF(__pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->fget);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->fget);
  ((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->fget = __pyx_v_func;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":10
 *     def __init__(self, func):
 *         self.fget = func
 *         self.name = func.__name__             # <<<<<<<<<<<<<<
 * 
 *     def __get__(self, obj, type):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_func, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->name);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->name);
  ((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->name = __pyx_t_1;
  __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.cache_readonly.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":12
 *         self.name = func.__name__
 * 
 *     def __get__(self, obj, type):             # <<<<<<<<<<<<<<
 *         if obj is None:
 *             return self.fget
 */

static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type) {
  PyObject *__pyx_v_cache = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":13
 * 
 *     def __get__(self, obj, type):
 *         if obj is None:             # <<<<<<<<<<<<<<
 *             return self.fget
 * 
 */
  __pyx_t_1 = (__pyx_v_obj == Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":14
 *     def __get__(self, obj, type):
 *         if obj is None:
 *             return self.fget             # <<<<<<<<<<<<<<
 * 
 *         # Get the cache or set a default one if needed
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->fget);
    __pyx_r = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->fget;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":18
 *         # Get the cache or set a default one if needed
 * 
 *         cache = getattr(obj, '_cache', None)             # <<<<<<<<<<<<<<
 *         if cache is None:
 *             cache = obj._cache = {}
 */
  __pyx_t_2 = ((PyObject *)__pyx_n_s___cache);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = Py_None;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_cache = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":19
 * 
 *         cache = getattr(obj, '_cache', None)
 *         if cache is None:             # <<<<<<<<<<<<<<
 *             cache = obj._cache = {}
 * 
 */
  __pyx_t_1 = (__pyx_v_cache == Py_None);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":20
 *         cache = getattr(obj, '_cache', None)
 *         if cache is None:
 *             cache = obj._cache = {}             # <<<<<<<<<<<<<<
 * 
 *         if PyDict_Contains(cache, self.name):
 */
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_v_cache);
    __pyx_v_cache = ((PyObject *)__pyx_t_4);
    if (PyObject_SetAttr(__pyx_v_obj, __pyx_n_s___cache, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":22
 *             cache = obj._cache = {}
 * 
 *         if PyDict_Contains(cache, self.name):             # <<<<<<<<<<<<<<
 *             # not necessary to Py_INCREF
 *             val = <object> PyDict_GetItem(cache, self.name)
 */
  __pyx_t_4 = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->name;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = PyDict_Contains(__pyx_v_cache, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":24
 *         if PyDict_Contains(cache, self.name):
 *             # not necessary to Py_INCREF
 *             val = <object> PyDict_GetItem(cache, self.name)             # <<<<<<<<<<<<<<
 *             return val
 *         else:
 */
    __pyx_t_4 = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->name;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = PyDict_GetItem(__pyx_v_cache, __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_INCREF(((PyObject *)__pyx_t_6));
    __pyx_v_val = ((PyObject *)__pyx_t_6);

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":25
 *             # not necessary to Py_INCREF
 *             val = <object> PyDict_GetItem(cache, self.name)
 *             return val             # <<<<<<<<<<<<<<
 *         else:
 *             val = self.fget(obj)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_val);
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":27
 *             return val
 *         else:
 *             val = self.fget(obj)             # <<<<<<<<<<<<<<
 *             PyDict_SetItem(cache, self.name, val)
 *             return val
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_obj);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_obj);
    __Pyx_GIVEREF(__pyx_v_obj);
    __pyx_t_3 = PyObject_Call(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->fget, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_val = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":28
 *         else:
 *             val = self.fget(obj)
 *             PyDict_SetItem(cache, self.name, val)             # <<<<<<<<<<<<<<
 *             return val
 * 
 */
    __pyx_t_3 = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->name;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_5 = PyDict_SetItem(__pyx_v_cache, __pyx_t_3, __pyx_v_val); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":29
 *             val = self.fget(obj)
 *             PyDict_SetItem(cache, self.name, val)
 *             return val             # <<<<<<<<<<<<<<
 * 
 * cdef class AxisProperty(object):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_val);
    __pyx_r = __pyx_v_val;
    goto __pyx_L0;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.cache_readonly.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cache);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":6
 * 
 *     cdef readonly:
 *         object fget, name             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, func):
 */

static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4fget___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4fget___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->fget);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->fget;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->name);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)__pyx_v_self)->name;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":35
 *         Py_ssize_t axis
 * 
 *     def __init__(self, axis=0):             # <<<<<<<<<<<<<<
 *         self.axis = axis
 * 
 */

static int __pyx_pf_6pandas_3lib_12AxisProperty___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_12AxisProperty___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_axis = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__axis,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axis);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_axis = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[6]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.AxisProperty.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":36
 * 
 *     def __init__(self, axis=0):
 *         self.axis = axis             # <<<<<<<<<<<<<<
 * 
 *     def __get__(self, obj, type):
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_axis); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self)->axis = __pyx_t_1;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.AxisProperty.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":38
 *         self.axis = axis
 * 
 *     def __get__(self, obj, type):             # <<<<<<<<<<<<<<
 *         cdef list axes = obj._data.axes
 *         return axes[self.axis]
 */

static PyObject *__pyx_pf_6pandas_3lib_12AxisProperty_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_12AxisProperty_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type) {
  PyObject *__pyx_v_axes = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":39
 * 
 *     def __get__(self, obj, type):
 *         cdef list axes = obj._data.axes             # <<<<<<<<<<<<<<
 *         return axes[self.axis]
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s___data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__axes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_axes = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":40
 *     def __get__(self, obj, type):
 *         cdef list axes = obj._data.axes
 *         return axes[self.axis]             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, obj, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_axes), ((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self)->axis, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.AxisProperty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_axes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":42
 *         return axes[self.axis]
 * 
 *     def __set__(self, obj, value):             # <<<<<<<<<<<<<<
 *         obj._set_axis(self.axis, value)
 * 
 */

static int __pyx_pf_6pandas_3lib_12AxisProperty_2__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_12AxisProperty_2__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":43
 * 
 *     def __set__(self, obj, value):
 *         obj._set_axis(self.axis, value)             # <<<<<<<<<<<<<<
 * 
 * cdef class SeriesIndex(object):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s___set_axis); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(((struct __pyx_obj_6pandas_3lib_AxisProperty *)__pyx_v_self)->axis); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.AxisProperty.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":49
 *         object _check_type
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         from pandas.core.index import _ensure_index
 *         self._check_type = _ensure_index
 */

static int __pyx_pf_6pandas_3lib_11SeriesIndex___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_11SeriesIndex___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v__ensure_index = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":50
 * 
 *     def __init__(self):
 *         from pandas.core.index import _ensure_index             # <<<<<<<<<<<<<<
 *         self._check_type = _ensure_index
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s___ensure_index));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s___ensure_index));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___ensure_index));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_151), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___ensure_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__ensure_index = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":51
 *     def __init__(self):
 *         from pandas.core.index import _ensure_index
 *         self._check_type = _ensure_index             # <<<<<<<<<<<<<<
 * 
 *     def __get__(self, obj, type):
 */
  __Pyx_INCREF(__pyx_v__ensure_index);
  __Pyx_GIVEREF(__pyx_v__ensure_index);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_SeriesIndex *)__pyx_v_self)->_check_type);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_SeriesIndex *)__pyx_v_self)->_check_type);
  ((struct __pyx_obj_6pandas_3lib_SeriesIndex *)__pyx_v_self)->_check_type = __pyx_v__ensure_index;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.SeriesIndex.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__ensure_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":53
 *         self._check_type = _ensure_index
 * 
 *     def __get__(self, obj, type):             # <<<<<<<<<<<<<<
 *         return obj._index
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_11SeriesIndex_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11SeriesIndex_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":54
 * 
 *     def __get__(self, obj, type):
 *         return obj._index             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, obj, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_obj, __pyx_n_s___index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.SeriesIndex.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":56
 *         return obj._index
 * 
 *     def __set__(self, obj, value):             # <<<<<<<<<<<<<<
 *         if len(obj) != len(value):
 *             raise AssertionError('Index length did not match values')
 */

static int __pyx_pf_6pandas_3lib_11SeriesIndex_2__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pandas_3lib_11SeriesIndex_2__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":57
 * 
 *     def __set__(self, obj, value):
 *         if len(obj) != len(value):             # <<<<<<<<<<<<<<
 *             raise AssertionError('Index length did not match values')
 *         obj._index = self._check_type(value)
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_1 != __pyx_t_2);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":58
 *     def __set__(self, obj, value):
 *         if len(obj) != len(value):
 *             raise AssertionError('Index length did not match values')             # <<<<<<<<<<<<<<
 *         obj._index = self._check_type(value)
 * 
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_153), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[6]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":59
 *         if len(obj) != len(value):
 *             raise AssertionError('Index length did not match values')
 *         obj._index = self._check_type(value)             # <<<<<<<<<<<<<<
 * 
 * cdef class ValuesProperty(object):
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __pyx_t_5 = PyObject_Call(((struct __pyx_obj_6pandas_3lib_SeriesIndex *)__pyx_v_self)->_check_type, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_v_obj, __pyx_n_s___index, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib.SeriesIndex.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/properties.pyx":63
 * cdef class ValuesProperty(object):
 * 
 *     def __get__(self, obj, type):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray arr = obj
 */

static PyObject *__pyx_pf_6pandas_3lib_14ValuesProperty___get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14ValuesProperty___get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_base = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":65
 *     def __get__(self, obj, type):
 *         cdef:
 *             ndarray arr = obj             # <<<<<<<<<<<<<<
 *             object base
 * 
 */
  if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_v_arr = ((PyArrayObject *)__pyx_v_obj);

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":68
 *             object base
 * 
 *         base = np.get_array_base(arr)             # <<<<<<<<<<<<<<
 *         if base is None or not np.PyArray_CheckExact(base):
 *             arr = arr.view(np.ndarray)
 */
  __pyx_t_1 = __pyx_f_5numpy_get_array_base(__pyx_v_arr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_base = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":69
 * 
 *         base = np.get_array_base(arr)
 *         if base is None or not np.PyArray_CheckExact(base):             # <<<<<<<<<<<<<<
 *             arr = arr.view(np.ndarray)
 *         else:
 */
  __pyx_t_2 = (__pyx_v_base == Py_None);
  if (!__pyx_t_2) {
    __pyx_t_3 = (!PyArray_CheckExact(__pyx_v_base));
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":70
 *         base = np.get_array_base(arr)
 *         if base is None or not np.PyArray_CheckExact(base):
 *             arr = arr.view(np.ndarray)             # <<<<<<<<<<<<<<
 *         else:
 *             arr = base
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_n_s__view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)));
    __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)));
    __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_arr));
    __pyx_v_arr = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/properties.pyx":72
 *             arr = arr.view(np.ndarray)
 *         else:
 *             arr = base             # <<<<<<<<<<<<<<
 *         return arr
 */
    if (!(likely(((__pyx_v_base) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_base, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v_base);
    __Pyx_DECREF(((PyObject *)__pyx_v_arr));
    __pyx_v_arr = ((PyArrayObject *)__pyx_v_base);
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":73
 *         else:
 *             arr = base
 *         return arr             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_arr));
  __pyx_r = ((PyObject *)__pyx_v_arr);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.ValuesProperty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_arr);
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":30
 *     pass
 * 
 * def infer_dtype(object _values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */

static PyObject *__pyx_pf_6pandas_3lib_125infer_dtype(PyObject *__pyx_self, PyObject *__pyx_v__values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_125infer_dtype = {__Pyx_NAMESTR("infer_dtype"), (PyCFunction)__pyx_pf_6pandas_3lib_125infer_dtype, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_125infer_dtype(PyObject *__pyx_self, PyObject *__pyx_v__values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_val_kind = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("infer_dtype");
  __pyx_self = __pyx_self;
  __Pyx_INCREF(__pyx_v__values);

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":36
 *         ndarray values
 * 
 *     if isinstance(_values, np.ndarray):             # <<<<<<<<<<<<<<
 *         values = _values
 *     else:
 */
  __pyx_t_1 = ((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray));
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v__values, __pyx_t_1); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":37
 * 
 *     if isinstance(_values, np.ndarray):
 *         values = _values             # <<<<<<<<<<<<<<
 *     else:
 *         if not isinstance(_values, list):
 */
    if (!(likely(((__pyx_v__values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v__values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_INCREF(__pyx_v__values);
    __pyx_v_values = ((PyArrayObject *)__pyx_v__values);
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":39
 *         values = _values
 *     else:
 *         if not isinstance(_values, list):             # <<<<<<<<<<<<<<
 *             _values = list(_values)
 *         values = list_to_object_array(_values)
 */
    __pyx_t_1 = ((PyObject *)((PyObject*)(&PyList_Type)));
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_v__values, __pyx_t_1); 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = (!__pyx_t_2);
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":40
 *     else:
 *         if not isinstance(_values, list):
 *             _values = list(_values)             # <<<<<<<<<<<<<<
 *         values = list_to_object_array(_values)
 * 
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_INCREF(__pyx_v__values);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__values);
      __Pyx_GIVEREF(__pyx_v__values);
      __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_v__values);
      __pyx_v__values = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":41
 *         if not isinstance(_values, list):
 *             _values = list(_values)
 *         values = list_to_object_array(_values)             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v__values);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__values);
    __Pyx_GIVEREF(__pyx_v__values);
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_values = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":43
 *         values = list_to_object_array(_values)
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     if n == 0:
 *         return 'empty'
 */
  __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_6;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":44
 * 
 *     n = len(values)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return 'empty'
 * 
 */
  __pyx_t_3 = (__pyx_v_n == 0);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":45
 *     n = len(values)
 *     if n == 0:
 *         return 'empty'             # <<<<<<<<<<<<<<
 * 
 *     val_kind = values.dtype.type
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__empty));
    __pyx_r = ((PyObject *)__pyx_n_s__empty);
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":47
 *         return 'empty'
 * 
 *     val_kind = values.dtype.type             # <<<<<<<<<<<<<<
 *     if val_kind in _TYPE_MAP:
 *         return _TYPE_MAP[val_kind]
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_val_kind = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":48
 * 
 *     val_kind = values.dtype.type
 *     if val_kind in _TYPE_MAP:             # <<<<<<<<<<<<<<
 *         return _TYPE_MAP[val_kind]
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___TYPE_MAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((PySequence_Contains(__pyx_t_1, __pyx_v_val_kind))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":49
 *     val_kind = values.dtype.type
 *     if val_kind in _TYPE_MAP:
 *         return _TYPE_MAP[val_kind]             # <<<<<<<<<<<<<<
 * 
 *     if values.dtype != np.object_:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___TYPE_MAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_v_val_kind); if (!__pyx_t_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":51
 *         return _TYPE_MAP[val_kind]
 * 
 *     if values.dtype != np.object_:             # <<<<<<<<<<<<<<
 *         values = values.astype('O')
 * 
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__object_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":52
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     val = util.get_value_1d(values, 0)
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_values), __pyx_n_s__astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_154), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_values));
    __pyx_v_values = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":54
 *         values = values.astype('O')
 * 
 *     val = util.get_value_1d(values, 0)             # <<<<<<<<<<<<<<
 * 
 *     if util.is_datetime64_object(val):
 */
  __pyx_t_4 = get_value_1d(__pyx_v_values, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_val = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":56
 *     val = util.get_value_1d(values, 0)
 * 
 *     if util.is_datetime64_object(val):             # <<<<<<<<<<<<<<
 *         if is_datetime64_array(values):
 *             return 'datetime64'
 */
  __pyx_t_7 = is_datetime64_object(__pyx_v_val);
  if (__pyx_t_7) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":57
 * 
 *     if util.is_datetime64_object(val):
 *         if is_datetime64_array(values):             # <<<<<<<<<<<<<<
 *             return 'datetime64'
 *     elif util.is_integer_object(val):
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_datetime64_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":58
 *     if util.is_datetime64_object(val):
 *         if is_datetime64_array(values):
 *             return 'datetime64'             # <<<<<<<<<<<<<<
 *     elif util.is_integer_object(val):
 *         if is_integer_array(values):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime64));
      __pyx_r = ((PyObject *)__pyx_n_s__datetime64);
      goto __pyx_L0;
      goto __pyx_L11;
    }
    __pyx_L11:;
    goto __pyx_L10;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":59
 *         if is_datetime64_array(values):
 *             return 'datetime64'
 *     elif util.is_integer_object(val):             # <<<<<<<<<<<<<<
 *         if is_integer_array(values):
 *             return 'integer'
 */
  __pyx_t_7 = is_integer_object(__pyx_v_val);
  if (__pyx_t_7) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":60
 *             return 'datetime64'
 *     elif util.is_integer_object(val):
 *         if is_integer_array(values):             # <<<<<<<<<<<<<<
 *             return 'integer'
 *         return 'mixed-integer'
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_integer_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":61
 *     elif util.is_integer_object(val):
 *         if is_integer_array(values):
 *             return 'integer'             # <<<<<<<<<<<<<<
 *         return 'mixed-integer'
 *     elif is_datetime(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__integer));
      __pyx_r = ((PyObject *)__pyx_n_s__integer);
      goto __pyx_L0;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":62
 *         if is_integer_array(values):
 *             return 'integer'
 *         return 'mixed-integer'             # <<<<<<<<<<<<<<
 *     elif is_datetime(val):
 *         if is_datetime_array(values):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_155));
    __pyx_r = ((PyObject *)__pyx_kp_s_155);
    goto __pyx_L0;
    goto __pyx_L10;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":63
 *             return 'integer'
 *         return 'mixed-integer'
 *     elif is_datetime(val):             # <<<<<<<<<<<<<<
 *         if is_datetime_array(values):
 *             return 'datetime'
 */
  __pyx_t_3 = __pyx_f_6pandas_3lib_is_datetime(__pyx_v_val);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":64
 *         return 'mixed-integer'
 *     elif is_datetime(val):
 *         if is_datetime_array(values):             # <<<<<<<<<<<<<<
 *             return 'datetime'
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_datetime_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":65
 *     elif is_datetime(val):
 *         if is_datetime_array(values):
 *             return 'datetime'             # <<<<<<<<<<<<<<
 * 
 *     elif is_date(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime));
      __pyx_r = ((PyObject *)__pyx_n_s__datetime);
      goto __pyx_L0;
      goto __pyx_L13;
    }
    __pyx_L13:;
    goto __pyx_L10;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":67
 *             return 'datetime'
 * 
 *     elif is_date(val):             # <<<<<<<<<<<<<<
 *         if is_date_array(values):
 *             return 'date'
 */
  __pyx_t_3 = __pyx_f_6pandas_3lib_is_date(__pyx_v_val);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":68
 * 
 *     elif is_date(val):
 *         if is_date_array(values):             # <<<<<<<<<<<<<<
 *             return 'date'
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_date_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":69
 *     elif is_date(val):
 *         if is_date_array(values):
 *             return 'date'             # <<<<<<<<<<<<<<
 * 
 *     elif is_time(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__date));
      __pyx_r = ((PyObject *)__pyx_n_s__date);
      goto __pyx_L0;
      goto __pyx_L14;
    }
    __pyx_L14:;
    goto __pyx_L10;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":71
 *             return 'date'
 * 
 *     elif is_time(val):             # <<<<<<<<<<<<<<
 *         if is_time_array(values):
 *             return 'time'
 */
  __pyx_t_3 = __pyx_f_6pandas_3lib_is_time(__pyx_v_val);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":72
 * 
 *     elif is_time(val):
 *         if is_time_array(values):             # <<<<<<<<<<<<<<
 *             return 'time'
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_time_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":73
 *     elif is_time(val):
 *         if is_time_array(values):
 *             return 'time'             # <<<<<<<<<<<<<<
 * 
 *     elif util.is_float_object(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__time));
      __pyx_r = ((PyObject *)__pyx_n_s__time);
      goto __pyx_L0;
      goto __pyx_L15;
    }
    __pyx_L15:;
    goto __pyx_L10;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":75
 *             return 'time'
 * 
 *     elif util.is_float_object(val):             # <<<<<<<<<<<<<<
 *         if is_float_array(values):
 *             return 'floating'
 */
  __pyx_t_7 = is_float_object(__pyx_v_val);
  if (__pyx_t_7) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":76
 * 
 *     elif util.is_float_object(val):
 *         if is_float_array(values):             # <<<<<<<<<<<<<<
 *             return 'floating'
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_float_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":77
 *     elif util.is_float_object(val):
 *         if is_float_array(values):
 *             return 'floating'             # <<<<<<<<<<<<<<
 * 
 *     elif util.is_bool_object(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__floating));
      __pyx_r = ((PyObject *)__pyx_n_s__floating);
      goto __pyx_L0;
      goto __pyx_L16;
    }
    __pyx_L16:;
    goto __pyx_L10;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":79
 *             return 'floating'
 * 
 *     elif util.is_bool_object(val):             # <<<<<<<<<<<<<<
 *         if is_bool_array(values):
 *             return 'boolean'
 */
  __pyx_t_7 = is_bool_object(__pyx_v_val);
  if (__pyx_t_7) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":80
 * 
 *     elif util.is_bool_object(val):
 *         if is_bool_array(values):             # <<<<<<<<<<<<<<
 *             return 'boolean'
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_bool_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":81
 *     elif util.is_bool_object(val):
 *         if is_bool_array(values):
 *             return 'boolean'             # <<<<<<<<<<<<<<
 * 
 *     elif PyString_Check(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__boolean));
      __pyx_r = ((PyObject *)__pyx_n_s__boolean);
      goto __pyx_L0;
      goto __pyx_L17;
    }
    __pyx_L17:;
    goto __pyx_L10;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":83
 *             return 'boolean'
 * 
 *     elif PyString_Check(val):             # <<<<<<<<<<<<<<
 *         if is_string_array(values):
 *             return 'string'
 */
  __pyx_t_3 = PyString_Check(__pyx_v_val);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":84
 * 
 *     elif PyString_Check(val):
 *         if is_string_array(values):             # <<<<<<<<<<<<<<
 *             return 'string'
 * 
 */
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_string_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":85
 *     elif PyString_Check(val):
 *         if is_string_array(values):
 *             return 'string'             # <<<<<<<<<<<<<<
 * 
 *     elif PyUnicode_Check(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__string));
      __pyx_r = ((PyObject *)__pyx_n_s__string);
      goto __pyx_L0;
      goto __pyx_L18;
    }
    __pyx_L18:;
    goto __pyx_L10;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":87
 *             return 'string'
 * 
 *     elif PyUnicode_Check(val):             # <<<<<<<<<<<<<<
 *         if is_unicode_array(values):
 *             return 'unicode'
 */
  __pyx_t_3 = PyUnicode_Check(__pyx_v_val);
  if (__pyx_t_3) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":88
 * 
 *     elif PyUnicode_Check(val):
 *         if is_unicode_array(values):             # <<<<<<<<<<<<<<
 *             return 'unicode'
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__is_unicode_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_v_values));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_values));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_values));
    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":89
 *     elif PyUnicode_Check(val):
 *         if is_unicode_array(values):
 *             return 'unicode'             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__unicode));
      __pyx_r = ((PyObject *)__pyx_n_s__unicode);
      goto __pyx_L0;
      goto __pyx_L19;
    }
    __pyx_L19:;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":91
 *             return 'unicode'
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = util.get_value_1d(values, i)
 *         if util.is_integer_object(val):
 */
  __pyx_t_6 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":92
 * 
 *     for i in range(n):
 *         val = util.get_value_1d(values, i)             # <<<<<<<<<<<<<<
 *         if util.is_integer_object(val):
 *             return 'mixed-integer'
 */
    __pyx_t_5 = get_value_1d(__pyx_v_values, __pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":93
 *     for i in range(n):
 *         val = util.get_value_1d(values, i)
 *         if util.is_integer_object(val):             # <<<<<<<<<<<<<<
 *             return 'mixed-integer'
 * 
 */
    __pyx_t_7 = is_integer_object(__pyx_v_val);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":94
 *         val = util.get_value_1d(values, i)
 *         if util.is_integer_object(val):
 *             return 'mixed-integer'             # <<<<<<<<<<<<<<
 * 
 *     return 'mixed'
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_155));
      __pyx_r = ((PyObject *)__pyx_kp_s_155);
      goto __pyx_L0;
      goto __pyx_L22;
    }
    __pyx_L22:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":96
 *             return 'mixed-integer'
 * 
 *     return 'mixed'             # <<<<<<<<<<<<<<
 * 
 * def infer_dtype_list(list values):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__mixed));
  __pyx_r = ((PyObject *)__pyx_n_s__mixed);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib.infer_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_val_kind);
  __Pyx_XDECREF(__pyx_v__values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":98
 *     return 'mixed'
 * 
 * def infer_dtype_list(list values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_126infer_dtype_list(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_126infer_dtype_list = {__Pyx_NAMESTR("infer_dtype_list"), (PyCFunction)__pyx_pf_6pandas_3lib_126infer_dtype_list, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_126infer_dtype_list(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("infer_dtype_list");
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PyList_Type), 1, "values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":100
 * def infer_dtype_list(list values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_values) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_values)); 
  __pyx_v_n = __pyx_t_1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.infer_dtype_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":104
 * 
 * 
 * cdef inline bint is_datetime(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_Check(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_datetime(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_datetime");

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":105
 * 
 * cdef inline bint is_datetime(object o):
 *     return PyDateTime_Check(o)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_date(object o):
 */
  __pyx_r = PyDateTime_Check(__pyx_v_o);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":107
 *     return PyDateTime_Check(o)
 * 
 * cdef inline bint is_date(object o):             # <<<<<<<<<<<<<<
 *     return PyDate_Check(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_date(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_date");

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":108
 * 
 * cdef inline bint is_date(object o):
 *     return PyDate_Check(o)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint is_time(object o):
 */
  __pyx_r = PyDate_Check(__pyx_v_o);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":110
 *     return PyDate_Check(o)
 * 
 * cdef inline bint is_time(object o):             # <<<<<<<<<<<<<<
 *     return PyTime_Check(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_6pandas_3lib_is_time(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_time");

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":111
 * 
 * cdef inline bint is_time(object o):
 *     return PyTime_Check(o)             # <<<<<<<<<<<<<<
 * 
 * def is_bool_array(ndarray values):
 */
  __pyx_r = PyTime_Check(__pyx_v_o);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":113
 *     return PyTime_Check(o)
 * 
 * def is_bool_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_127is_bool_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_127is_bool_array = {__Pyx_NAMESTR("is_bool_array"), (PyCFunction)__pyx_pf_6pandas_3lib_127is_bool_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_127is_bool_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_objbuf = 0;
  Py_buffer __pyx_bstruct_objbuf;
  Py_ssize_t __pyx_bstride_0_objbuf = 0;
  Py_ssize_t __pyx_bshape_0_objbuf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_bool_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_objbuf.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":115
 * def is_bool_array(ndarray values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[object] objbuf
 *         object obj
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":119
 *         object obj
 * 
 *     if issubclass(values.dtype.type, np.bool_):             # <<<<<<<<<<<<<<
 *         return True
 *     elif values.dtype == np.object_:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__bool_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":120
 * 
 *     if issubclass(values.dtype.type, np.bool_):
 *         return True             # <<<<<<<<<<<<<<
 *     elif values.dtype == np.object_:
 *         objbuf = values
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":121
 *     if issubclass(values.dtype.type, np.bool_):
 *         return True
 *     elif values.dtype == np.object_:             # <<<<<<<<<<<<<<
 *         objbuf = values
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__object_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":122
 *         return True
 *     elif values.dtype == np.object_:
 *         objbuf = values             # <<<<<<<<<<<<<<
 * 
 *         if n == 0:
 */
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_objbuf = __pyx_bstruct_objbuf.strides[0];
      __pyx_bshape_0_objbuf = __pyx_bstruct_objbuf.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(__pyx_v_values);
    __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values);

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":124
 *         objbuf = values
 * 
 *         if n == 0:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_5 = (__pyx_v_n == 0);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":125
 * 
 *         if n == 0:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":127
 *             return False
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             if not util.is_bool_object(objbuf[i]):
 *                 return False
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":128
 * 
 *         for i in range(n):
 *             if not util.is_bool_object(objbuf[i]):             # <<<<<<<<<<<<<<
 *                 return False
 *         return True
 */
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_bshape_0_objbuf;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_objbuf)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_objbuf.buf, __pyx_t_11, __pyx_bstride_0_objbuf);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __pyx_t_5 = (!is_bool_object(__pyx_t_3));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":129
 *         for i in range(n):
 *             if not util.is_bool_object(objbuf[i]):
 *                 return False             # <<<<<<<<<<<<<<
 *         return True
 *     else:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":130
 *             if not util.is_bool_object(objbuf[i]):
 *                 return False
 *         return True             # <<<<<<<<<<<<<<
 *     else:
 *         return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":132
 *         return True
 *     else:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * def is_integer(object o):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_bool_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_objbuf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":134
 *         return False
 * 
 * def is_integer(object o):             # <<<<<<<<<<<<<<
 *     return util.is_integer_object(o)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_128is_integer(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_128is_integer = {__Pyx_NAMESTR("is_integer"), (PyCFunction)__pyx_pf_6pandas_3lib_128is_integer, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_128is_integer(PyObject *__pyx_self, PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_integer");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":135
 * 
 * def is_integer(object o):
 *     return util.is_integer_object(o)             # <<<<<<<<<<<<<<
 * 
 * def is_integer_array(ndarray values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(is_integer_object(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.is_integer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":137
 *     return util.is_integer_object(o)
 * 
 * def is_integer_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_129is_integer_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_129is_integer_array = {__Pyx_NAMESTR("is_integer_array"), (PyCFunction)__pyx_pf_6pandas_3lib_129is_integer_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_129is_integer_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_objbuf = 0;
  Py_buffer __pyx_bstruct_objbuf;
  Py_ssize_t __pyx_bstride_0_objbuf = 0;
  Py_ssize_t __pyx_bshape_0_objbuf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_integer_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_objbuf.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":139
 * def is_integer_array(ndarray values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[object] objbuf
 *         object obj
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":143
 *         object obj
 * 
 *     if issubclass(values.dtype.type, np.integer):             # <<<<<<<<<<<<<<
 *         return True
 *     elif values.dtype == np.object_:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":144
 * 
 *     if issubclass(values.dtype.type, np.integer):
 *         return True             # <<<<<<<<<<<<<<
 *     elif values.dtype == np.object_:
 *         objbuf = values
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":145
 *     if issubclass(values.dtype.type, np.integer):
 *         return True
 *     elif values.dtype == np.object_:             # <<<<<<<<<<<<<<
 *         objbuf = values
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__object_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":146
 *         return True
 *     elif values.dtype == np.object_:
 *         objbuf = values             # <<<<<<<<<<<<<<
 * 
 *         if n == 0:
 */
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_objbuf = __pyx_bstruct_objbuf.strides[0];
      __pyx_bshape_0_objbuf = __pyx_bstruct_objbuf.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(__pyx_v_values);
    __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values);

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":148
 *         objbuf = values
 * 
 *         if n == 0:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_5 = (__pyx_v_n == 0);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":149
 * 
 *         if n == 0:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":151
 *             return False
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             if not util.is_integer_object(objbuf[i]):
 *                 return False
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":152
 * 
 *         for i in range(n):
 *             if not util.is_integer_object(objbuf[i]):             # <<<<<<<<<<<<<<
 *                 return False
 *         return True
 */
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_bshape_0_objbuf;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_objbuf)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_objbuf.buf, __pyx_t_11, __pyx_bstride_0_objbuf);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __pyx_t_5 = (!is_integer_object(__pyx_t_3));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":153
 *         for i in range(n):
 *             if not util.is_integer_object(objbuf[i]):
 *                 return False             # <<<<<<<<<<<<<<
 *         return True
 *     else:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":154
 *             if not util.is_integer_object(objbuf[i]):
 *                 return False
 *         return True             # <<<<<<<<<<<<<<
 *     else:
 *         return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":156
 *         return True
 *     else:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * def is_float_array(ndarray values):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_integer_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_objbuf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":158
 *         return False
 * 
 * def is_float_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_130is_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_130is_float_array = {__Pyx_NAMESTR("is_float_array"), (PyCFunction)__pyx_pf_6pandas_3lib_130is_float_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_130is_float_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_objbuf = 0;
  Py_buffer __pyx_bstruct_objbuf;
  Py_ssize_t __pyx_bstride_0_objbuf = 0;
  Py_ssize_t __pyx_bshape_0_objbuf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_float_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_objbuf.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":160
 * def is_float_array(ndarray values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[object] objbuf
 *         object obj
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":164
 *         object obj
 * 
 *     if issubclass(values.dtype.type, np.floating):             # <<<<<<<<<<<<<<
 *         return True
 *     elif values.dtype == np.object_:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__floating); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":165
 * 
 *     if issubclass(values.dtype.type, np.floating):
 *         return True             # <<<<<<<<<<<<<<
 *     elif values.dtype == np.object_:
 *         objbuf = values
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":166
 *     if issubclass(values.dtype.type, np.floating):
 *         return True
 *     elif values.dtype == np.object_:             # <<<<<<<<<<<<<<
 *         objbuf = values
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__object_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":167
 *         return True
 *     elif values.dtype == np.object_:
 *         objbuf = values             # <<<<<<<<<<<<<<
 * 
 *         if n == 0:
 */
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_objbuf = __pyx_bstruct_objbuf.strides[0];
      __pyx_bshape_0_objbuf = __pyx_bstruct_objbuf.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(__pyx_v_values);
    __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values);

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":169
 *         objbuf = values
 * 
 *         if n == 0:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_5 = (__pyx_v_n == 0);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":170
 * 
 *         if n == 0:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":172
 *             return False
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             if not util.is_float_object(objbuf[i]):
 *                 return False
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":173
 * 
 *         for i in range(n):
 *             if not util.is_float_object(objbuf[i]):             # <<<<<<<<<<<<<<
 *                 return False
 *         return True
 */
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_bshape_0_objbuf;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_objbuf)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_objbuf.buf, __pyx_t_11, __pyx_bstride_0_objbuf);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __pyx_t_5 = (!is_float_object(__pyx_t_3));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":174
 *         for i in range(n):
 *             if not util.is_float_object(objbuf[i]):
 *                 return False             # <<<<<<<<<<<<<<
 *         return True
 *     else:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":175
 *             if not util.is_float_object(objbuf[i]):
 *                 return False
 *         return True             # <<<<<<<<<<<<<<
 *     else:
 *         return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":177
 *         return True
 *     else:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * def is_string_array(ndarray values):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_float_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_objbuf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":179
 *         return False
 * 
 * def is_string_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_131is_string_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_131is_string_array = {__Pyx_NAMESTR("is_string_array"), (PyCFunction)__pyx_pf_6pandas_3lib_131is_string_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_131is_string_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_objbuf = 0;
  Py_buffer __pyx_bstruct_objbuf;
  Py_ssize_t __pyx_bstride_0_objbuf = 0;
  Py_ssize_t __pyx_bshape_0_objbuf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_string_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_objbuf.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":181
 * def is_string_array(ndarray values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[object] objbuf
 *         object obj
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":185
 *         object obj
 * 
 *     if issubclass(values.dtype.type, (np.string_, np.unicode_)):             # <<<<<<<<<<<<<<
 *         return True
 *     elif values.dtype == np.object_:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__string_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__unicode_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = PyObject_IsSubclass(__pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":186
 * 
 *     if issubclass(values.dtype.type, (np.string_, np.unicode_)):
 *         return True             # <<<<<<<<<<<<<<
 *     elif values.dtype == np.object_:
 *         objbuf = values
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":187
 *     if issubclass(values.dtype.type, (np.string_, np.unicode_)):
 *         return True
 *     elif values.dtype == np.object_:             # <<<<<<<<<<<<<<
 *         objbuf = values
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__object_); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":188
 *         return True
 *     elif values.dtype == np.object_:
 *         objbuf = values             # <<<<<<<<<<<<<<
 * 
 *         if n == 0:
 */
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      __pyx_bstride_0_objbuf = __pyx_bstruct_objbuf.strides[0];
      __pyx_bshape_0_objbuf = __pyx_bstruct_objbuf.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(__pyx_v_values);
    __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values);

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":190
 *         objbuf = values
 * 
 *         if n == 0:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_6 = (__pyx_v_n == 0);
    if (__pyx_t_6) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":191
 * 
 *         if n == 0:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":193
 *             return False
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             if not PyString_Check(objbuf[i]):
 *                 return False
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
      __pyx_v_i = __pyx_t_11;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":194
 * 
 *         for i in range(n):
 *             if not PyString_Check(objbuf[i]):             # <<<<<<<<<<<<<<
 *                 return False
 *         return True
 */
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_bshape_0_objbuf;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_objbuf)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_objbuf.buf, __pyx_t_12, __pyx_bstride_0_objbuf);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __pyx_t_6 = (!PyString_Check(__pyx_t_3));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":195
 *         for i in range(n):
 *             if not PyString_Check(objbuf[i]):
 *                 return False             # <<<<<<<<<<<<<<
 *         return True
 *     else:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":196
 *             if not PyString_Check(objbuf[i]):
 *                 return False
 *         return True             # <<<<<<<<<<<<<<
 *     else:
 *         return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":198
 *         return True
 *     else:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * def is_unicode_array(ndarray values):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_string_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_objbuf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":200
 *         return False
 * 
 * def is_unicode_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_132is_unicode_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_132is_unicode_array = {__Pyx_NAMESTR("is_unicode_array"), (PyCFunction)__pyx_pf_6pandas_3lib_132is_unicode_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_132is_unicode_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_objbuf = 0;
  Py_buffer __pyx_bstruct_objbuf;
  Py_ssize_t __pyx_bstride_0_objbuf = 0;
  Py_ssize_t __pyx_bshape_0_objbuf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_unicode_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_objbuf.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":202
 * def is_unicode_array(ndarray values):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[object] objbuf
 *         object obj
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":206
 *         object obj
 * 
 *     if issubclass(values.dtype.type, np.unicode_):             # <<<<<<<<<<<<<<
 *         return True
 *     elif values.dtype == np.object_:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__unicode_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = PyObject_IsSubclass(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":207
 * 
 *     if issubclass(values.dtype.type, np.unicode_):
 *         return True             # <<<<<<<<<<<<<<
 *     elif values.dtype == np.object_:
 *         objbuf = values
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":208
 *     if issubclass(values.dtype.type, np.unicode_):
 *         return True
 *     elif values.dtype == np.object_:             # <<<<<<<<<<<<<<
 *         objbuf = values
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__object_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":209
 *         return True
 *     elif values.dtype == np.object_:
 *         objbuf = values             # <<<<<<<<<<<<<<
 * 
 *         if n == 0:
 */
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
      __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)((PyArrayObject *)__pyx_v_values), &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_6 < 0)) {
        PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_objbuf, (PyObject*)__pyx_v_objbuf, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        }
      }
      __pyx_bstride_0_objbuf = __pyx_bstruct_objbuf.strides[0];
      __pyx_bshape_0_objbuf = __pyx_bstruct_objbuf.shape[0];
      if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_INCREF(__pyx_v_values);
    __pyx_v_objbuf = ((PyArrayObject *)__pyx_v_values);

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":211
 *         objbuf = values
 * 
 *         if n == 0:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_5 = (__pyx_v_n == 0);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":212
 * 
 *         if n == 0:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":214
 *             return False
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             if not PyUnicode_Check(objbuf[i]):
 *                 return False
 */
    __pyx_t_1 = __pyx_v_n;
    for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) {
      __pyx_v_i = __pyx_t_10;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":215
 * 
 *         for i in range(n):
 *             if not PyUnicode_Check(objbuf[i]):             # <<<<<<<<<<<<<<
 *                 return False
 *         return True
 */
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_bshape_0_objbuf;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_objbuf)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_objbuf.buf, __pyx_t_11, __pyx_bstride_0_objbuf);
      __Pyx_INCREF((PyObject*)__pyx_t_3);
      __pyx_t_5 = (!PyUnicode_Check(__pyx_t_3));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":216
 *         for i in range(n):
 *             if not PyUnicode_Check(objbuf[i]):
 *                 return False             # <<<<<<<<<<<<<<
 *         return True
 *     else:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":217
 *             if not PyUnicode_Check(objbuf[i]):
 *                 return False
 *         return True             # <<<<<<<<<<<<<<
 *     else:
 *         return False
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":219
 *         return True
 *     else:
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_unicode_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objbuf);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_objbuf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":222
 * 
 * 
 * def is_datetime_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */

static PyObject *__pyx_pf_6pandas_3lib_133is_datetime_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_133is_datetime_array = {__Pyx_NAMESTR("is_datetime_array"), (PyCFunction)__pyx_pf_6pandas_3lib_133is_datetime_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_133is_datetime_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  int __pyx_v_i;
  int __pyx_v_n;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_datetime_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":223
 * 
 * def is_datetime_array(ndarray[object] values):
 *     cdef int i, n = len(values)             # <<<<<<<<<<<<<<
 *     if n == 0:
 *         return False
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":224
 * def is_datetime_array(ndarray[object] values):
 *     cdef int i, n = len(values)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return False
 *     for i in range(n):
 */
  __pyx_t_2 = (__pyx_v_n == 0);
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":225
 *     cdef int i, n = len(values)
 *     if n == 0:
 *         return False             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         if not is_datetime(values[i]):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":226
 *     if n == 0:
 *         return False
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if not is_datetime(values[i]):
 *             return False
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":227
 *         return False
 *     for i in range(n):
 *         if not is_datetime(values[i]):             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_values)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_6, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __pyx_t_2 = (!__pyx_f_6pandas_3lib_is_datetime(__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":228
 *     for i in range(n):
 *         if not is_datetime(values[i]):
 *             return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":229
 *         if not is_datetime(values[i]):
 *             return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_datetime_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":232
 * 
 * 
 * def is_datetime64_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */

static PyObject *__pyx_pf_6pandas_3lib_134is_datetime64_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_134is_datetime64_array = {__Pyx_NAMESTR("is_datetime64_array"), (PyCFunction)__pyx_pf_6pandas_3lib_134is_datetime64_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_134is_datetime64_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  int __pyx_v_i;
  int __pyx_v_n;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_datetime64_array");
  __pyx_self = __pyx_self;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":233
 * 
 * def is_datetime64_array(ndarray values):
 *     cdef int i, n = len(values)             # <<<<<<<<<<<<<<
 *     if n == 0:
 *         return False
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":234
 * def is_datetime64_array(ndarray values):
 *     cdef int i, n = len(values)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return False
 *     for i in range(n):
 */
  __pyx_t_2 = (__pyx_v_n == 0);
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":235
 *     cdef int i, n = len(values)
 *     if n == 0:
 *         return False             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         if not util.is_datetime64_object(values[i]):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":236
 *     if n == 0:
 *         return False
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if not util.is_datetime64_object(values[i]):
 *             return False
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":237
 *         return False
 *     for i in range(n):
 *         if not util.is_datetime64_object(values[i]):             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = (!is_datetime64_object(__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":238
 *     for i in range(n):
 *         if not util.is_datetime64_object(values[i]):
 *             return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":239
 *         if not util.is_datetime64_object(values[i]):
 *             return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * def is_date_array(ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.is_datetime64_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":241
 *     return True
 * 
 * def is_date_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */

static PyObject *__pyx_pf_6pandas_3lib_135is_date_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_135is_date_array = {__Pyx_NAMESTR("is_date_array"), (PyCFunction)__pyx_pf_6pandas_3lib_135is_date_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_135is_date_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  int __pyx_v_i;
  int __pyx_v_n;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_date_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":242
 * 
 * def is_date_array(ndarray[object] values):
 *     cdef int i, n = len(values)             # <<<<<<<<<<<<<<
 *     if n == 0:
 *         return False
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":243
 * def is_date_array(ndarray[object] values):
 *     cdef int i, n = len(values)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return False
 *     for i in range(n):
 */
  __pyx_t_2 = (__pyx_v_n == 0);
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":244
 *     cdef int i, n = len(values)
 *     if n == 0:
 *         return False             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         if not is_date(values[i]):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":245
 *     if n == 0:
 *         return False
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if not is_date(values[i]):
 *             return False
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":246
 *         return False
 *     for i in range(n):
 *         if not is_date(values[i]):             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_values)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_6, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __pyx_t_2 = (!__pyx_f_6pandas_3lib_is_date(__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":247
 *     for i in range(n):
 *         if not is_date(values[i]):
 *             return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":248
 *         if not is_date(values[i]):
 *             return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * def is_time_array(ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_date_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":250
 *     return True
 * 
 * def is_time_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */

static PyObject *__pyx_pf_6pandas_3lib_136is_time_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_136is_time_array = {__Pyx_NAMESTR("is_time_array"), (PyCFunction)__pyx_pf_6pandas_3lib_136is_time_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_136is_time_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  int __pyx_v_i;
  int __pyx_v_n;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_time_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":251
 * 
 * def is_time_array(ndarray[object] values):
 *     cdef int i, n = len(values)             # <<<<<<<<<<<<<<
 *     if n == 0:
 *         return False
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":252
 * def is_time_array(ndarray[object] values):
 *     cdef int i, n = len(values)
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return False
 *     for i in range(n):
 */
  __pyx_t_2 = (__pyx_v_n == 0);
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":253
 *     cdef int i, n = len(values)
 *     if n == 0:
 *         return False             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         if not is_time(values[i]):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":254
 *     if n == 0:
 *         return False
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if not is_time(values[i]):
 *             return False
 */
  __pyx_t_4 = __pyx_v_n;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":255
 *         return False
 *     for i in range(n):
 *         if not is_time(values[i]):             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_bshape_0_values)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_6, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __pyx_t_2 = (!__pyx_f_6pandas_3lib_is_time(__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":256
 *     for i in range(n):
 *         if not is_time(values[i]):
 *             return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":257
 *         if not is_time(values[i]):
 *             return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * def is_period_array(ndarray[object] values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_time_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":259
 *     return True
 * 
 * def is_period_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     from pandas import Period
 */

static PyObject *__pyx_pf_6pandas_3lib_137is_period_array(PyObject *__pyx_self, PyObject *__pyx_v_values); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_137is_period_array = {__Pyx_NAMESTR("is_period_array"), (PyCFunction)__pyx_pf_6pandas_3lib_137is_period_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_137is_period_array(PyObject *__pyx_self, PyObject *__pyx_v_values) {
  int __pyx_v_i;
  int __pyx_v_n;
  PyObject *__pyx_v_Period = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_period_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":260
 * 
 * def is_period_array(ndarray[object] values):
 *     cdef int i, n = len(values)             # <<<<<<<<<<<<<<
 *     from pandas import Period
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":261
 * def is_period_array(ndarray[object] values):
 *     cdef int i, n = len(values)
 *     from pandas import Period             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Period));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__Period));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Period));
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__pandas), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__Period); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_Period = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":263
 *     from pandas import Period
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         return False
 *     for i in range(n):
 */
  __pyx_t_4 = (__pyx_v_n == 0);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":264
 * 
 *     if n == 0:
 *         return False             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         if not isinstance(values[i], Period):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":265
 *     if n == 0:
 *         return False
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         if not isinstance(values[i], Period):
 *             return False
 */
  __pyx_t_5 = __pyx_v_n;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":266
 *         return False
 *     for i in range(n):
 *         if not isinstance(values[i], Period):             # <<<<<<<<<<<<<<
 *             return False
 *     return True
 */
    __pyx_t_7 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_7 < 0) {
      __pyx_t_7 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_7 >= __pyx_bshape_0_values)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_7, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __pyx_t_4 = PyObject_IsInstance(__pyx_t_3, __pyx_v_Period); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = (!__pyx_t_4);
    if (__pyx_t_9) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":267
 *     for i in range(n):
 *         if not isinstance(values[i], Period):
 *             return False             # <<<<<<<<<<<<<<
 *     return True
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":268
 *         if not isinstance(values[i], Period):
 *             return False
 *     return True             # <<<<<<<<<<<<<<
 * 
 * def extract_ordinals(ndarray[object] values, freq):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.is_period_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_Period);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":270
 *     return True
 * 
 * def extract_ordinals(ndarray[object] values, freq):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_138extract_ordinals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_138extract_ordinals = {__Pyx_NAMESTR("extract_ordinals"), (PyCFunction)__pyx_pf_6pandas_3lib_138extract_ordinals, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_138extract_ordinals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_freq = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_ordinals = 0;
  PyObject *__pyx_v_p = 0;
  Py_buffer __pyx_bstruct_ordinals;
  Py_ssize_t __pyx_bstride_0_ordinals = 0;
  Py_ssize_t __pyx_bshape_0_ordinals = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  __pyx_t_5numpy_int64_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__freq,0};
  __Pyx_RefNannySetupContext("extract_ordinals");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__freq);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("extract_ordinals", 1, 2, 2, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "extract_ordinals") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_freq = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("extract_ordinals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.extract_ordinals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_ordinals.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":272
 * def extract_ordinals(ndarray[object] values, freq):
 *     cdef:
 *         Py_ssize_t i, n = len(values)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] ordinals = np.empty(n, dtype=np.int64)
 *         object p
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":273
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 *         ndarray[int64_t] ordinals = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *         object p
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ordinals, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_ordinals = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_ordinals.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_ordinals = __pyx_bstruct_ordinals.strides[0];
      __pyx_bshape_0_ordinals = __pyx_bstruct_ordinals.shape[0];
    }
  }
  __pyx_t_7 = 0;
  __pyx_v_ordinals = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":276
 *         object p
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         p = values[i]
 *         ordinals[i] = p.ordinal
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":277
 * 
 *     for i in range(n):
 *         p = values[i]             # <<<<<<<<<<<<<<
 *         ordinals[i] = p.ordinal
 *         if p.freq != freq:
 */
    __pyx_t_9 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_9 < 0) {
      __pyx_t_9 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_values)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_p);
    __pyx_v_p = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":278
 *     for i in range(n):
 *         p = values[i]
 *         ordinals[i] = p.ordinal             # <<<<<<<<<<<<<<
 *         if p.freq != freq:
 *             raise ValueError("%s is wrong freq" % p)
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_p, __pyx_n_s__ordinal); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_6); if (unlikely((__pyx_t_11 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_ordinals;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_ordinals)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_ordinals.buf, __pyx_t_12, __pyx_bstride_0_ordinals) = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":279
 *         p = values[i]
 *         ordinals[i] = p.ordinal
 *         if p.freq != freq:             # <<<<<<<<<<<<<<
 *             raise ValueError("%s is wrong freq" % p)
 * 
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_p, __pyx_n_s__freq); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_freq, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_13) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":280
 *         ordinals[i] = p.ordinal
 *         if p.freq != freq:
 *             raise ValueError("%s is wrong freq" % p)             # <<<<<<<<<<<<<<
 * 
 *     return ordinals
 */
      __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_156), __pyx_v_p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_2));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L8;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":282
 *             raise ValueError("%s is wrong freq" % p)
 * 
 *     return ordinals             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ordinals));
  __pyx_r = ((PyObject *)__pyx_v_ordinals);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ordinals);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.extract_ordinals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ordinals);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ordinals);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":286
 * 
 * 
 * def maybe_convert_numeric(ndarray[object] values, set na_values,             # <<<<<<<<<<<<<<
 *                           convert_empty=True):
 *     '''
 */

static PyObject *__pyx_pf_6pandas_3lib_139maybe_convert_numeric(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_139maybe_convert_numeric[] = "\n    Type inference function-- convert strings to numeric (potentially) and\n    convert to proper dtype array\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_139maybe_convert_numeric = {__Pyx_NAMESTR("maybe_convert_numeric"), (PyCFunction)__pyx_pf_6pandas_3lib_139maybe_convert_numeric, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_139maybe_convert_numeric)};
static PyObject *__pyx_pf_6pandas_3lib_139maybe_convert_numeric(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_na_values = 0;
  PyObject *__pyx_v_convert_empty = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_floats = 0;
  PyArrayObject *__pyx_v_complexes = 0;
  PyArrayObject *__pyx_v_ints = 0;
  int __pyx_v_seen_float;
  int __pyx_v_seen_complex;
  PyObject *__pyx_v_val = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fval;
  Py_buffer __pyx_bstruct_complexes;
  Py_ssize_t __pyx_bstride_0_complexes = 0;
  Py_ssize_t __pyx_bshape_0_complexes = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_ints;
  Py_ssize_t __pyx_bstride_0_ints = 0;
  Py_ssize_t __pyx_bshape_0_ints = 0;
  Py_buffer __pyx_bstruct_floats;
  Py_ssize_t __pyx_bstride_0_floats = 0;
  Py_ssize_t __pyx_bshape_0_floats = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  __pyx_t_5numpy_float64_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  __pyx_t_double_complex __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__na_values,&__pyx_n_s__convert_empty,0};
  __Pyx_RefNannySetupContext("maybe_convert_numeric");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_157;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__na_values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("maybe_convert_numeric", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__convert_empty);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "maybe_convert_numeric") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_na_values = ((PyObject*)values[1]);
    __pyx_v_convert_empty = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("maybe_convert_numeric", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_floats.buf = NULL;
  __pyx_bstruct_complexes.buf = NULL;
  __pyx_bstruct_ints.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_na_values), (&PySet_Type), 1, "na_values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":297
 *         ndarray[complex128_t] complexes
 *         ndarray[int64_t] ints
 *         bint seen_float = 0             # <<<<<<<<<<<<<<
 *         bint seen_complex = 0
 *         object val
 */
  __pyx_v_seen_float = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":298
 *         ndarray[int64_t] ints
 *         bint seen_float = 0
 *         bint seen_complex = 0             # <<<<<<<<<<<<<<
 *         object val
 *         float64_t fval
 */
  __pyx_v_seen_complex = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":302
 *         float64_t fval
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 * 
 *     floats = np.empty(n, dtype='f8')
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":304
 *     n = len(values)
 * 
 *     floats = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 *     complexes = np.empty(n, dtype='c16')
 *     ints = np.empty(n, dtype='i8')
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_floats);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_floats, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_floats, (PyObject*)__pyx_v_floats, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_floats = __pyx_bstruct_floats.strides[0];
    __pyx_bshape_0_floats = __pyx_bstruct_floats.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_floats = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":305
 * 
 *     floats = np.empty(n, dtype='f8')
 *     complexes = np.empty(n, dtype='c16')             # <<<<<<<<<<<<<<
 *     ints = np.empty(n, dtype='i8')
 * 
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__c16)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_complexes);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_complexes, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_complexes, (PyObject*)__pyx_v_complexes, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_complexes = __pyx_bstruct_complexes.strides[0];
    __pyx_bshape_0_complexes = __pyx_bstruct_complexes.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_complexes = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":306
 *     floats = np.empty(n, dtype='f8')
 *     complexes = np.empty(n, dtype='c16')
 *     ints = np.empty(n, dtype='i8')             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__i8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ints);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ints, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ints, (PyObject*)__pyx_v_ints, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_ints = __pyx_bstruct_ints.strides[0];
    __pyx_bshape_0_ints = __pyx_bstruct_ints.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_ints = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":308
 *     ints = np.empty(n, dtype='i8')
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         val = values[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":309
 * 
 *     for i from 0 <= i < n:
 *         val = values[i]             # <<<<<<<<<<<<<<
 * 
 *         if util.is_float_object(val):
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_values)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_13, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":311
 *         val = values[i]
 * 
 *         if util.is_float_object(val):             # <<<<<<<<<<<<<<
 *             floats[i] = complexes[i] = val
 *             seen_float = 1
 */
    __pyx_t_7 = is_float_object(__pyx_v_val);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":312
 * 
 *         if util.is_float_object(val):
 *             floats[i] = complexes[i] = val             # <<<<<<<<<<<<<<
 *             seen_float = 1
 *         elif val in na_values:
 */
      __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_14 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_floats;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_15, __pyx_bstride_0_floats) = __pyx_t_14;
      __pyx_t_16 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_complexes;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_17, __pyx_bstride_0_complexes) = __pyx_t_16;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":313
 *         if util.is_float_object(val):
 *             floats[i] = complexes[i] = val
 *             seen_float = 1             # <<<<<<<<<<<<<<
 *         elif val in na_values:
 *             floats[i] = complexes[i] = nan
 */
      __pyx_v_seen_float = 1;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":314
 *             floats[i] = complexes[i] = val
 *             seen_float = 1
 *         elif val in na_values:             # <<<<<<<<<<<<<<
 *             floats[i] = complexes[i] = nan
 *             seen_float = 1
 */
    __pyx_t_18 = ((PySequence_Contains(((PyObject *)__pyx_v_na_values), __pyx_v_val))); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_18) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":315
 *             seen_float = 1
 *         elif val in na_values:
 *             floats[i] = complexes[i] = nan             # <<<<<<<<<<<<<<
 *             seen_float = 1
 *         elif val is None:
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_floats;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_19, __pyx_bstride_0_floats) = __pyx_v_6pandas_3lib_nan;
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_complexes;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_20, __pyx_bstride_0_complexes) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0);

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":316
 *         elif val in na_values:
 *             floats[i] = complexes[i] = nan
 *             seen_float = 1             # <<<<<<<<<<<<<<
 *         elif val is None:
 *             floats[i] = complexes[i] = nan
 */
      __pyx_v_seen_float = 1;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":317
 *             floats[i] = complexes[i] = nan
 *             seen_float = 1
 *         elif val is None:             # <<<<<<<<<<<<<<
 *             floats[i] = complexes[i] = nan
 *             seen_float = 1
 */
    __pyx_t_18 = (__pyx_v_val == Py_None);
    if (__pyx_t_18) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":318
 *             seen_float = 1
 *         elif val is None:
 *             floats[i] = complexes[i] = nan             # <<<<<<<<<<<<<<
 *             seen_float = 1
 *         elif len(val) == 0:
 */
      __pyx_t_21 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_21 < 0) {
        __pyx_t_21 += __pyx_bshape_0_floats;
        if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_21 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_21, __pyx_bstride_0_floats) = __pyx_v_6pandas_3lib_nan;
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_bshape_0_complexes;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_22, __pyx_bstride_0_complexes) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0);

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":319
 *         elif val is None:
 *             floats[i] = complexes[i] = nan
 *             seen_float = 1             # <<<<<<<<<<<<<<
 *         elif len(val) == 0:
 *             if convert_empty:
 */
      __pyx_v_seen_float = 1;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":320
 *             floats[i] = complexes[i] = nan
 *             seen_float = 1
 *         elif len(val) == 0:             # <<<<<<<<<<<<<<
 *             if convert_empty:
 *                 floats[i] = complexes[i] = nan
 */
    __pyx_t_23 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_18 = (__pyx_t_23 == 0);
    if (__pyx_t_18) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":321
 *             seen_float = 1
 *         elif len(val) == 0:
 *             if convert_empty:             # <<<<<<<<<<<<<<
 *                 floats[i] = complexes[i] = nan
 *                 seen_float = 1
 */
      __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_convert_empty); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_18) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":322
 *         elif len(val) == 0:
 *             if convert_empty:
 *                 floats[i] = complexes[i] = nan             # <<<<<<<<<<<<<<
 *                 seen_float = 1
 *             else:
 */
        __pyx_t_23 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_23 < 0) {
          __pyx_t_23 += __pyx_bshape_0_floats;
          if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_23, __pyx_bstride_0_floats) = __pyx_v_6pandas_3lib_nan;
        __pyx_t_24 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_24 < 0) {
          __pyx_t_24 += __pyx_bshape_0_complexes;
          if (unlikely(__pyx_t_24 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_24, __pyx_bstride_0_complexes) = __pyx_t_double_complex_from_parts(__pyx_v_6pandas_3lib_nan, 0);

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":323
 *             if convert_empty:
 *                 floats[i] = complexes[i] = nan
 *                 seen_float = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError('Empty string encountered')
 */
        __pyx_v_seen_float = 1;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":325
 *                 seen_float = 1
 *             else:
 *                 raise ValueError('Empty string encountered')             # <<<<<<<<<<<<<<
 *         elif util.is_complex_object(val):
 *             complexes[i] = val
 */
        __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_159), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L9:;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":326
 *             else:
 *                 raise ValueError('Empty string encountered')
 *         elif util.is_complex_object(val):             # <<<<<<<<<<<<<<
 *             complexes[i] = val
 *             seen_complex = 1
 */
    __pyx_t_7 = is_complex_object(__pyx_v_val);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":327
 *                 raise ValueError('Empty string encountered')
 *         elif util.is_complex_object(val):
 *             complexes[i] = val             # <<<<<<<<<<<<<<
 *             seen_complex = 1
 *         else:
 */
      __pyx_t_16 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_25 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_bshape_0_complexes;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_25, __pyx_bstride_0_complexes) = __pyx_t_16;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":328
 *         elif util.is_complex_object(val):
 *             complexes[i] = val
 *             seen_complex = 1             # <<<<<<<<<<<<<<
 *         else:
 *             fval = util.floatify(val)
 */
      __pyx_v_seen_complex = 1;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":330
 *             seen_complex = 1
 *         else:
 *             fval = util.floatify(val)             # <<<<<<<<<<<<<<
 *             floats[i] = fval
 *             if not seen_float:
 */
      __pyx_t_2 = floatify(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_fval = __pyx_t_14;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":331
 *         else:
 *             fval = util.floatify(val)
 *             floats[i] = fval             # <<<<<<<<<<<<<<
 *             if not seen_float:
 *                 if '.' in val:
 */
      __pyx_t_26 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_26 < 0) {
        __pyx_t_26 += __pyx_bshape_0_floats;
        if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_26, __pyx_bstride_0_floats) = __pyx_v_fval;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":332
 *             fval = util.floatify(val)
 *             floats[i] = fval
 *             if not seen_float:             # <<<<<<<<<<<<<<
 *                 if '.' in val:
 *                     seen_float = 1
 */
      __pyx_t_18 = (!__pyx_v_seen_float);
      if (__pyx_t_18) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":333
 *             floats[i] = fval
 *             if not seen_float:
 *                 if '.' in val:             # <<<<<<<<<<<<<<
 *                     seen_float = 1
 *                 else:
 */
        __pyx_t_18 = ((PySequence_Contains(__pyx_v_val, ((PyObject *)__pyx_kp_s_160)))); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_18) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":334
 *             if not seen_float:
 *                 if '.' in val:
 *                     seen_float = 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     ints[i] = <int64_t> fval
 */
          __pyx_v_seen_float = 1;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":336
 *                     seen_float = 1
 *                 else:
 *                     ints[i] = <int64_t> fval             # <<<<<<<<<<<<<<
 * 
 *     if seen_complex:
 */
          __pyx_t_27 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_27 < 0) {
            __pyx_t_27 += __pyx_bshape_0_ints;
            if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_ints)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_ints.buf, __pyx_t_27, __pyx_bstride_0_ints) = ((__pyx_t_5numpy_int64_t)__pyx_v_fval);
        }
        __pyx_L11:;
        goto __pyx_L10;
      }
      __pyx_L10:;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":338
 *                     ints[i] = <int64_t> fval
 * 
 *     if seen_complex:             # <<<<<<<<<<<<<<
 *         return complexes
 *     elif seen_float:
 */
  if (__pyx_v_seen_complex) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":339
 * 
 *     if seen_complex:
 *         return complexes             # <<<<<<<<<<<<<<
 *     elif seen_float:
 *         return floats
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_complexes));
    __pyx_r = ((PyObject *)__pyx_v_complexes);
    goto __pyx_L0;
    goto __pyx_L12;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":340
 *     if seen_complex:
 *         return complexes
 *     elif seen_float:             # <<<<<<<<<<<<<<
 *         return floats
 *     else:
 */
  if (__pyx_v_seen_float) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":341
 *         return complexes
 *     elif seen_float:
 *         return floats             # <<<<<<<<<<<<<<
 *     else:
 *         return ints
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_floats));
    __pyx_r = ((PyObject *)__pyx_v_floats);
    goto __pyx_L0;
    goto __pyx_L12;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":343
 *         return floats
 *     else:
 *         return ints             # <<<<<<<<<<<<<<
 * 
 * def maybe_convert_objects(ndarray[object] objects, bint try_float=0,
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_ints));
    __pyx_r = ((PyObject *)__pyx_v_ints);
    goto __pyx_L0;
  }
  __pyx_L12:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_complexes);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ints);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_floats);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.maybe_convert_numeric", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_complexes);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ints);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_floats);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_floats);
  __Pyx_XDECREF((PyObject *)__pyx_v_complexes);
  __Pyx_XDECREF((PyObject *)__pyx_v_ints);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":345
 *         return ints
 * 
 * def maybe_convert_objects(ndarray[object] objects, bint try_float=0,             # <<<<<<<<<<<<<<
 *                           bint safe=0, bint convert_datetime=0):
 *     '''
 */

static PyObject *__pyx_pf_6pandas_3lib_140maybe_convert_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_140maybe_convert_objects[] = "\n    Type inference function-- convert object array to proper dtype\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_140maybe_convert_objects = {__Pyx_NAMESTR("maybe_convert_objects"), (PyCFunction)__pyx_pf_6pandas_3lib_140maybe_convert_objects, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_140maybe_convert_objects)};
static PyObject *__pyx_pf_6pandas_3lib_140maybe_convert_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_objects = 0;
  int __pyx_v_try_float;
  int __pyx_v_safe;
  int __pyx_v_convert_datetime;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_floats = 0;
  PyArrayObject *__pyx_v_complexes = 0;
  PyArrayObject *__pyx_v_ints = 0;
  PyArrayObject *__pyx_v_bools = 0;
  PyArrayObject *__pyx_v_idatetimes = 0;
  int __pyx_v_seen_float;
  int __pyx_v_seen_complex;
  int __pyx_v_seen_datetime;
  int __pyx_v_seen_int;
  int __pyx_v_seen_bool;
  int __pyx_v_seen_object;
  int __pyx_v_seen_null;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_onan = 0;
  __pyx_t_5numpy_float64_t __pyx_v_fnan;
  PyObject *__pyx_v_datetimes = NULL;
  Py_buffer __pyx_bstruct_idatetimes;
  Py_ssize_t __pyx_bstride_0_idatetimes = 0;
  Py_ssize_t __pyx_bshape_0_idatetimes = 0;
  Py_buffer __pyx_bstruct_ints;
  Py_ssize_t __pyx_bstride_0_ints = 0;
  Py_ssize_t __pyx_bshape_0_ints = 0;
  Py_buffer __pyx_bstruct_complexes;
  Py_ssize_t __pyx_bstride_0_complexes = 0;
  Py_ssize_t __pyx_bshape_0_complexes = 0;
  Py_buffer __pyx_bstruct_objects;
  Py_ssize_t __pyx_bstride_0_objects = 0;
  Py_ssize_t __pyx_bshape_0_objects = 0;
  Py_buffer __pyx_bstruct_floats;
  Py_ssize_t __pyx_bstride_0_floats = 0;
  Py_ssize_t __pyx_bshape_0_floats = 0;
  Py_buffer __pyx_bstruct_bools;
  Py_ssize_t __pyx_bstride_0_bools = 0;
  Py_ssize_t __pyx_bshape_0_bools = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyArrayObject *__pyx_t_14 = NULL;
  PyArrayObject *__pyx_t_15 = NULL;
  __pyx_t_5numpy_float64_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  __pyx_t_5numpy_uint8_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __pyx_t_double_complex __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  __pyx_t_5numpy_int64_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  int __pyx_t_33;
  double __pyx_t_34;
  Py_ssize_t __pyx_t_35;
  Py_ssize_t __pyx_t_36;
  int __pyx_t_37;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__objects,&__pyx_n_s__try_float,&__pyx_n_s__safe,&__pyx_n_s__convert_datetime,0};
  __Pyx_RefNannySetupContext("maybe_convert_objects");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__objects);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__try_float);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__safe);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__convert_datetime);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "maybe_convert_objects") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_objects = ((PyArrayObject *)values[0]);
    if (values[1]) {
      __pyx_v_try_float = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_try_float == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_try_float = ((int)0);
    }
    if (values[2]) {
      __pyx_v_safe = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_safe == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_safe = ((int)0);
    }
    if (values[3]) {
      __pyx_v_convert_datetime = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_convert_datetime == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_convert_datetime = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("maybe_convert_objects", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_floats.buf = NULL;
  __pyx_bstruct_complexes.buf = NULL;
  __pyx_bstruct_ints.buf = NULL;
  __pyx_bstruct_bools.buf = NULL;
  __pyx_bstruct_idatetimes.buf = NULL;
  __pyx_bstruct_objects.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_objects), __pyx_ptype_5numpy_ndarray, 1, "objects", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_objects, (PyObject*)__pyx_v_objects, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_objects = __pyx_bstruct_objects.strides[0];
  __pyx_bshape_0_objects = __pyx_bstruct_objects.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":357
 *         ndarray[uint8_t] bools
 *         ndarray[int64_t] idatetimes
 *         bint seen_float = 0             # <<<<<<<<<<<<<<
 *         bint seen_complex = 0
 *         bint seen_datetime = 0
 */
  __pyx_v_seen_float = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":358
 *         ndarray[int64_t] idatetimes
 *         bint seen_float = 0
 *         bint seen_complex = 0             # <<<<<<<<<<<<<<
 *         bint seen_datetime = 0
 *         bint seen_int = 0
 */
  __pyx_v_seen_complex = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":359
 *         bint seen_float = 0
 *         bint seen_complex = 0
 *         bint seen_datetime = 0             # <<<<<<<<<<<<<<
 *         bint seen_int = 0
 *         bint seen_bool = 0
 */
  __pyx_v_seen_datetime = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":360
 *         bint seen_complex = 0
 *         bint seen_datetime = 0
 *         bint seen_int = 0             # <<<<<<<<<<<<<<
 *         bint seen_bool = 0
 *         bint seen_object = 0
 */
  __pyx_v_seen_int = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":361
 *         bint seen_datetime = 0
 *         bint seen_int = 0
 *         bint seen_bool = 0             # <<<<<<<<<<<<<<
 *         bint seen_object = 0
 *         bint seen_null = 0
 */
  __pyx_v_seen_bool = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":362
 *         bint seen_int = 0
 *         bint seen_bool = 0
 *         bint seen_object = 0             # <<<<<<<<<<<<<<
 *         bint seen_null = 0
 *         object val, onan
 */
  __pyx_v_seen_object = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":363
 *         bint seen_bool = 0
 *         bint seen_object = 0
 *         bint seen_null = 0             # <<<<<<<<<<<<<<
 *         object val, onan
 *         float64_t fval, fnan
 */
  __pyx_v_seen_null = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":367
 *         float64_t fval, fnan
 * 
 *     n = len(objects)             # <<<<<<<<<<<<<<
 * 
 *     floats = np.empty(n, dtype='f8')
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_objects)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":369
 *     n = len(objects)
 * 
 *     floats = np.empty(n, dtype='f8')             # <<<<<<<<<<<<<<
 *     complexes = np.empty(n, dtype='c16')
 *     ints = np.empty(n, dtype='i8')
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_floats);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_floats, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_floats, (PyObject*)__pyx_v_floats, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_floats = __pyx_bstruct_floats.strides[0];
    __pyx_bshape_0_floats = __pyx_bstruct_floats.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_floats = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":370
 * 
 *     floats = np.empty(n, dtype='f8')
 *     complexes = np.empty(n, dtype='c16')             # <<<<<<<<<<<<<<
 *     ints = np.empty(n, dtype='i8')
 *     bools = np.empty(n, dtype=np.uint8)
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__c16)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_complexes);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_complexes, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_complexes, (PyObject*)__pyx_v_complexes, &__Pyx_TypeInfo___pyx_t_double_complex, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_complexes = __pyx_bstruct_complexes.strides[0];
    __pyx_bshape_0_complexes = __pyx_bstruct_complexes.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_complexes = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":371
 *     floats = np.empty(n, dtype='f8')
 *     complexes = np.empty(n, dtype='c16')
 *     ints = np.empty(n, dtype='i8')             # <<<<<<<<<<<<<<
 *     bools = np.empty(n, dtype=np.uint8)
 *     datetimes = np.empty(n, dtype='M8[ns]')
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__i8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ints);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_ints, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_ints, (PyObject*)__pyx_v_ints, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_ints = __pyx_bstruct_ints.strides[0];
    __pyx_bshape_0_ints = __pyx_bstruct_ints.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_ints = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":372
 *     complexes = np.empty(n, dtype='c16')
 *     ints = np.empty(n, dtype='i8')
 *     bools = np.empty(n, dtype=np.uint8)             # <<<<<<<<<<<<<<
 *     datetimes = np.empty(n, dtype='M8[ns]')
 *     idatetimes = datetimes.view(np.int64)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_13 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((PyArrayObject *)__pyx_t_13);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bools);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_bools, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_bools, (PyObject*)__pyx_v_bools, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_bools = __pyx_bstruct_bools.strides[0];
    __pyx_bshape_0_bools = __pyx_bstruct_bools.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_14 = 0;
  __pyx_v_bools = ((PyArrayObject *)__pyx_t_13);
  __pyx_t_13 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":373
 *     ints = np.empty(n, dtype='i8')
 *     bools = np.empty(n, dtype=np.uint8)
 *     datetimes = np.empty(n, dtype='M8[ns]')             # <<<<<<<<<<<<<<
 *     idatetimes = datetimes.view(np.int64)
 * 
 */
  __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;
  __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_13));
  if (PyDict_SetItem(__pyx_t_13, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
  __pyx_v_datetimes = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":374
 *     bools = np.empty(n, dtype=np.uint8)
 *     datetimes = np.empty(n, dtype='M8[ns]')
 *     idatetimes = datetimes.view(np.int64)             # <<<<<<<<<<<<<<
 * 
 *     onan = np.nan
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_datetimes, __pyx_n_s__view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_13));
  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_15 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_idatetimes);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_idatetimes, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_idatetimes, (PyObject*)__pyx_v_idatetimes, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_idatetimes = __pyx_bstruct_idatetimes.strides[0];
    __pyx_bshape_0_idatetimes = __pyx_bstruct_idatetimes.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_15 = 0;
  __pyx_v_idatetimes = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":376
 *     idatetimes = datetimes.view(np.int64)
 * 
 *     onan = np.nan             # <<<<<<<<<<<<<<
 *     fnan = np.nan
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__nan); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_onan = __pyx_t_13;
  __pyx_t_13 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":377
 * 
 *     onan = np.nan
 *     fnan = np.nan             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__nan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_16 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_fnan = __pyx_t_16;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":379
 *     fnan = np.nan
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         val = objects[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":380
 * 
 *     for i from 0 <= i < n:
 *         val = objects[i]             # <<<<<<<<<<<<<<
 * 
 *         if val is None:
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_bshape_0_objects;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_objects)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_objects.buf, __pyx_t_17, __pyx_bstride_0_objects);
    __Pyx_INCREF((PyObject*)__pyx_t_4);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":382
 *         val = objects[i]
 * 
 *         if val is None:             # <<<<<<<<<<<<<<
 *             seen_null = 1
 *             floats[i] = complexes[i] = fnan
 */
    __pyx_t_18 = (__pyx_v_val == Py_None);
    if (__pyx_t_18) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":383
 * 
 *         if val is None:
 *             seen_null = 1             # <<<<<<<<<<<<<<
 *             floats[i] = complexes[i] = fnan
 *         elif util.is_bool_object(val):
 */
      __pyx_v_seen_null = 1;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":384
 *         if val is None:
 *             seen_null = 1
 *             floats[i] = complexes[i] = fnan             # <<<<<<<<<<<<<<
 *         elif util.is_bool_object(val):
 *             seen_bool = 1
 */
      __pyx_t_19 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_floats;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_19, __pyx_bstride_0_floats) = __pyx_v_fnan;
      __pyx_t_20 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_20 < 0) {
        __pyx_t_20 += __pyx_bshape_0_complexes;
        if (unlikely(__pyx_t_20 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_20, __pyx_bstride_0_complexes) = __pyx_t_double_complex_from_parts(__pyx_v_fnan, 0);
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":385
 *             seen_null = 1
 *             floats[i] = complexes[i] = fnan
 *         elif util.is_bool_object(val):             # <<<<<<<<<<<<<<
 *             seen_bool = 1
 *             bools[i] = val
 */
    __pyx_t_7 = is_bool_object(__pyx_v_val);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":386
 *             floats[i] = complexes[i] = fnan
 *         elif util.is_bool_object(val):
 *             seen_bool = 1             # <<<<<<<<<<<<<<
 *             bools[i] = val
 *         elif util.is_integer_object(val):
 */
      __pyx_v_seen_bool = 1;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":387
 *         elif util.is_bool_object(val):
 *             seen_bool = 1
 *             bools[i] = val             # <<<<<<<<<<<<<<
 *         elif util.is_integer_object(val):
 *             seen_int = 1
 */
      __pyx_t_21 = __Pyx_PyInt_from_py_npy_uint8(__pyx_v_val); if (unlikely((__pyx_t_21 == (npy_uint8)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_22 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_22 < 0) {
        __pyx_t_22 += __pyx_bshape_0_bools;
        if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_bools)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_bools.buf, __pyx_t_22, __pyx_bstride_0_bools) = __pyx_t_21;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":388
 *             seen_bool = 1
 *             bools[i] = val
 *         elif util.is_integer_object(val):             # <<<<<<<<<<<<<<
 *             seen_int = 1
 *             floats[i] = <float64_t> val
 */
    __pyx_t_7 = is_integer_object(__pyx_v_val);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":389
 *             bools[i] = val
 *         elif util.is_integer_object(val):
 *             seen_int = 1             # <<<<<<<<<<<<<<
 *             floats[i] = <float64_t> val
 *             complexes[i] = <double complex> val
 */
      __pyx_v_seen_int = 1;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":390
 *         elif util.is_integer_object(val):
 *             seen_int = 1
 *             floats[i] = <float64_t> val             # <<<<<<<<<<<<<<
 *             complexes[i] = <double complex> val
 *             if not seen_null:
 */
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_16 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_23 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_23 < 0) {
        __pyx_t_23 += __pyx_bshape_0_floats;
        if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_23, __pyx_bstride_0_floats) = ((__pyx_t_5numpy_float64_t)__pyx_t_16);

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":391
 *             seen_int = 1
 *             floats[i] = <float64_t> val
 *             complexes[i] = <double complex> val             # <<<<<<<<<<<<<<
 *             if not seen_null:
 *                 ints[i] = val
 */
      __pyx_t_24 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_25 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_25 < 0) {
        __pyx_t_25 += __pyx_bshape_0_complexes;
        if (unlikely(__pyx_t_25 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_25 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_25, __pyx_bstride_0_complexes) = __pyx_t_double_complex_from_parts(((double)__Pyx_CREAL(__pyx_t_24)), ((double)__Pyx_CIMAG(__pyx_t_24)));

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":392
 *             floats[i] = <float64_t> val
 *             complexes[i] = <double complex> val
 *             if not seen_null:             # <<<<<<<<<<<<<<
 *                 ints[i] = val
 *         elif util.is_float_object(val):
 */
      __pyx_t_18 = (!__pyx_v_seen_null);
      if (__pyx_t_18) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":393
 *             complexes[i] = <double complex> val
 *             if not seen_null:
 *                 ints[i] = val             # <<<<<<<<<<<<<<
 *         elif util.is_float_object(val):
 *             floats[i] = complexes[i] = val
 */
        __pyx_t_26 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_26 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_27 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_bshape_0_ints;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_ints)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_ints.buf, __pyx_t_27, __pyx_bstride_0_ints) = __pyx_t_26;
        goto __pyx_L9;
      }
      __pyx_L9:;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":394
 *             if not seen_null:
 *                 ints[i] = val
 *         elif util.is_float_object(val):             # <<<<<<<<<<<<<<
 *             floats[i] = complexes[i] = val
 *             seen_float = 1
 */
    __pyx_t_7 = is_float_object(__pyx_v_val);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":395
 *                 ints[i] = val
 *         elif util.is_float_object(val):
 *             floats[i] = complexes[i] = val             # <<<<<<<<<<<<<<
 *             seen_float = 1
 *         elif util.is_complex_object(val):
 */
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_v_val); if (unlikely((__pyx_t_16 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_28 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_28 < 0) {
        __pyx_t_28 += __pyx_bshape_0_floats;
        if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_28, __pyx_bstride_0_floats) = __pyx_t_16;
      __pyx_t_24 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_29 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_29 < 0) {
        __pyx_t_29 += __pyx_bshape_0_complexes;
        if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_29, __pyx_bstride_0_complexes) = __pyx_t_24;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":396
 *         elif util.is_float_object(val):
 *             floats[i] = complexes[i] = val
 *             seen_float = 1             # <<<<<<<<<<<<<<
 *         elif util.is_complex_object(val):
 *             complexes[i] = val
 */
      __pyx_v_seen_float = 1;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":397
 *             floats[i] = complexes[i] = val
 *             seen_float = 1
 *         elif util.is_complex_object(val):             # <<<<<<<<<<<<<<
 *             complexes[i] = val
 *             seen_complex = 1
 */
    __pyx_t_7 = is_complex_object(__pyx_v_val);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":398
 *             seen_float = 1
 *         elif util.is_complex_object(val):
 *             complexes[i] = val             # <<<<<<<<<<<<<<
 *             seen_complex = 1
 *         elif util.is_datetime64_object(val):
 */
      __pyx_t_24 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_v_val); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_30 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_30 < 0) {
        __pyx_t_30 += __pyx_bshape_0_complexes;
        if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_30 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_30, __pyx_bstride_0_complexes) = __pyx_t_24;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":399
 *         elif util.is_complex_object(val):
 *             complexes[i] = val
 *             seen_complex = 1             # <<<<<<<<<<<<<<
 *         elif util.is_datetime64_object(val):
 *             if convert_datetime:
 */
      __pyx_v_seen_complex = 1;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":400
 *             complexes[i] = val
 *             seen_complex = 1
 *         elif util.is_datetime64_object(val):             # <<<<<<<<<<<<<<
 *             if convert_datetime:
 *                 idatetimes[i] = convert_to_tsobject(val).value
 */
    __pyx_t_7 = is_datetime64_object(__pyx_v_val);
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":401
 *             seen_complex = 1
 *         elif util.is_datetime64_object(val):
 *             if convert_datetime:             # <<<<<<<<<<<<<<
 *                 idatetimes[i] = convert_to_tsobject(val).value
 *                 seen_datetime = 1
 */
      if (__pyx_v_convert_datetime) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":402
 *         elif util.is_datetime64_object(val):
 *             if convert_datetime:
 *                 idatetimes[i] = convert_to_tsobject(val).value             # <<<<<<<<<<<<<<
 *                 seen_datetime = 1
 *             else:
 */
        __pyx_t_4 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_v_val, 0, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_13 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__value); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_26 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_13); if (unlikely((__pyx_t_26 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_31 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_31 < 0) {
          __pyx_t_31 += __pyx_bshape_0_idatetimes;
          if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_31 >= __pyx_bshape_0_idatetimes)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_idatetimes.buf, __pyx_t_31, __pyx_bstride_0_idatetimes) = __pyx_t_26;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":403
 *             if convert_datetime:
 *                 idatetimes[i] = convert_to_tsobject(val).value
 *                 seen_datetime = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 seen_object = 1
 */
        __pyx_v_seen_datetime = 1;
        goto __pyx_L10;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":405
 *                 seen_datetime = 1
 *             else:
 *                 seen_object = 1             # <<<<<<<<<<<<<<
 *                 # objects[i] = val.astype('O')
 *         elif PyDateTime_Check(val):
 */
        __pyx_v_seen_object = 1;
      }
      __pyx_L10:;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":407
 *                 seen_object = 1
 *                 # objects[i] = val.astype('O')
 *         elif PyDateTime_Check(val):             # <<<<<<<<<<<<<<
 *             if convert_datetime:
 *                 seen_datetime = 1
 */
    __pyx_t_18 = PyDateTime_Check(__pyx_v_val);
    if (__pyx_t_18) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":408
 *                 # objects[i] = val.astype('O')
 *         elif PyDateTime_Check(val):
 *             if convert_datetime:             # <<<<<<<<<<<<<<
 *                 seen_datetime = 1
 *                 idatetimes[i] = convert_to_tsobject(val).value
 */
      if (__pyx_v_convert_datetime) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":409
 *         elif PyDateTime_Check(val):
 *             if convert_datetime:
 *                 seen_datetime = 1             # <<<<<<<<<<<<<<
 *                 idatetimes[i] = convert_to_tsobject(val).value
 *             else:
 */
        __pyx_v_seen_datetime = 1;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":410
 *             if convert_datetime:
 *                 seen_datetime = 1
 *                 idatetimes[i] = convert_to_tsobject(val).value             # <<<<<<<<<<<<<<
 *             else:
 *                 seen_object = 1
 */
        __pyx_t_13 = __pyx_f_6pandas_3lib_convert_to_tsobject(__pyx_v_val, 0, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_26 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_4); if (unlikely((__pyx_t_26 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_32 = __pyx_v_i;
        __pyx_t_7 = -1;
        if (__pyx_t_32 < 0) {
          __pyx_t_32 += __pyx_bshape_0_idatetimes;
          if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_32 >= __pyx_bshape_0_idatetimes)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[2]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_idatetimes.buf, __pyx_t_32, __pyx_bstride_0_idatetimes) = __pyx_t_26;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":412
 *                 idatetimes[i] = convert_to_tsobject(val).value
 *             else:
 *                 seen_object = 1             # <<<<<<<<<<<<<<
 *         elif try_float and not util.is_string_object(val):
 *             # this will convert Decimal objects
 */
        __pyx_v_seen_object = 1;
      }
      __pyx_L11:;
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":413
 *             else:
 *                 seen_object = 1
 *         elif try_float and not util.is_string_object(val):             # <<<<<<<<<<<<<<
 *             # this will convert Decimal objects
 *             try:
 */
    if (__pyx_v_try_float) {
      __pyx_t_18 = (!is_string_object(__pyx_v_val));
      __pyx_t_33 = __pyx_t_18;
    } else {
      __pyx_t_33 = __pyx_v_try_float;
    }
    if (__pyx_t_33) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":415
 *         elif try_float and not util.is_string_object(val):
 *             # this will convert Decimal objects
 *             try:             # <<<<<<<<<<<<<<
 *                 floats[i] = float(val)
 *                 complexes[i] = complex(val)
 */
      {
        __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":416
 *             # this will convert Decimal objects
 *             try:
 *                 floats[i] = float(val)             # <<<<<<<<<<<<<<
 *                 complexes[i] = complex(val)
 *                 seen_float = 1
 */
          __pyx_t_34 = __Pyx_PyObject_AsDouble(__pyx_v_val); if (unlikely(__pyx_t_34 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __pyx_t_35 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_35 < 0) {
            __pyx_t_35 += __pyx_bshape_0_floats;
            if (unlikely(__pyx_t_35 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_35 >= __pyx_bshape_0_floats)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_bstruct_floats.buf, __pyx_t_35, __pyx_bstride_0_floats) = __pyx_t_34;

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":417
 *             try:
 *                 floats[i] = float(val)
 *                 complexes[i] = complex(val)             # <<<<<<<<<<<<<<
 *                 seen_float = 1
 *             except Exception:
 */
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_4));
          __Pyx_INCREF(__pyx_v_val);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val);
          __Pyx_GIVEREF(__pyx_v_val);
          __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cpython_7complex_complex)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __pyx_t_24 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_13); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_36 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_36 < 0) {
            __pyx_t_36 += __pyx_bshape_0_complexes;
            if (unlikely(__pyx_t_36 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_36 >= __pyx_bshape_0_complexes)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_double_complex *, __pyx_bstruct_complexes.buf, __pyx_t_36, __pyx_bstride_0_complexes) = __pyx_t_24;

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":418
 *                 floats[i] = float(val)
 *                 complexes[i] = complex(val)
 *                 seen_float = 1             # <<<<<<<<<<<<<<
 *             except Exception:
 *                 seen_object = 1
 */
          __pyx_v_seen_float = 1;
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L19_try_end;
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":419
 *                 complexes[i] = complex(val)
 *                 seen_float = 1
 *             except Exception:             # <<<<<<<<<<<<<<
 *                 seen_object = 1
 *         else:
 */
        __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
        if (__pyx_t_7) {
          __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_3);

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":420
 *                 seen_float = 1
 *             except Exception:
 *                 seen_object = 1             # <<<<<<<<<<<<<<
 *         else:
 *             seen_object = 1
 */
          __pyx_v_seen_object = 1;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L13_exception_handled;
        }
        __pyx_L14_except_error:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L13_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        __pyx_L19_try_end:;
      }
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":422
 *                 seen_object = 1
 *         else:
 *             seen_object = 1             # <<<<<<<<<<<<<<
 * 
 *     if not safe:
 */
      __pyx_v_seen_object = 1;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":424
 *             seen_object = 1
 * 
 *     if not safe:             # <<<<<<<<<<<<<<
 *         if seen_null:
 *             if (seen_float or seen_int) and not seen_object:
 */
  __pyx_t_33 = (!__pyx_v_safe);
  if (__pyx_t_33) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":425
 * 
 *     if not safe:
 *         if seen_null:             # <<<<<<<<<<<<<<
 *             if (seen_float or seen_int) and not seen_object:
 *                 if seen_complex:
 */
    if (__pyx_v_seen_null) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":426
 *     if not safe:
 *         if seen_null:
 *             if (seen_float or seen_int) and not seen_object:             # <<<<<<<<<<<<<<
 *                 if seen_complex:
 *                     return complexes
 */
      if (!__pyx_v_seen_float) {
        __pyx_t_33 = __pyx_v_seen_int;
      } else {
        __pyx_t_33 = __pyx_v_seen_float;
      }
      if (__pyx_t_33) {
        __pyx_t_18 = (!__pyx_v_seen_object);
        __pyx_t_37 = __pyx_t_18;
      } else {
        __pyx_t_37 = __pyx_t_33;
      }
      if (__pyx_t_37) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":427
 *         if seen_null:
 *             if (seen_float or seen_int) and not seen_object:
 *                 if seen_complex:             # <<<<<<<<<<<<<<
 *                     return complexes
 *                 else:
 */
        if (__pyx_v_seen_complex) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":428
 *             if (seen_float or seen_int) and not seen_object:
 *                 if seen_complex:
 *                     return complexes             # <<<<<<<<<<<<<<
 *                 else:
 *                     return floats
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(((PyObject *)__pyx_v_complexes));
          __pyx_r = ((PyObject *)__pyx_v_complexes);
          goto __pyx_L0;
          goto __pyx_L25;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":430
 *                     return complexes
 *                 else:
 *                     return floats             # <<<<<<<<<<<<<<
 *             else:
 *                 return objects
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(((PyObject *)__pyx_v_floats));
          __pyx_r = ((PyObject *)__pyx_v_floats);
          goto __pyx_L0;
        }
        __pyx_L25:;
        goto __pyx_L24;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":432
 *                     return floats
 *             else:
 *                 return objects             # <<<<<<<<<<<<<<
 *         else:
 *             if seen_object:
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_objects));
        __pyx_r = ((PyObject *)__pyx_v_objects);
        goto __pyx_L0;
      }
      __pyx_L24:;
      goto __pyx_L23;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":434
 *                 return objects
 *         else:
 *             if seen_object:             # <<<<<<<<<<<<<<
 *                 return objects
 *             elif not seen_bool:
 */
      if (__pyx_v_seen_object) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":435
 *         else:
 *             if seen_object:
 *                 return objects             # <<<<<<<<<<<<<<
 *             elif not seen_bool:
 *                 if seen_datetime:
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_objects));
        __pyx_r = ((PyObject *)__pyx_v_objects);
        goto __pyx_L0;
        goto __pyx_L26;
      }

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":436
 *             if seen_object:
 *                 return objects
 *             elif not seen_bool:             # <<<<<<<<<<<<<<
 *                 if seen_datetime:
 *                     if seen_complex or seen_float or seen_int:
 */
      __pyx_t_37 = (!__pyx_v_seen_bool);
      if (__pyx_t_37) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":437
 *                 return objects
 *             elif not seen_bool:
 *                 if seen_datetime:             # <<<<<<<<<<<<<<
 *                     if seen_complex or seen_float or seen_int:
 *                         return objects
 */
        if (__pyx_v_seen_datetime) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":438
 *             elif not seen_bool:
 *                 if seen_datetime:
 *                     if seen_complex or seen_float or seen_int:             # <<<<<<<<<<<<<<
 *                         return objects
 *                     else:
 */
          if (!__pyx_v_seen_complex) {
            if (!__pyx_v_seen_float) {
              __pyx_t_37 = __pyx_v_seen_int;
            } else {
              __pyx_t_37 = __pyx_v_seen_float;
            }
            __pyx_t_33 = __pyx_t_37;
          } else {
            __pyx_t_33 = __pyx_v_seen_complex;
          }
          if (__pyx_t_33) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":439
 *                 if seen_datetime:
 *                     if seen_complex or seen_float or seen_int:
 *                         return objects             # <<<<<<<<<<<<<<
 *                     else:
 *                         return datetimes
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_objects));
            __pyx_r = ((PyObject *)__pyx_v_objects);
            goto __pyx_L0;
            goto __pyx_L28;
          }
          /*else*/ {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":441
 *                         return objects
 *                     else:
 *                         return datetimes             # <<<<<<<<<<<<<<
 *                 else:
 *                     if seen_complex:
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_v_datetimes);
            __pyx_r = __pyx_v_datetimes;
            goto __pyx_L0;
          }
          __pyx_L28:;
          goto __pyx_L27;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":443
 *                         return datetimes
 *                 else:
 *                     if seen_complex:             # <<<<<<<<<<<<<<
 *                         return complexes
 *                     elif seen_float:
 */
          if (__pyx_v_seen_complex) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":444
 *                 else:
 *                     if seen_complex:
 *                         return complexes             # <<<<<<<<<<<<<<
 *                     elif seen_float:
 *                         return floats
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_complexes));
            __pyx_r = ((PyObject *)__pyx_v_complexes);
            goto __pyx_L0;
            goto __pyx_L29;
          }

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":445
 *                     if seen_complex:
 *                         return complexes
 *                     elif seen_float:             # <<<<<<<<<<<<<<
 *                         return floats
 *                     elif seen_int:
 */
          if (__pyx_v_seen_float) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":446
 *                         return complexes
 *                     elif seen_float:
 *                         return floats             # <<<<<<<<<<<<<<
 *                     elif seen_int:
 *                         return ints
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_floats));
            __pyx_r = ((PyObject *)__pyx_v_floats);
            goto __pyx_L0;
            goto __pyx_L29;
          }

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":447
 *                     elif seen_float:
 *                         return floats
 *                     elif seen_int:             # <<<<<<<<<<<<<<
 *                         return ints
 *             else:
 */
          if (__pyx_v_seen_int) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":448
 *                         return floats
 *                     elif seen_int:
 *                         return ints             # <<<<<<<<<<<<<<
 *             else:
 *                 if not seen_float and not seen_int:
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_ints));
            __pyx_r = ((PyObject *)__pyx_v_ints);
            goto __pyx_L0;
            goto __pyx_L29;
          }
          __pyx_L29:;
        }
        __pyx_L27:;
        goto __pyx_L26;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":450
 *                         return ints
 *             else:
 *                 if not seen_float and not seen_int:             # <<<<<<<<<<<<<<
 *                     return bools.view(np.bool_)
 * 
 */
        __pyx_t_33 = (!__pyx_v_seen_float);
        if (__pyx_t_33) {
          __pyx_t_37 = (!__pyx_v_seen_int);
          __pyx_t_18 = __pyx_t_37;
        } else {
          __pyx_t_18 = __pyx_t_33;
        }
        if (__pyx_t_18) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":451
 *             else:
 *                 if not seen_float and not seen_int:
 *                     return bools.view(np.bool_)             # <<<<<<<<<<<<<<
 * 
 *             return objects
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_bools), __pyx_n_s__view); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_13 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__bool_); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_4));
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __pyx_r = __pyx_t_13;
          __pyx_t_13 = 0;
          goto __pyx_L0;
          goto __pyx_L30;
        }
        __pyx_L30:;
      }
      __pyx_L26:;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":453
 *                     return bools.view(np.bool_)
 * 
 *             return objects             # <<<<<<<<<<<<<<
 *     else:
 *         # don't cast int to float, etc.
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_objects));
      __pyx_r = ((PyObject *)__pyx_v_objects);
      goto __pyx_L0;
    }
    __pyx_L23:;
    goto __pyx_L22;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":456
 *     else:
 *         # don't cast int to float, etc.
 *         if seen_null:             # <<<<<<<<<<<<<<
 *             if (seen_float or seen_int) and not seen_object:
 *                 if seen_complex:
 */
    if (__pyx_v_seen_null) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":457
 *         # don't cast int to float, etc.
 *         if seen_null:
 *             if (seen_float or seen_int) and not seen_object:             # <<<<<<<<<<<<<<
 *                 if seen_complex:
 *                     return complexes
 */
      if (!__pyx_v_seen_float) {
        __pyx_t_18 = __pyx_v_seen_int;
      } else {
        __pyx_t_18 = __pyx_v_seen_float;
      }
      if (__pyx_t_18) {
        __pyx_t_33 = (!__pyx_v_seen_object);
        __pyx_t_37 = __pyx_t_33;
      } else {
        __pyx_t_37 = __pyx_t_18;
      }
      if (__pyx_t_37) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":458
 *         if seen_null:
 *             if (seen_float or seen_int) and not seen_object:
 *                 if seen_complex:             # <<<<<<<<<<<<<<
 *                     return complexes
 *                 else:
 */
        if (__pyx_v_seen_complex) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":459
 *             if (seen_float or seen_int) and not seen_object:
 *                 if seen_complex:
 *                     return complexes             # <<<<<<<<<<<<<<
 *                 else:
 *                     return floats
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(((PyObject *)__pyx_v_complexes));
          __pyx_r = ((PyObject *)__pyx_v_complexes);
          goto __pyx_L0;
          goto __pyx_L33;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":461
 *                     return complexes
 *                 else:
 *                     return floats             # <<<<<<<<<<<<<<
 *             else:
 *                 return objects
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(((PyObject *)__pyx_v_floats));
          __pyx_r = ((PyObject *)__pyx_v_floats);
          goto __pyx_L0;
        }
        __pyx_L33:;
        goto __pyx_L32;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":463
 *                     return floats
 *             else:
 *                 return objects             # <<<<<<<<<<<<<<
 *         else:
 *             if seen_object:
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_objects));
        __pyx_r = ((PyObject *)__pyx_v_objects);
        goto __pyx_L0;
      }
      __pyx_L32:;
      goto __pyx_L31;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":465
 *                 return objects
 *         else:
 *             if seen_object:             # <<<<<<<<<<<<<<
 *                 return objects
 *             elif not seen_bool:
 */
      if (__pyx_v_seen_object) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":466
 *         else:
 *             if seen_object:
 *                 return objects             # <<<<<<<<<<<<<<
 *             elif not seen_bool:
 *                 if seen_datetime:
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_objects));
        __pyx_r = ((PyObject *)__pyx_v_objects);
        goto __pyx_L0;
        goto __pyx_L34;
      }

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":467
 *             if seen_object:
 *                 return objects
 *             elif not seen_bool:             # <<<<<<<<<<<<<<
 *                 if seen_datetime:
 *                     if seen_complex or seen_float or seen_int:
 */
      __pyx_t_37 = (!__pyx_v_seen_bool);
      if (__pyx_t_37) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":468
 *                 return objects
 *             elif not seen_bool:
 *                 if seen_datetime:             # <<<<<<<<<<<<<<
 *                     if seen_complex or seen_float or seen_int:
 *                         return objects
 */
        if (__pyx_v_seen_datetime) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":469
 *             elif not seen_bool:
 *                 if seen_datetime:
 *                     if seen_complex or seen_float or seen_int:             # <<<<<<<<<<<<<<
 *                         return objects
 *                     else:
 */
          if (!__pyx_v_seen_complex) {
            if (!__pyx_v_seen_float) {
              __pyx_t_37 = __pyx_v_seen_int;
            } else {
              __pyx_t_37 = __pyx_v_seen_float;
            }
            __pyx_t_18 = __pyx_t_37;
          } else {
            __pyx_t_18 = __pyx_v_seen_complex;
          }
          if (__pyx_t_18) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":470
 *                 if seen_datetime:
 *                     if seen_complex or seen_float or seen_int:
 *                         return objects             # <<<<<<<<<<<<<<
 *                     else:
 *                         return datetimes
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_objects));
            __pyx_r = ((PyObject *)__pyx_v_objects);
            goto __pyx_L0;
            goto __pyx_L36;
          }
          /*else*/ {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":472
 *                         return objects
 *                     else:
 *                         return datetimes             # <<<<<<<<<<<<<<
 *                 else:
 *                     if seen_int and seen_float:
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(__pyx_v_datetimes);
            __pyx_r = __pyx_v_datetimes;
            goto __pyx_L0;
          }
          __pyx_L36:;
          goto __pyx_L35;
        }
        /*else*/ {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":474
 *                         return datetimes
 *                 else:
 *                     if seen_int and seen_float:             # <<<<<<<<<<<<<<
 *                         return objects
 *                     elif seen_complex:
 */
          if (__pyx_v_seen_int) {
            __pyx_t_18 = __pyx_v_seen_float;
          } else {
            __pyx_t_18 = __pyx_v_seen_int;
          }
          if (__pyx_t_18) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":475
 *                 else:
 *                     if seen_int and seen_float:
 *                         return objects             # <<<<<<<<<<<<<<
 *                     elif seen_complex:
 *                         return complexes
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_objects));
            __pyx_r = ((PyObject *)__pyx_v_objects);
            goto __pyx_L0;
            goto __pyx_L37;
          }

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":476
 *                     if seen_int and seen_float:
 *                         return objects
 *                     elif seen_complex:             # <<<<<<<<<<<<<<
 *                         return complexes
 *                     elif seen_float:
 */
          if (__pyx_v_seen_complex) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":477
 *                         return objects
 *                     elif seen_complex:
 *                         return complexes             # <<<<<<<<<<<<<<
 *                     elif seen_float:
 *                         return floats
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_complexes));
            __pyx_r = ((PyObject *)__pyx_v_complexes);
            goto __pyx_L0;
            goto __pyx_L37;
          }

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":478
 *                     elif seen_complex:
 *                         return complexes
 *                     elif seen_float:             # <<<<<<<<<<<<<<
 *                         return floats
 *                     elif seen_int:
 */
          if (__pyx_v_seen_float) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":479
 *                         return complexes
 *                     elif seen_float:
 *                         return floats             # <<<<<<<<<<<<<<
 *                     elif seen_int:
 *                         return ints
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_floats));
            __pyx_r = ((PyObject *)__pyx_v_floats);
            goto __pyx_L0;
            goto __pyx_L37;
          }

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":480
 *                     elif seen_float:
 *                         return floats
 *                     elif seen_int:             # <<<<<<<<<<<<<<
 *                         return ints
 *             else:
 */
          if (__pyx_v_seen_int) {

            /* "/home/wesm/code/pandas/pandas/src/inference.pyx":481
 *                         return floats
 *                     elif seen_int:
 *                         return ints             # <<<<<<<<<<<<<<
 *             else:
 *                 if not seen_float and not seen_int:
 */
            __Pyx_XDECREF(__pyx_r);
            __Pyx_INCREF(((PyObject *)__pyx_v_ints));
            __pyx_r = ((PyObject *)__pyx_v_ints);
            goto __pyx_L0;
            goto __pyx_L37;
          }
          __pyx_L37:;
        }
        __pyx_L35:;
        goto __pyx_L34;
      }
      /*else*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":483
 *                         return ints
 *             else:
 *                 if not seen_float and not seen_int:             # <<<<<<<<<<<<<<
 *                     return bools.view(np.bool_)
 * 
 */
        __pyx_t_18 = (!__pyx_v_seen_float);
        if (__pyx_t_18) {
          __pyx_t_37 = (!__pyx_v_seen_int);
          __pyx_t_33 = __pyx_t_37;
        } else {
          __pyx_t_33 = __pyx_t_18;
        }
        if (__pyx_t_33) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":484
 *             else:
 *                 if not seen_float and not seen_int:
 *                     return bools.view(np.bool_)             # <<<<<<<<<<<<<<
 * 
 *             return objects
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_v_bools), __pyx_n_s__view); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__bool_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_4));
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
          __pyx_r = __pyx_t_3;
          __pyx_t_3 = 0;
          goto __pyx_L0;
          goto __pyx_L38;
        }
        __pyx_L38:;
      }
      __pyx_L34:;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":486
 *                     return bools.view(np.bool_)
 * 
 *             return objects             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_objects));
      __pyx_r = ((PyObject *)__pyx_v_objects);
      goto __pyx_L0;
    }
    __pyx_L31:;
  }
  __pyx_L22:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_idatetimes);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ints);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_complexes);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objects);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_floats);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bools);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.maybe_convert_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_idatetimes);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_ints);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_complexes);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_objects);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_floats);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_bools);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_floats);
  __Pyx_XDECREF((PyObject *)__pyx_v_complexes);
  __Pyx_XDECREF((PyObject *)__pyx_v_ints);
  __Pyx_XDECREF((PyObject *)__pyx_v_bools);
  __Pyx_XDECREF((PyObject *)__pyx_v_idatetimes);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_onan);
  __Pyx_XDECREF(__pyx_v_datetimes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":489
 * 
 * 
 * def convert_sql_column(x):             # <<<<<<<<<<<<<<
 *     return maybe_convert_objects(x, try_float=1)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_141convert_sql_column(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_141convert_sql_column = {__Pyx_NAMESTR("convert_sql_column"), (PyCFunction)__pyx_pf_6pandas_3lib_141convert_sql_column, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_141convert_sql_column(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_sql_column");
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":490
 * 
 * def convert_sql_column(x):
 *     return maybe_convert_objects(x, try_float=1)             # <<<<<<<<<<<<<<
 * 
 * def try_parse_dates(ndarray[object] values, parser=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_89); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__try_float), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.convert_sql_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":508
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):             # <<<<<<<<<<<<<<
 *                 try:
 *                     return datetime.strptime(s, '%m/%d/%Y')
 */

static PyObject *__pyx_pf_6pandas_3lib_15try_parse_dates_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_15try_parse_dates_parse_date = {__Pyx_NAMESTR("parse_date"), (PyCFunction)__pyx_pf_6pandas_3lib_15try_parse_dates_parse_date, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_15try_parse_dates_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *__pyx_cur_scope;
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_date");
  __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *)__pyx_self;
  __pyx_cur_scope = __pyx_outer_scope;
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":509
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):
 *                 try:             # <<<<<<<<<<<<<<
 *                     return datetime.strptime(s, '%m/%d/%Y')
 *                 except Exception:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":510
 *             def parse_date(s):
 *                 try:
 *                     return datetime.strptime(s, '%m/%d/%Y')             # <<<<<<<<<<<<<<
 *                 except Exception:
 *                     return s
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_cur_scope->__pyx_v_datetime)) { __Pyx_RaiseClosureNameError("datetime"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L5_error;} }__pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_datetime, __pyx_n_s__strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_s);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s);
      __Pyx_GIVEREF(__pyx_v_s);
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_161));
      PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_kp_s_161));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_161));
      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L9_try_return;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L12_try_end;
    __pyx_L9_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":511
 *                 try:
 *                     return datetime.strptime(s, '%m/%d/%Y')
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     return s
 *         # EAFP here
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pandas.lib.try_parse_dates.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":512
 *                     return datetime.strptime(s, '%m/%d/%Y')
 *                 except Exception:
 *                     return s             # <<<<<<<<<<<<<<
 *         # EAFP here
 *         try:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_s);
      __pyx_r = __pyx_v_s;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L8_except_return;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L12_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.try_parse_dates.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":506
 *         try:
 *             from dateutil.parser import parse
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)             # <<<<<<<<<<<<<<
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):
 */

static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_lambda_methdef_lambda4 = {__Pyx_NAMESTR("lambda4"), (PyCFunction)__pyx_lambda_funcdef_lambda4, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_lambda_funcdef_lambda4(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *__pyx_cur_scope;
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda4");
  __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *)__pyx_self;
  __pyx_cur_scope = __pyx_outer_scope;
  __pyx_self = __pyx_self;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (unlikely(!__pyx_cur_scope->__pyx_v_dayfirst)) { __Pyx_RaiseClosureNameError("dayfirst"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dayfirst), __pyx_cur_scope->__pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_cur_scope->__pyx_v_parse, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.try_parse_dates.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":492
 *     return maybe_convert_objects(x, try_float=1)
 * 
 * def try_parse_dates(ndarray[object] values, parser=None,             # <<<<<<<<<<<<<<
 *                     dayfirst=False):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_142try_parse_dates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_142try_parse_dates = {__Pyx_NAMESTR("try_parse_dates"), (PyCFunction)__pyx_pf_6pandas_3lib_142try_parse_dates, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_142try_parse_dates(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *__pyx_cur_scope;
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_parser = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_parse_date = NULL;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject **__pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__parser,&__pyx_n_s__dayfirst,0};
  __Pyx_RefNannySetupContext("try_parse_dates");
  __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *)__pyx_ptype_6pandas_3lib___pyx_scope_struct__try_parse_dates->tp_new(__pyx_ptype_6pandas_3lib___pyx_scope_struct__try_parse_dates, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = __pyx_k_162;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parser);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dayfirst);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "try_parse_dates") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_parser = values[1];
    __Pyx_INCREF(values[2]);
    __pyx_cur_scope->__pyx_v_dayfirst = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("try_parse_dates", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_dayfirst); __pyx_cur_scope->__pyx_v_dayfirst = 0;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dayfirst);
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":498
 *         ndarray[object] result
 * 
 *     from datetime import datetime             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__datetime));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_datetime = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":500
 *     from datetime import datetime
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype='O')
 * 
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":501
 * 
 *     n = len(values)
 *     result = np.empty(n, dtype='O')             # <<<<<<<<<<<<<<
 * 
 *     if parser is None:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":503
 *     result = np.empty(n, dtype='O')
 * 
 *     if parser is None:             # <<<<<<<<<<<<<<
 *         try:
 *             from dateutil.parser import parse
 */
  __pyx_t_11 = (__pyx_v_parser == Py_None);
  if (__pyx_t_11) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":504
 * 
 *     if parser is None:
 *         try:             # <<<<<<<<<<<<<<
 *             from dateutil.parser import parse
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":505
 *     if parser is None:
 *         try:
 *             from dateutil.parser import parse             # <<<<<<<<<<<<<<
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 *         except ImportError: # pragma: no cover
 */
        __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __Pyx_INCREF(((PyObject *)__pyx_n_s__parse));
        PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__parse));
        __Pyx_GIVEREF(((PyObject *)__pyx_n_s__parse));
        __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_48), ((PyObject *)__pyx_t_5), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__parse); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_cur_scope->__pyx_v_parse = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":506
 *         try:
 *             from dateutil.parser import parse
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)             # <<<<<<<<<<<<<<
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):
 */
        __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_lambda_methdef_lambda4, ((PyObject*)__pyx_cur_scope), __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v_parse_date = __pyx_t_2;
        __pyx_t_2 = 0;
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":507
 *             from dateutil.parser import parse
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 *         except ImportError: # pragma: no cover             # <<<<<<<<<<<<<<
 *             def parse_date(s):
 *                 try:
 */
      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_4);

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":508
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):             # <<<<<<<<<<<<<<
 *                 try:
 *                     return datetime.strptime(s, '%m/%d/%Y')
 */
        __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_15try_parse_dates_parse_date, ((PyObject*)__pyx_cur_scope), __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_parse_date);
        __pyx_v_parse_date = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L8_exception_handled;
      }
      __pyx_L9_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      __pyx_L14_try_end:;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":514
 *                     return s
 *         # EAFP here
 *         try:             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < n:
 *                 result[i] = parse_date(values[i])
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":515
 *         # EAFP here
 *         try:
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 result[i] = parse_date(values[i])
 *         except Exception:
 */
        __pyx_t_3 = __pyx_v_n;
        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":516
 *         try:
 *             for i from 0 <= i < n:
 *                 result[i] = parse_date(values[i])             # <<<<<<<<<<<<<<
 *         except Exception:
 *             # failed
 */
          __pyx_t_12 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_12 < 0) {
            __pyx_t_12 += __pyx_bshape_0_values;
            if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_values)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          __pyx_t_4 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_12, __pyx_bstride_0_values);
          __Pyx_INCREF((PyObject*)__pyx_t_4);
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_5));
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = PyObject_Call(__pyx_v_parse_date, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __pyx_t_13 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_13 < 0) {
            __pyx_t_13 += __pyx_bshape_0_result;
            if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_result)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
          }
          __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_13, __pyx_bstride_0_result);
          __Pyx_GOTREF(*__pyx_t_14);
          __Pyx_DECREF(*__pyx_t_14); __Pyx_INCREF(__pyx_t_4);
          *__pyx_t_14 = __pyx_t_4;
          __Pyx_GIVEREF(*__pyx_t_14);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L24_try_end;
      __pyx_L17_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":517
 *             for i from 0 <= i < n:
 *                 result[i] = parse_date(values[i])
 *         except Exception:             # <<<<<<<<<<<<<<
 *             # failed
 *             return values
 */
      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L19_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_2);

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":519
 *         except Exception:
 *             # failed
 *             return values             # <<<<<<<<<<<<<<
 *     else:
 *         parse_date = parser
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(((PyObject *)__pyx_v_values));
        __pyx_r = ((PyObject *)__pyx_v_values);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L20_except_return;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L18_exception_handled;
      }
      __pyx_L19_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L20_except_return:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L0;
      __pyx_L18_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      __pyx_L24_try_end:;
    }
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":521
 *             return values
 *     else:
 *         parse_date = parser             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __Pyx_INCREF(__pyx_v_parser);
    __pyx_v_parse_date = __pyx_v_parser;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":523
 *         parse_date = parser
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < n:
 *                 result[i] = parse_date(values[i])
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":524
 * 
 *         try:
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 result[i] = parse_date(values[i])
 *         except Exception:
 */
        __pyx_t_3 = __pyx_v_n;
        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":525
 *         try:
 *             for i from 0 <= i < n:
 *                 result[i] = parse_date(values[i])             # <<<<<<<<<<<<<<
 *         except Exception:
 *             # raise if passed parser and it failed
 */
          __pyx_t_15 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_15 < 0) {
            __pyx_t_15 += __pyx_bshape_0_values;
            if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_values)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          }
          __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_15, __pyx_bstride_0_values);
          __Pyx_INCREF((PyObject*)__pyx_t_2);
          __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_5));
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_2 = PyObject_Call(__pyx_v_parse_date, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __pyx_t_16 = __pyx_v_i;
          __pyx_t_7 = -1;
          if (__pyx_t_16 < 0) {
            __pyx_t_16 += __pyx_bshape_0_result;
            if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_result)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L29_error;}
          }
          __pyx_t_14 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_16, __pyx_bstride_0_result);
          __Pyx_GOTREF(*__pyx_t_14);
          __Pyx_DECREF(*__pyx_t_14); __Pyx_INCREF(__pyx_t_2);
          *__pyx_t_14 = __pyx_t_2;
          __Pyx_GIVEREF(*__pyx_t_14);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L36_try_end;
      __pyx_L29_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":526
 *             for i from 0 <= i < n:
 *                 result[i] = parse_date(values[i])
 *         except Exception:             # <<<<<<<<<<<<<<
 *             # raise if passed parser and it failed
 *             raise
 */
      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
      if (__pyx_t_7) {
        __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_4);

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":528
 *         except Exception:
 *             # raise if passed parser and it failed
 *             raise             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_ErrRestore(__pyx_t_2, __pyx_t_5, __pyx_t_4);
        __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; 
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L30_exception_handled;
      }
      __pyx_L31_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L30_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      __pyx_L36_try_end:;
    }
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":530
 *             raise
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.try_parse_dates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_parse_date);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":551
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):             # <<<<<<<<<<<<<<
 *                 try:
 *                     return date.strptime(s, '%m/%d/%Y')
 */

static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_parse_date = {__Pyx_NAMESTR("parse_date"), (PyCFunction)__pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_parse_date(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_cur_scope;
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_date");
  __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)__pyx_self;
  __pyx_cur_scope = __pyx_outer_scope;
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":552
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):
 *                 try:             # <<<<<<<<<<<<<<
 *                     return date.strptime(s, '%m/%d/%Y')
 *                 except Exception:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":553
 *             def parse_date(s):
 *                 try:
 *                     return date.strptime(s, '%m/%d/%Y')             # <<<<<<<<<<<<<<
 *                 except Exception:
 *                     return s
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_cur_scope->__pyx_v_date)) { __Pyx_RaiseClosureNameError("date"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L5_error;} }__pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_date, __pyx_n_s__strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_s);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s);
      __Pyx_GIVEREF(__pyx_v_s);
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_161));
      PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_kp_s_161));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_161));
      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L9_try_return;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L12_try_end;
    __pyx_L9_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":554
 *                 try:
 *                     return date.strptime(s, '%m/%d/%Y')
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     return s
 *     else:
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":555
 *                     return date.strptime(s, '%m/%d/%Y')
 *                 except Exception:
 *                     return s             # <<<<<<<<<<<<<<
 *     else:
 *         parse_date = date_parser
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_s);
      __pyx_r = __pyx_v_s;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L8_except_return;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L12_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":564
 *             parse_time = lambda x: parse(x)
 *         except ImportError: # pragma: no cover
 *             def parse_time(s):             # <<<<<<<<<<<<<<
 *                 try:
 *                     return time.strptime(s, '%H:%M:%S')
 */

static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_1parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_23try_parse_date_and_time_1parse_time = {__Pyx_NAMESTR("parse_time"), (PyCFunction)__pyx_pf_6pandas_3lib_23try_parse_date_and_time_1parse_time, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_23try_parse_date_and_time_1parse_time(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_cur_scope;
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_time");
  __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)__pyx_self;
  __pyx_cur_scope = __pyx_outer_scope;
  __pyx_self = __pyx_self;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":565
 *         except ImportError: # pragma: no cover
 *             def parse_time(s):
 *                 try:             # <<<<<<<<<<<<<<
 *                     return time.strptime(s, '%H:%M:%S')
 *                 except Exception:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":566
 *             def parse_time(s):
 *                 try:
 *                     return time.strptime(s, '%H:%M:%S')             # <<<<<<<<<<<<<<
 *                 except Exception:
 *                     return s
 */
      __Pyx_XDECREF(__pyx_r);
      if (unlikely(!__pyx_cur_scope->__pyx_v_time)) { __Pyx_RaiseClosureNameError("time"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L5_error;} }__pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_time, __pyx_n_s__strptime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_s);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_s);
      __Pyx_GIVEREF(__pyx_v_s);
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_164));
      PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_kp_s_164));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_164));
      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L9_try_return;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L12_try_end;
    __pyx_L9_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":567
 *                 try:
 *                     return time.strptime(s, '%H:%M:%S')
 *                 except Exception:             # <<<<<<<<<<<<<<
 *                     return s
 * 
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":568
 *                     return time.strptime(s, '%H:%M:%S')
 *                 except Exception:
 *                     return s             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_s);
      __pyx_r = __pyx_v_s;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L8_except_return;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L8_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L12_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.parse_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":549
 *         try:
 *             from dateutil.parser import parse
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)             # <<<<<<<<<<<<<<
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):
 */

static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_lambda_methdef_lambda5 = {__Pyx_NAMESTR("lambda5"), (PyCFunction)__pyx_lambda_funcdef_lambda5, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_lambda_funcdef_lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_cur_scope;
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda5");
  __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)__pyx_self;
  __pyx_cur_scope = __pyx_outer_scope;
  __pyx_self = __pyx_self;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (unlikely(!__pyx_cur_scope->__pyx_v_dayfirst)) { __Pyx_RaiseClosureNameError("dayfirst"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dayfirst), __pyx_cur_scope->__pyx_v_dayfirst) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_cur_scope->__pyx_v_parse, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":562
 *         try:
 *             from dateutil.parser import parse
 *             parse_time = lambda x: parse(x)             # <<<<<<<<<<<<<<
 *         except ImportError: # pragma: no cover
 *             def parse_time(s):
 */

static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_lambda_methdef_lambda6 = {__Pyx_NAMESTR("lambda6"), (PyCFunction)__pyx_lambda_funcdef_lambda6, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_cur_scope;
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda6");
  __pyx_outer_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)__pyx_self;
  __pyx_cur_scope = __pyx_outer_scope;
  __pyx_self = __pyx_self;
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_parse)) { __Pyx_RaiseClosureNameError("parse"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_parse, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":532
 *     return result
 * 
 * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times,             # <<<<<<<<<<<<<<
 *                             date_parser=None, time_parser=None,
 *                             dayfirst=False):
 */

static PyObject *__pyx_pf_6pandas_3lib_143try_parse_date_and_time(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_143try_parse_date_and_time = {__Pyx_NAMESTR("try_parse_date_and_time"), (PyCFunction)__pyx_pf_6pandas_3lib_143try_parse_date_and_time, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_143try_parse_date_and_time(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *__pyx_cur_scope;
  PyArrayObject *__pyx_v_dates = 0;
  PyArrayObject *__pyx_v_times = 0;
  PyObject *__pyx_v_date_parser = 0;
  PyObject *__pyx_v_time_parser = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_datetime = NULL;
  PyObject *__pyx_v_parse_date = NULL;
  PyObject *__pyx_v_parse_time = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_t = NULL;
  Py_buffer __pyx_bstruct_dates;
  Py_ssize_t __pyx_bstride_0_dates = 0;
  Py_ssize_t __pyx_bshape_0_dates = 0;
  Py_buffer __pyx_bstruct_times;
  Py_ssize_t __pyx_bstride_0_times = 0;
  Py_ssize_t __pyx_bshape_0_times = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  PyObject **__pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dates,&__pyx_n_s__times,&__pyx_n_s__date_parser,&__pyx_n_s__time_parser,&__pyx_n_s__dayfirst,0};
  __Pyx_RefNannySetupContext("try_parse_date_and_time");
  __pyx_cur_scope = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)__pyx_ptype_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time->tp_new(__pyx_ptype_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_self = __pyx_self;
  {
    PyObject* values[5] = {0,0,0,0,0};

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":533
 * 
 * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times,
 *                             date_parser=None, time_parser=None,             # <<<<<<<<<<<<<<
 *                             dayfirst=False):
 *     cdef:
 */
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    values[4] = __pyx_k_165;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dates);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__times);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("try_parse_date_and_time", 0, 2, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__date_parser);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__time_parser);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dayfirst);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "try_parse_date_and_time") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_dates = ((PyArrayObject *)values[0]);
    __pyx_v_times = ((PyArrayObject *)values[1]);
    __pyx_v_date_parser = values[2];
    __pyx_v_time_parser = values[3];
    __Pyx_INCREF(values[4]);
    __pyx_cur_scope->__pyx_v_dayfirst = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("try_parse_date_and_time", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_dayfirst); __pyx_cur_scope->__pyx_v_dayfirst = 0;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dayfirst);
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_dates.buf = NULL;
  __pyx_bstruct_times.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dates), __pyx_ptype_5numpy_ndarray, 1, "dates", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_times), __pyx_ptype_5numpy_ndarray, 1, "times", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_dates, (PyObject*)__pyx_v_dates, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_dates = __pyx_bstruct_dates.strides[0];
  __pyx_bshape_0_dates = __pyx_bstruct_dates.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_times, (PyObject*)__pyx_v_times, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_times = __pyx_bstruct_times.strides[0];
  __pyx_bshape_0_times = __pyx_bstruct_times.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":539
 *         ndarray[object] result
 * 
 *     from datetime import date, time, datetime             # <<<<<<<<<<<<<<
 * 
 *     n = len(dates)
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__date));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__date));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__date));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__time));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__time));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__time));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime));
  PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__datetime));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__date); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_date = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_time = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":541
 *     from datetime import date, time, datetime
 * 
 *     n = len(dates)             # <<<<<<<<<<<<<<
 *     if len(times) != n:
 *         raise ValueError('Length of dates and times must be equal')
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_dates)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":542
 * 
 *     n = len(dates)
 *     if len(times) != n:             # <<<<<<<<<<<<<<
 *         raise ValueError('Length of dates and times must be equal')
 *     result = np.empty(n, dtype='O')
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_times)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (__pyx_t_3 != __pyx_v_n);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":543
 *     n = len(dates)
 *     if len(times) != n:
 *         raise ValueError('Length of dates and times must be equal')             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype='O')
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_167), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":544
 *     if len(times) != n:
 *         raise ValueError('Length of dates and times must be equal')
 *     result = np.empty(n, dtype='O')             # <<<<<<<<<<<<<<
 * 
 *     if date_parser is None:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":546
 *     result = np.empty(n, dtype='O')
 * 
 *     if date_parser is None:             # <<<<<<<<<<<<<<
 *         try:
 *             from dateutil.parser import parse
 */
  __pyx_t_4 = (__pyx_v_date_parser == Py_None);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":547
 * 
 *     if date_parser is None:
 *         try:             # <<<<<<<<<<<<<<
 *             from dateutil.parser import parse
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":548
 *     if date_parser is None:
 *         try:
 *             from dateutil.parser import parse             # <<<<<<<<<<<<<<
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 *         except ImportError: # pragma: no cover
 */
        __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_INCREF(((PyObject *)__pyx_n_s__parse));
        PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__parse));
        __Pyx_GIVEREF(((PyObject *)__pyx_n_s__parse));
        __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_48), ((PyObject *)__pyx_t_6), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__parse); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_cur_scope->__pyx_v_parse = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":549
 *         try:
 *             from dateutil.parser import parse
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)             # <<<<<<<<<<<<<<
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):
 */
        __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_lambda_methdef_lambda5, ((PyObject*)__pyx_cur_scope), __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v_parse_date = __pyx_t_2;
        __pyx_t_2 = 0;
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":550
 *             from dateutil.parser import parse
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 *         except ImportError: # pragma: no cover             # <<<<<<<<<<<<<<
 *             def parse_date(s):
 *                 try:
 */
      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_5);

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":551
 *             parse_date = lambda x: parse(x, dayfirst=dayfirst)
 *         except ImportError: # pragma: no cover
 *             def parse_date(s):             # <<<<<<<<<<<<<<
 *                 try:
 *                     return date.strptime(s, '%m/%d/%Y')
 */
        __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_parse_date, ((PyObject*)__pyx_cur_scope), __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_parse_date);
        __pyx_v_parse_date = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L9_exception_handled;
      }
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      goto __pyx_L1_error;
      __pyx_L9_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      __pyx_L15_try_end:;
    }
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":557
 *                     return s
 *     else:
 *         parse_date = date_parser             # <<<<<<<<<<<<<<
 * 
 *     if time_parser is None:
 */
    __Pyx_INCREF(__pyx_v_date_parser);
    __pyx_v_parse_date = __pyx_v_date_parser;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":559
 *         parse_date = date_parser
 * 
 *     if time_parser is None:             # <<<<<<<<<<<<<<
 *         try:
 *             from dateutil.parser import parse
 */
  __pyx_t_4 = (__pyx_v_time_parser == Py_None);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":560
 * 
 *     if time_parser is None:
 *         try:             # <<<<<<<<<<<<<<
 *             from dateutil.parser import parse
 *             parse_time = lambda x: parse(x)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":561
 *     if time_parser is None:
 *         try:
 *             from dateutil.parser import parse             # <<<<<<<<<<<<<<
 *             parse_time = lambda x: parse(x)
 *         except ImportError: # pragma: no cover
 */
        __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __Pyx_INCREF(((PyObject *)__pyx_n_s__parse));
        PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__parse));
        __Pyx_GIVEREF(((PyObject *)__pyx_n_s__parse));
        __pyx_t_6 = __Pyx_Import(((PyObject *)__pyx_n_s_48), ((PyObject *)__pyx_t_5), -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__parse); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_parse);
        __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_parse);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_cur_scope->__pyx_v_parse = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":562
 *         try:
 *             from dateutil.parser import parse
 *             parse_time = lambda x: parse(x)             # <<<<<<<<<<<<<<
 *         except ImportError: # pragma: no cover
 *             def parse_time(s):
 */
        __pyx_t_6 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_lambda_methdef_lambda6, ((PyObject*)__pyx_cur_scope), __pyx_n_s_163); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_v_parse_time = __pyx_t_6;
        __pyx_t_6 = 0;
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L26_try_end;
      __pyx_L19_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":563
 *             from dateutil.parser import parse
 *             parse_time = lambda x: parse(x)
 *         except ImportError: # pragma: no cover             # <<<<<<<<<<<<<<
 *             def parse_time(s):
 *                 try:
 */
      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_2);

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":564
 *             parse_time = lambda x: parse(x)
 *         except ImportError: # pragma: no cover
 *             def parse_time(s):             # <<<<<<<<<<<<<<
 *                 try:
 *                     return time.strptime(s, '%H:%M:%S')
 */
        __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_23try_parse_date_and_time_1parse_time, ((PyObject*)__pyx_cur_scope), __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF(__pyx_v_parse_time);
        __pyx_v_parse_time = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L20_exception_handled;
      }
      __pyx_L21_except_error:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L20_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_L26_try_end:;
    }
    goto __pyx_L18;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":571
 * 
 *     else:
 *         parse_time = time_parser             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
    __Pyx_INCREF(__pyx_v_time_parser);
    __pyx_v_parse_time = __pyx_v_time_parser;
  }
  __pyx_L18:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":573
 *         parse_time = time_parser
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         d = parse_date(dates[i])
 *         t = parse_time(times[i])
 */
  __pyx_t_3 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":574
 * 
 *     for i from 0 <= i < n:
 *         d = parse_date(dates[i])             # <<<<<<<<<<<<<<
 *         t = parse_time(times[i])
 *         result[i] = datetime(d.year, d.month, d.day,
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_dates;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_dates)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_dates.buf, __pyx_t_12, __pyx_bstride_0_dates);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_v_parse_date, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_d);
    __pyx_v_d = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":575
 *     for i from 0 <= i < n:
 *         d = parse_date(dates[i])
 *         t = parse_time(times[i])             # <<<<<<<<<<<<<<
 *         result[i] = datetime(d.year, d.month, d.day,
 *                              t.hour, t.minute, t.second)
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_times;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_times)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_times.buf, __pyx_t_13, __pyx_bstride_0_times);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_v_parse_time, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_t);
    __pyx_v_t = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":576
 *         d = parse_date(dates[i])
 *         t = parse_time(times[i])
 *         result[i] = datetime(d.year, d.month, d.day,             # <<<<<<<<<<<<<<
 *                              t.hour, t.minute, t.second)
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__year); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__month); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__day); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":577
 *         t = parse_time(times[i])
 *         result[i] = datetime(d.year, d.month, d.day,
 *                              t.hour, t.minute, t.second)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_t, __pyx_n_s__hour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = PyObject_GetAttr(__pyx_v_t, __pyx_n_s__minute); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = PyObject_GetAttr(__pyx_v_t, __pyx_n_s__second); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = PyTuple_New(6); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_16));
    PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_14);
    __Pyx_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_1 = 0;
    __pyx_t_14 = 0;
    __pyx_t_15 = 0;
    __pyx_t_15 = PyObject_Call(__pyx_v_datetime, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":576
 *         d = parse_date(dates[i])
 *         t = parse_time(times[i])
 *         result[i] = datetime(d.year, d.month, d.day,             # <<<<<<<<<<<<<<
 *                              t.hour, t.minute, t.second)
 * 
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_18 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result);
    __Pyx_GOTREF(*__pyx_t_18);
    __Pyx_DECREF(*__pyx_t_18); __Pyx_INCREF(__pyx_t_15);
    *__pyx_t_18 = __pyx_t_15;
    __Pyx_GIVEREF(*__pyx_t_18);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":579
 *                              t.hour, t.minute, t.second)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dates);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_times);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.try_parse_date_and_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_dates);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_times);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XDECREF(__pyx_v_parse_date);
  __Pyx_XDECREF(__pyx_v_parse_time);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":582
 * 
 * 
 * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months,             # <<<<<<<<<<<<<<
 *                              ndarray[object] days):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_144try_parse_year_month_day(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_144try_parse_year_month_day = {__Pyx_NAMESTR("try_parse_year_month_day"), (PyCFunction)__pyx_pf_6pandas_3lib_144try_parse_year_month_day, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_144try_parse_year_month_day(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_years = 0;
  PyArrayObject *__pyx_v_months = 0;
  PyArrayObject *__pyx_v_days = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_datetime = NULL;
  Py_buffer __pyx_bstruct_months;
  Py_ssize_t __pyx_bstride_0_months = 0;
  Py_ssize_t __pyx_bshape_0_months = 0;
  Py_buffer __pyx_bstruct_days;
  Py_ssize_t __pyx_bstride_0_days = 0;
  Py_ssize_t __pyx_bshape_0_days = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_years;
  Py_ssize_t __pyx_bstride_0_years = 0;
  Py_ssize_t __pyx_bshape_0_years = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyArrayObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  PyObject **__pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__years,&__pyx_n_s__months,&__pyx_n_s__days,0};
  __Pyx_RefNannySetupContext("try_parse_year_month_day");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__years);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__months);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__days);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "try_parse_year_month_day") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_years = ((PyArrayObject *)values[0]);
    __pyx_v_months = ((PyArrayObject *)values[1]);
    __pyx_v_days = ((PyArrayObject *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("try_parse_year_month_day", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.try_parse_year_month_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_years.buf = NULL;
  __pyx_bstruct_months.buf = NULL;
  __pyx_bstruct_days.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_years), __pyx_ptype_5numpy_ndarray, 1, "years", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_months), __pyx_ptype_5numpy_ndarray, 1, "months", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_days), __pyx_ptype_5numpy_ndarray, 1, "days", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_years, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_years = __pyx_bstruct_years.strides[0];
  __pyx_bshape_0_years = __pyx_bstruct_years.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_months, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_months = __pyx_bstruct_months.strides[0];
  __pyx_bshape_0_months = __pyx_bstruct_months.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_days, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_days = __pyx_bstruct_days.strides[0];
  __pyx_bshape_0_days = __pyx_bstruct_days.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":588
 *         ndarray[object] result
 * 
 *     from datetime import datetime             # <<<<<<<<<<<<<<
 * 
 *     n = len(years)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__datetime));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":590
 *     from datetime import datetime
 * 
 *     n = len(years)             # <<<<<<<<<<<<<<
 *     if len(months) != n or len(days) != n:
 *         raise ValueError('Length of years/months/days must all be equal')
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_years)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":591
 * 
 *     n = len(years)
 *     if len(months) != n or len(days) != n:             # <<<<<<<<<<<<<<
 *         raise ValueError('Length of years/months/days must all be equal')
 *     result = np.empty(n, dtype='O')
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_months)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (__pyx_t_3 != __pyx_v_n);
  if (!__pyx_t_4) {
    __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_days)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = (__pyx_t_3 != __pyx_v_n);
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":592
 *     n = len(years)
 *     if len(months) != n or len(days) != n:
 *         raise ValueError('Length of years/months/days must all be equal')             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype='O')
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_169), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":593
 *     if len(months) != n or len(days) != n:
 *         raise ValueError('Length of years/months/days must all be equal')
 *     result = np.empty(n, dtype='O')             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((PyArrayObject *)__pyx_t_8);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_10 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_9 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":595
 *     result = np.empty(n, dtype='O')
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         result[i] = datetime(int(years[i]), int(months[i]), int(days[i]))
 * 
 */
  __pyx_t_3 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":596
 * 
 *     for i from 0 <= i < n:
 *         result[i] = datetime(int(years[i]), int(months[i]), int(days[i]))             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_years;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_years)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_years.buf, __pyx_t_14, __pyx_bstride_0_years);
    __Pyx_INCREF((PyObject*)__pyx_t_8);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_bshape_0_months;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_months)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_months.buf, __pyx_t_15, __pyx_bstride_0_months);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_16 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_16 < 0) {
      __pyx_t_16 += __pyx_bshape_0_days;
      if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_days)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_days.buf, __pyx_t_16, __pyx_bstride_0_days);
    __Pyx_INCREF((PyObject*)__pyx_t_7);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_8 = 0;
    __pyx_t_2 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_v_datetime, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_10 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_result)) __pyx_t_10 = 0;
    if (unlikely(__pyx_t_10 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_10);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_18 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result);
    __Pyx_GOTREF(*__pyx_t_18);
    __Pyx_DECREF(*__pyx_t_18); __Pyx_INCREF(__pyx_t_7);
    *__pyx_t_18 = __pyx_t_7;
    __Pyx_GIVEREF(*__pyx_t_18);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":598
 *         result[i] = datetime(int(years[i]), int(months[i]), int(days[i]))
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def try_parse_datetime_components(ndarray[object] years, ndarray[object] months,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_months);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_days);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_years);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.try_parse_year_month_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_months);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_days);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_years);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":600
 *     return result
 * 
 * def try_parse_datetime_components(ndarray[object] years, ndarray[object] months,             # <<<<<<<<<<<<<<
 *     ndarray[object] days, ndarray[object] hours, ndarray[object] minutes,
 *     ndarray[object] seconds):
 */

static PyObject *__pyx_pf_6pandas_3lib_145try_parse_datetime_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_145try_parse_datetime_components = {__Pyx_NAMESTR("try_parse_datetime_components"), (PyCFunction)__pyx_pf_6pandas_3lib_145try_parse_datetime_components, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_145try_parse_datetime_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_years = 0;
  PyArrayObject *__pyx_v_months = 0;
  PyArrayObject *__pyx_v_days = 0;
  PyArrayObject *__pyx_v_hours = 0;
  PyArrayObject *__pyx_v_minutes = 0;
  PyArrayObject *__pyx_v_seconds = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_datetime = NULL;
  Py_buffer __pyx_bstruct_seconds;
  Py_ssize_t __pyx_bstride_0_seconds = 0;
  Py_ssize_t __pyx_bshape_0_seconds = 0;
  Py_buffer __pyx_bstruct_months;
  Py_ssize_t __pyx_bstride_0_months = 0;
  Py_ssize_t __pyx_bshape_0_months = 0;
  Py_buffer __pyx_bstruct_days;
  Py_ssize_t __pyx_bstride_0_days = 0;
  Py_ssize_t __pyx_bshape_0_days = 0;
  Py_buffer __pyx_bstruct_years;
  Py_ssize_t __pyx_bstride_0_years = 0;
  Py_ssize_t __pyx_bshape_0_years = 0;
  Py_buffer __pyx_bstruct_hours;
  Py_ssize_t __pyx_bstride_0_hours = 0;
  Py_ssize_t __pyx_bshape_0_hours = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_minutes;
  Py_ssize_t __pyx_bstride_0_minutes = 0;
  Py_ssize_t __pyx_bshape_0_minutes = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyArrayObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  Py_ssize_t __pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  Py_ssize_t __pyx_t_24;
  PyObject *__pyx_t_25 = NULL;
  Py_ssize_t __pyx_t_26;
  PyObject **__pyx_t_27;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__years,&__pyx_n_s__months,&__pyx_n_s__days,&__pyx_n_s__hours,&__pyx_n_s__minutes,&__pyx_n_s__seconds,0};
  __Pyx_RefNannySetupContext("try_parse_datetime_components");
  __pyx_self = __pyx_self;
  {
    PyObject* values[6] = {0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__years);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__months);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__days);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__hours);
        if (likely(values[3])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minutes);
        if (likely(values[4])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seconds);
        if (likely(values[5])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, 5); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "try_parse_datetime_components") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
    }
    __pyx_v_years = ((PyArrayObject *)values[0]);
    __pyx_v_months = ((PyArrayObject *)values[1]);
    __pyx_v_days = ((PyArrayObject *)values[2]);
    __pyx_v_hours = ((PyArrayObject *)values[3]);
    __pyx_v_minutes = ((PyArrayObject *)values[4]);
    __pyx_v_seconds = ((PyArrayObject *)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("try_parse_datetime_components", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.try_parse_datetime_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_years.buf = NULL;
  __pyx_bstruct_months.buf = NULL;
  __pyx_bstruct_days.buf = NULL;
  __pyx_bstruct_hours.buf = NULL;
  __pyx_bstruct_minutes.buf = NULL;
  __pyx_bstruct_seconds.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_years), __pyx_ptype_5numpy_ndarray, 1, "years", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_months), __pyx_ptype_5numpy_ndarray, 1, "months", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_days), __pyx_ptype_5numpy_ndarray, 1, "days", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hours), __pyx_ptype_5numpy_ndarray, 1, "hours", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_minutes), __pyx_ptype_5numpy_ndarray, 1, "minutes", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seconds), __pyx_ptype_5numpy_ndarray, 1, "seconds", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_years, (PyObject*)__pyx_v_years, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_years = __pyx_bstruct_years.strides[0];
  __pyx_bshape_0_years = __pyx_bstruct_years.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_months, (PyObject*)__pyx_v_months, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_months = __pyx_bstruct_months.strides[0];
  __pyx_bshape_0_months = __pyx_bstruct_months.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_days, (PyObject*)__pyx_v_days, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_days = __pyx_bstruct_days.strides[0];
  __pyx_bshape_0_days = __pyx_bstruct_days.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_hours, (PyObject*)__pyx_v_hours, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_hours = __pyx_bstruct_hours.strides[0];
  __pyx_bshape_0_hours = __pyx_bstruct_hours.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_minutes, (PyObject*)__pyx_v_minutes, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_minutes = __pyx_bstruct_minutes.strides[0];
  __pyx_bshape_0_minutes = __pyx_bstruct_minutes.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_seconds, (PyObject*)__pyx_v_seconds, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_seconds = __pyx_bstruct_seconds.strides[0];
  __pyx_bshape_0_seconds = __pyx_bstruct_seconds.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":608
 *         ndarray[object] result
 * 
 *     from datetime import datetime             # <<<<<<<<<<<<<<
 * 
 *     n = len(years)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__datetime));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_datetime = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":610
 *     from datetime import datetime
 * 
 *     n = len(years)             # <<<<<<<<<<<<<<
 *     if (len(months) != n and len(days) != n and len(hours) != n and
 *         len(minutes) != n and len(seconds) != n):
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_years)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":611
 * 
 *     n = len(years)
 *     if (len(months) != n and len(days) != n and len(hours) != n and             # <<<<<<<<<<<<<<
 *         len(minutes) != n and len(seconds) != n):
 *         raise ValueError('Length of all datetime components must be equal')
 */
  __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_months)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (__pyx_t_3 != __pyx_v_n);
  if (__pyx_t_4) {
    __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_days)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = (__pyx_t_3 != __pyx_v_n);
    if (__pyx_t_5) {
      __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_hours)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = (__pyx_t_3 != __pyx_v_n);
      if (__pyx_t_6) {

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":612
 *     n = len(years)
 *     if (len(months) != n and len(days) != n and len(hours) != n and
 *         len(minutes) != n and len(seconds) != n):             # <<<<<<<<<<<<<<
 *         raise ValueError('Length of all datetime components must be equal')
 *     result = np.empty(n, dtype='O')
 */
        __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_minutes)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = (__pyx_t_3 != __pyx_v_n);
        if (__pyx_t_7) {
          __pyx_t_3 = PyObject_Length(((PyObject *)__pyx_v_seconds)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_8 = (__pyx_t_3 != __pyx_v_n);
          __pyx_t_9 = __pyx_t_8;
        } else {
          __pyx_t_9 = __pyx_t_7;
        }
        __pyx_t_7 = __pyx_t_9;
      } else {
        __pyx_t_7 = __pyx_t_6;
      }
      __pyx_t_6 = __pyx_t_7;
    } else {
      __pyx_t_6 = __pyx_t_5;
    }
    __pyx_t_5 = __pyx_t_6;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":613
 *     if (len(months) != n and len(days) != n and len(hours) != n and
 *         len(minutes) != n and len(seconds) != n):
 *         raise ValueError('Length of all datetime components must be equal')             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype='O')
 * 
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_171), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":614
 *         len(minutes) != n and len(seconds) != n):
 *         raise ValueError('Length of all datetime components must be equal')
 *     result = np.empty(n, dtype='O')             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_10));
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_13 < 0)) {
      PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_12 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":616
 *     result = np.empty(n, dtype='O')
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         result[i] = datetime(int(years[i]), int(months[i]), int(days[i]),
 *                              int(hours[i]), int(minutes[i]), int(seconds[i]))
 */
  __pyx_t_3 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":617
 * 
 *     for i from 0 <= i < n:
 *         result[i] = datetime(int(years[i]), int(months[i]), int(days[i]),             # <<<<<<<<<<<<<<
 *                              int(hours[i]), int(minutes[i]), int(seconds[i]))
 * 
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_17 < 0) {
      __pyx_t_17 += __pyx_bshape_0_years;
      if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_years)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_years.buf, __pyx_t_17, __pyx_bstride_0_years);
    __Pyx_INCREF((PyObject*)__pyx_t_11);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_11 = 0;
    __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_18 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_18 < 0) {
      __pyx_t_18 += __pyx_bshape_0_months;
      if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_months)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_months.buf, __pyx_t_18, __pyx_bstride_0_months);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_10));
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
    __pyx_t_19 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_19 < 0) {
      __pyx_t_19 += __pyx_bshape_0_days;
      if (unlikely(__pyx_t_19 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_days)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_days.buf, __pyx_t_19, __pyx_bstride_0_days);
    __Pyx_INCREF((PyObject*)__pyx_t_10);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":618
 *     for i from 0 <= i < n:
 *         result[i] = datetime(int(years[i]), int(months[i]), int(days[i]),
 *                              int(hours[i]), int(minutes[i]), int(seconds[i]))             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_t_20 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_20 < 0) {
      __pyx_t_20 += __pyx_bshape_0_hours;
      if (unlikely(__pyx_t_20 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_20 >= __pyx_bshape_0_hours)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_hours.buf, __pyx_t_20, __pyx_bstride_0_hours);
    __Pyx_INCREF((PyObject*)__pyx_t_1);
    __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_21));
    PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_21), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_bshape_0_minutes;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_minutes)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_21 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_minutes.buf, __pyx_t_22, __pyx_bstride_0_minutes);
    __Pyx_INCREF((PyObject*)__pyx_t_21);
    __pyx_t_23 = PyTuple_New(1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_23));
    PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_21);
    __Pyx_GIVEREF(__pyx_t_21);
    __pyx_t_21 = 0;
    __pyx_t_21 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_23), NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_DECREF(((PyObject *)__pyx_t_23)); __pyx_t_23 = 0;
    __pyx_t_24 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_24 < 0) {
      __pyx_t_24 += __pyx_bshape_0_seconds;
      if (unlikely(__pyx_t_24 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_24 >= __pyx_bshape_0_seconds)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_23 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_seconds.buf, __pyx_t_24, __pyx_bstride_0_seconds);
    __Pyx_INCREF((PyObject*)__pyx_t_23);
    __pyx_t_25 = PyTuple_New(1); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_25));
    PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_23);
    __Pyx_GIVEREF(__pyx_t_23);
    __pyx_t_23 = 0;
    __pyx_t_23 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_25), NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_DECREF(((PyObject *)__pyx_t_25)); __pyx_t_25 = 0;
    __pyx_t_25 = PyTuple_New(6); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_25));
    PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_25, 3, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_25, 4, __pyx_t_21);
    __Pyx_GIVEREF(__pyx_t_21);
    PyTuple_SET_ITEM(__pyx_t_25, 5, __pyx_t_23);
    __Pyx_GIVEREF(__pyx_t_23);
    __pyx_t_11 = 0;
    __pyx_t_2 = 0;
    __pyx_t_10 = 0;
    __pyx_t_1 = 0;
    __pyx_t_21 = 0;
    __pyx_t_23 = 0;
    __pyx_t_23 = PyObject_Call(__pyx_v_datetime, ((PyObject *)__pyx_t_25), NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_DECREF(((PyObject *)__pyx_t_25)); __pyx_t_25 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":617
 * 
 *     for i from 0 <= i < n:
 *         result[i] = datetime(int(years[i]), int(months[i]), int(days[i]),             # <<<<<<<<<<<<<<
 *                              int(hours[i]), int(minutes[i]), int(seconds[i]))
 * 
 */
    __pyx_t_26 = __pyx_v_i;
    __pyx_t_13 = -1;
    if (__pyx_t_26 < 0) {
      __pyx_t_26 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_26 < 0)) __pyx_t_13 = 0;
    } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_result)) __pyx_t_13 = 0;
    if (unlikely(__pyx_t_13 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_13);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_27 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_26, __pyx_bstride_0_result);
    __Pyx_GOTREF(*__pyx_t_27);
    __Pyx_DECREF(*__pyx_t_27); __Pyx_INCREF(__pyx_t_23);
    *__pyx_t_27 = __pyx_t_23;
    __Pyx_GIVEREF(*__pyx_t_27);
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":620
 *                              int(hours[i]), int(minutes[i]), int(seconds[i]))
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def sanitize_objects(ndarray[object] values, set na_values,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_25);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_seconds);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_months);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_days);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_years);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_hours);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minutes);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.try_parse_datetime_components", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_seconds);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_months);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_days);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_years);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_hours);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_minutes);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_datetime);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":622
 *     return result
 * 
 * def sanitize_objects(ndarray[object] values, set na_values,             # <<<<<<<<<<<<<<
 *                      convert_empty=True):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_146sanitize_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_146sanitize_objects = {__Pyx_NAMESTR("sanitize_objects"), (PyCFunction)__pyx_pf_6pandas_3lib_146sanitize_objects, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_146sanitize_objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_values = 0;
  PyObject *__pyx_v_na_values = 0;
  PyObject *__pyx_v_convert_empty = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_onan = 0;
  Py_ssize_t __pyx_v_na_count;
  PyObject *__pyx_v_memo = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject **__pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__values,&__pyx_n_s__na_values,&__pyx_n_s__convert_empty,0};
  __Pyx_RefNannySetupContext("sanitize_objects");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_172;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__na_values);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("sanitize_objects", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__convert_empty);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "sanitize_objects") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_values = ((PyArrayObject *)values[0]);
    __pyx_v_na_values = ((PyObject*)values[1]);
    __pyx_v_convert_empty = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sanitize_objects", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.sanitize_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_values.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_na_values), (&PySet_Type), 1, "na_values", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
  __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":627
 *         Py_ssize_t i, n
 *         object val, onan
 *         Py_ssize_t na_count = 0             # <<<<<<<<<<<<<<
 *         dict memo = {}
 * 
 */
  __pyx_v_na_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":628
 *         object val, onan
 *         Py_ssize_t na_count = 0
 *         dict memo = {}             # <<<<<<<<<<<<<<
 * 
 *     n = len(values)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_memo = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":630
 *         dict memo = {}
 * 
 *     n = len(values)             # <<<<<<<<<<<<<<
 *     onan = np.nan
 * 
 */
  __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_2;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":631
 * 
 *     n = len(values)
 *     onan = np.nan             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__nan); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_onan = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":633
 *     onan = np.nan
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         val = values[i]
 *         if (convert_empty and val == '') or (val in na_values):
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":634
 * 
 *     for i from 0 <= i < n:
 *         val = values[i]             # <<<<<<<<<<<<<<
 *         if (convert_empty and val == '') or (val in na_values):
 *             values[i] = onan
 */
    __pyx_t_4 = __pyx_v_i;
    __pyx_t_5 = -1;
    if (__pyx_t_4 < 0) {
      __pyx_t_4 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
    } else if (unlikely(__pyx_t_4 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
    if (unlikely(__pyx_t_5 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_5);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_4, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_3);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":635
 *     for i from 0 <= i < n:
 *         val = values[i]
 *         if (convert_empty and val == '') or (val in na_values):             # <<<<<<<<<<<<<<
 *             values[i] = onan
 *             na_count += 1
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_convert_empty); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_6) {
      __pyx_t_7 = __Pyx_PyString_Equals(__pyx_v_val, ((PyObject *)__pyx_kp_s_173), Py_EQ); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = __pyx_t_7;
    } else {
      __pyx_t_8 = __pyx_t_6;
    }
    if (!__pyx_t_8) {
      __pyx_t_6 = ((PySequence_Contains(((PyObject *)__pyx_v_na_values), __pyx_v_val))); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = __pyx_t_6;
    } else {
      __pyx_t_7 = __pyx_t_8;
    }
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":636
 *         val = values[i]
 *         if (convert_empty and val == '') or (val in na_values):
 *             values[i] = onan             # <<<<<<<<<<<<<<
 *             na_count += 1
 *         elif val in memo:
 */
      __pyx_t_9 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_9 < 0) {
        __pyx_t_9 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_9, __pyx_bstride_0_values);
      __Pyx_GOTREF(*__pyx_t_10);
      __Pyx_DECREF(*__pyx_t_10); __Pyx_INCREF(__pyx_v_onan);
      *__pyx_t_10 = __pyx_v_onan;
      __Pyx_GIVEREF(*__pyx_t_10);

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":637
 *         if (convert_empty and val == '') or (val in na_values):
 *             values[i] = onan
 *             na_count += 1             # <<<<<<<<<<<<<<
 *         elif val in memo:
 *             values[i] = memo[val]
 */
      __pyx_v_na_count = (__pyx_v_na_count + 1);
      goto __pyx_L8;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":638
 *             values[i] = onan
 *             na_count += 1
 *         elif val in memo:             # <<<<<<<<<<<<<<
 *             values[i] = memo[val]
 *         else:
 */
    if (unlikely(((PyObject *)__pyx_v_memo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_7 = ((PyDict_Contains(((PyObject *)__pyx_v_memo), __pyx_v_val))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":639
 *             na_count += 1
 *         elif val in memo:
 *             values[i] = memo[val]             # <<<<<<<<<<<<<<
 *         else:
 *             memo[val] = val
 */
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_memo), __pyx_v_val); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_11 = __pyx_v_i;
      __pyx_t_5 = -1;
      if (__pyx_t_11 < 0) {
        __pyx_t_11 += __pyx_bshape_0_values;
        if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0;
      } else if (unlikely(__pyx_t_11 >= __pyx_bshape_0_values)) __pyx_t_5 = 0;
      if (unlikely(__pyx_t_5 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_5);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_10 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_11, __pyx_bstride_0_values);
      __Pyx_GOTREF(*__pyx_t_10);
      __Pyx_DECREF(*__pyx_t_10); __Pyx_INCREF(__pyx_t_3);
      *__pyx_t_10 = __pyx_t_3;
      __Pyx_GIVEREF(*__pyx_t_10);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":641
 *             values[i] = memo[val]
 *         else:
 *             memo[val] = val             # <<<<<<<<<<<<<<
 * 
 *     return na_count
 */
      if (PyDict_SetItem(((PyObject *)__pyx_v_memo), __pyx_v_val, __pyx_v_val) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":643
 *             memo[val] = val
 * 
 *     return na_count             # <<<<<<<<<<<<<<
 * 
 * def maybe_convert_bool(ndarray[object] arr):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_na_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.sanitize_objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_onan);
  __Pyx_XDECREF(__pyx_v_memo);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":645
 *     return na_count
 * 
 * def maybe_convert_bool(ndarray[object] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */

static PyObject *__pyx_pf_6pandas_3lib_147maybe_convert_bool(PyObject *__pyx_self, PyObject *__pyx_v_arr); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_147maybe_convert_bool = {__Pyx_NAMESTR("maybe_convert_bool"), (PyCFunction)__pyx_pf_6pandas_3lib_147maybe_convert_bool, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_147maybe_convert_bool(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_val = 0;
  Py_buffer __pyx_bstruct_arr;
  Py_ssize_t __pyx_bstride_0_arr = 0;
  Py_ssize_t __pyx_bshape_0_arr = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("maybe_convert_bool");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_arr.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_arr, (PyObject*)__pyx_v_arr, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_arr = __pyx_bstruct_arr.strides[0];
  __pyx_bshape_0_arr = __pyx_bstruct_arr.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":651
 *         object val
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype=np.uint8)
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":652
 * 
 *     n = len(arr)
 *     result = np.empty(n, dtype=np.uint8)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__uint8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":654
 *     result = np.empty(n, dtype=np.uint8)
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         val = arr[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":655
 * 
 *     for i from 0 <= i < n:
 *         val = arr[i]             # <<<<<<<<<<<<<<
 * 
 *         if val == 'True' or type(val) == bool and val:
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_12 < 0) {
      __pyx_t_12 += __pyx_bshape_0_arr;
      if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_arr)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_arr.buf, __pyx_t_12, __pyx_bstride_0_arr);
    __Pyx_INCREF((PyObject*)__pyx_t_6);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":657
 *         val = arr[i]
 * 
 *         if val == 'True' or type(val) == bool and val:             # <<<<<<<<<<<<<<
 *             result[i] = 1
 *         elif val == 'False' or type(val) == bool and not val:
 */
    __pyx_t_13 = __Pyx_PyString_Equals(__pyx_v_val, ((PyObject *)__pyx_n_s__True), Py_EQ); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_13) {
      __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), ((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)), Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_14) {
        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_14;
      }
      __pyx_t_14 = __pyx_t_16;
    } else {
      __pyx_t_14 = __pyx_t_13;
    }
    if (__pyx_t_14) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":658
 * 
 *         if val == 'True' or type(val) == bool and val:
 *             result[i] = 1             # <<<<<<<<<<<<<<
 *         elif val == 'False' or type(val) == bool and not val:
 *             result[i] = 0
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result) = 1;
      goto __pyx_L7;
    }

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":659
 *         if val == 'True' or type(val) == bool and val:
 *             result[i] = 1
 *         elif val == 'False' or type(val) == bool and not val:             # <<<<<<<<<<<<<<
 *             result[i] = 0
 *         else:
 */
    __pyx_t_14 = __Pyx_PyString_Equals(__pyx_v_val, ((PyObject *)__pyx_n_s__False), Py_EQ); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_14) {
      __pyx_t_6 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_val)), ((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool)), Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_13) {
        __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_15 = (!__pyx_t_16);
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_13;
      }
      __pyx_t_13 = __pyx_t_16;
    } else {
      __pyx_t_13 = __pyx_t_14;
    }
    if (__pyx_t_13) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":660
 *             result[i] = 1
 *         elif val == 'False' or type(val) == bool and not val:
 *             result[i] = 0             # <<<<<<<<<<<<<<
 *         else:
 *             return arr
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_result.buf, __pyx_t_18, __pyx_bstride_0_result) = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":662
 *             result[i] = 0
 *         else:
 *             return arr             # <<<<<<<<<<<<<<
 * 
 *     return result.view(np.bool_)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_arr);
      __pyx_r = __pyx_v_arr;
      goto __pyx_L0;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":664
 *             return arr
 * 
 *     return result.view(np.bool_)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n_s__view); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__bool_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.maybe_convert_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_arr);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":667
 * 
 * 
 * def map_infer(ndarray arr, object f, bint convert=1):             # <<<<<<<<<<<<<<
 *     '''
 *     Substitute for np.vectorize with pandas-friendly dtype inference
 */

static PyObject *__pyx_pf_6pandas_3lib_148map_infer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_148map_infer[] = "\n    Substitute for np.vectorize with pandas-friendly dtype inference\n\n    Parameters\n    ----------\n    arr : ndarray\n    f : function\n\n    Returns\n    -------\n    mapped : ndarray\n    ";
static PyMethodDef __pyx_mdef_6pandas_3lib_148map_infer = {__Pyx_NAMESTR("map_infer"), (PyCFunction)__pyx_pf_6pandas_3lib_148map_infer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_148map_infer)};
static PyObject *__pyx_pf_6pandas_3lib_148map_infer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_f = 0;
  int __pyx_v_convert;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_val = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject **__pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__f,&__pyx_n_s__convert,0};
  __Pyx_RefNannySetupContext("map_infer");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("map_infer", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__convert);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "map_infer") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_f = values[1];
    if (values[2]) {
      __pyx_v_convert = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_convert == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_convert = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_infer", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.map_infer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":685
 *         object val
 * 
 *     n = len(arr)             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype=object)
 *     for i in range(n):
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_arr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":686
 * 
 *     n = len(arr)
 *     result = np.empty(n, dtype=object)             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         val = f(util.get_value_at(arr, i))
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":687
 *     n = len(arr)
 *     result = np.empty(n, dtype=object)
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = f(util.get_value_at(arr, i))
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_1; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":688
 *     result = np.empty(n, dtype=object)
 *     for i in range(n):
 *         val = f(util.get_value_at(arr, i))             # <<<<<<<<<<<<<<
 * 
 *         # unbox 0-dim arrays, GH #690
 */
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_v_f, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":691
 * 
 *         # unbox 0-dim arrays, GH #690
 *         if is_array(val) and PyArray_NDIM(val) == 0:             # <<<<<<<<<<<<<<
 *             # is there a faster way to unbox?
 *             val = val.item()
 */
    __pyx_t_2 = __pyx_f_4util_is_array(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_12) {
      if (!(likely(((__pyx_v_val) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_val, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __pyx_v_val;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_13 = (PyArray_NDIM(((PyArrayObject *)__pyx_t_2)) == 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = __pyx_t_13;
    } else {
      __pyx_t_14 = __pyx_t_12;
    }
    if (__pyx_t_14) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":693
 *         if is_array(val) and PyArray_NDIM(val) == 0:
 *             # is there a faster way to unbox?
 *             val = val.item()             # <<<<<<<<<<<<<<
 * 
 *         result[i] = val
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":695
 *             val = val.item()
 * 
 *         result[i] = val             # <<<<<<<<<<<<<<
 * 
 *     if convert:
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_bshape_0_result;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_result)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_15, __pyx_bstride_0_result);
    __Pyx_GOTREF(*__pyx_t_16);
    __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_v_val);
    *__pyx_t_16 = __pyx_v_val;
    __Pyx_GIVEREF(*__pyx_t_16);
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":697
 *         result[i] = val
 * 
 *     if convert:             # <<<<<<<<<<<<<<
 *         return maybe_convert_objects(result, try_float=0,
 *                                      convert_datetime=0)
 */
  if (__pyx_v_convert) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":698
 * 
 *     if convert:
 *         return maybe_convert_objects(result, try_float=0,             # <<<<<<<<<<<<<<
 *                                      convert_datetime=0)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s_89); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__try_float), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__convert_datetime), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":701
 *                                      convert_datetime=0)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def to_object_array(list rows):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.map_infer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":703
 *     return result
 * 
 * def to_object_array(list rows):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, n, k, tmp
 */

static PyObject *__pyx_pf_6pandas_3lib_149to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_rows); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_149to_object_array = {__Pyx_NAMESTR("to_object_array"), (PyCFunction)__pyx_pf_6pandas_3lib_149to_object_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_149to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_rows) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_tmp;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_row = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject **__pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_object_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rows), (&PyList_Type), 1, "rows", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":709
 *         list row
 * 
 *     n = len(rows)             # <<<<<<<<<<<<<<
 * 
 *     k = 0
 */
  if (unlikely(((PyObject *)__pyx_v_rows) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_rows)); 
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":711
 *     n = len(rows)
 * 
 *     k = 0             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         tmp = len(rows[i])
 */
  __pyx_v_k = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":712
 * 
 *     k = 0
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         tmp = len(rows[i])
 *         if tmp > k:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":713
 *     k = 0
 *     for i from 0 <= i < n:
 *         tmp = len(rows[i])             # <<<<<<<<<<<<<<
 *         if tmp > k:
 *             k = tmp
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_rows), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_tmp = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":714
 *     for i from 0 <= i < n:
 *         tmp = len(rows[i])
 *         if tmp > k:             # <<<<<<<<<<<<<<
 *             k = tmp
 * 
 */
    __pyx_t_4 = (__pyx_v_tmp > __pyx_v_k);
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":715
 *         tmp = len(rows[i])
 *         if tmp > k:
 *             k = tmp             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty((n, k), dtype=object)
 */
      __pyx_v_k = __pyx_v_tmp;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":717
 *             k = tmp
 * 
 *     result = np.empty((n, k), dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     for i from 0 <= i < n:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":719
 *     result = np.empty((n, k), dtype=object)
 * 
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         row = rows[i]
 * 
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":720
 * 
 *     for i from 0 <= i < n:
 *         row = rows[i]             # <<<<<<<<<<<<<<
 * 
 *         for j from 0 <= j < len(row):
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_rows), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_row));
    __pyx_v_row = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":722
 *         row = rows[i]
 * 
 *         for j from 0 <= j < len(row):             # <<<<<<<<<<<<<<
 *             result[i, j] = row[j]
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_row) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_row)); 
    for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":723
 * 
 *         for j from 0 <= j < len(row):
 *             result[i, j] = row[j]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_row), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_13 = __pyx_v_i;
      __pyx_t_14 = __pyx_v_j;
      __pyx_t_9 = -1;
      if (__pyx_t_13 < 0) {
        __pyx_t_13 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
      } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_result)) __pyx_t_9 = 0;
      if (__pyx_t_14 < 0) {
        __pyx_t_14 += __pyx_bshape_1_result;
        if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1;
      } else if (unlikely(__pyx_t_14 >= __pyx_bshape_1_result)) __pyx_t_9 = 1;
      if (unlikely(__pyx_t_9 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_9);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_15 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_13, __pyx_bstride_0_result, __pyx_t_14, __pyx_bstride_1_result);
      __Pyx_GOTREF(*__pyx_t_15);
      __Pyx_DECREF(*__pyx_t_15); __Pyx_INCREF(__pyx_t_2);
      *__pyx_t_15 = __pyx_t_2;
      __Pyx_GIVEREF(*__pyx_t_15);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":725
 *             result[i, j] = row[j]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def tuples_to_object_array(ndarray[object] tuples):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":727
 *     return result
 * 
 * def tuples_to_object_array(ndarray[object] tuples):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, n, k, tmp
 */

static PyObject *__pyx_pf_6pandas_3lib_150tuples_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_tuples); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_150tuples_to_object_array = {__Pyx_NAMESTR("tuples_to_object_array"), (PyCFunction)__pyx_pf_6pandas_3lib_150tuples_to_object_array, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_150tuples_to_object_array(PyObject *__pyx_self, PyObject *__pyx_v_tuples) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_k;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_tup = 0;
  Py_buffer __pyx_bstruct_tuples;
  Py_ssize_t __pyx_bstride_0_tuples = 0;
  Py_ssize_t __pyx_bshape_0_tuples = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  long __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  PyObject **__pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tuples_to_object_array");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_tuples.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tuples), __pyx_ptype_5numpy_ndarray, 1, "tuples", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_tuples, (PyObject*)__pyx_v_tuples, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_tuples = __pyx_bstruct_tuples.strides[0];
  __pyx_bshape_0_tuples = __pyx_bstruct_tuples.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":733
 *         tuple tup
 * 
 *     n = len(tuples)             # <<<<<<<<<<<<<<
 *     k = len(tuples[0])
 *     result = np.empty((n, k), dtype=object)
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_tuples); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":734
 * 
 *     n = len(tuples)
 *     k = len(tuples[0])             # <<<<<<<<<<<<<<
 *     result = np.empty((n, k), dtype=object)
 *     for i in range(n):
 */
  __pyx_t_3 = 0;
  __pyx_t_4 = -1;
  if (__pyx_t_3 < 0) {
    __pyx_t_3 += __pyx_bshape_0_tuples;
    if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
  } else if (unlikely(__pyx_t_3 >= __pyx_bshape_0_tuples)) __pyx_t_4 = 0;
  if (unlikely(__pyx_t_4 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_4);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_tuples.buf, __pyx_t_3, __pyx_bstride_0_tuples);
  __Pyx_INCREF((PyObject*)__pyx_t_2);
  __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_k = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":735
 *     n = len(tuples)
 *     k = len(tuples[0])
 *     result = np.empty((n, k), dtype=object)             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         tup = tuples[i]
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_4 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":736
 *     k = len(tuples[0])
 *     result = np.empty((n, k), dtype=object)
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         tup = tuples[i]
 *         for j in range(k):
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":737
 *     result = np.empty((n, k), dtype=object)
 *     for i in range(n):
 *         tup = tuples[i]             # <<<<<<<<<<<<<<
 *         for j in range(k):
 *             result[i, j] = tup[j]
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_4 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_tuples;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_4 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_tuples)) __pyx_t_4 = 0;
    if (unlikely(__pyx_t_4 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_4);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_tuples.buf, __pyx_t_13, __pyx_bstride_0_tuples);
    __Pyx_INCREF((PyObject*)__pyx_t_2);
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_tup));
    __pyx_v_tup = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":738
 *     for i in range(n):
 *         tup = tuples[i]
 *         for j in range(k):             # <<<<<<<<<<<<<<
 *             result[i, j] = tup[j]
 * 
 */
    __pyx_t_14 = __pyx_v_k;
    for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
      __pyx_v_j = __pyx_t_15;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":739
 *         tup = tuples[i]
 *         for j in range(k):
 *             result[i, j] = tup[j]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_tup), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_17 = __pyx_v_j;
      __pyx_t_4 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_4 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_result)) __pyx_t_4 = 0;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_1_result;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_4 = 1;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_1_result)) __pyx_t_4 = 1;
      if (unlikely(__pyx_t_4 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_4);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_18 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_16, __pyx_bstride_0_result, __pyx_t_17, __pyx_bstride_1_result);
      __Pyx_GOTREF(*__pyx_t_18);
      __Pyx_DECREF(*__pyx_t_18); __Pyx_INCREF(__pyx_t_2);
      *__pyx_t_18 = __pyx_t_2;
      __Pyx_GIVEREF(*__pyx_t_18);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":741
 *             result[i, j] = tup[j]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * def to_object_array_tuples(list rows):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_tuples);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.tuples_to_object_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_tuples);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":743
 *     return result
 * 
 * def to_object_array_tuples(list rows):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, n, k, tmp
 */

static PyObject *__pyx_pf_6pandas_3lib_151to_object_array_tuples(PyObject *__pyx_self, PyObject *__pyx_v_rows); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_151to_object_array_tuples = {__Pyx_NAMESTR("to_object_array_tuples"), (PyCFunction)__pyx_pf_6pandas_3lib_151to_object_array_tuples, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_151to_object_array_tuples(PyObject *__pyx_self, PyObject *__pyx_v_rows) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_n;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_tmp;
  PyArrayObject *__pyx_v_result = 0;
  PyObject *__pyx_v_row = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bstride_1_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_ssize_t __pyx_bshape_1_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyArrayObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject **__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_object_array_tuples");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rows), (&PyList_Type), 1, "rows", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":749
 *         tuple row
 * 
 *     n = len(rows)             # <<<<<<<<<<<<<<
 * 
 *     k = 0
 */
  if (unlikely(((PyObject *)__pyx_v_rows) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_v_rows)); 
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":751
 *     n = len(rows)
 * 
 *     k = 0             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         tmp = len(rows[i])
 */
  __pyx_v_k = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":752
 * 
 *     k = 0
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         tmp = len(rows[i])
 *         if tmp > k:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":753
 *     k = 0
 *     for i from 0 <= i < n:
 *         tmp = len(rows[i])             # <<<<<<<<<<<<<<
 *         if tmp > k:
 *             k = tmp
 */
    __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_rows), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_tmp = __pyx_t_3;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":754
 *     for i from 0 <= i < n:
 *         tmp = len(rows[i])
 *         if tmp > k:             # <<<<<<<<<<<<<<
 *             k = tmp
 * 
 */
    __pyx_t_4 = (__pyx_v_tmp > __pyx_v_k);
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":755
 *         tmp = len(rows[i])
 *         if tmp > k:
 *             k = tmp             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty((n, k), dtype=object)
 */
      __pyx_v_k = __pyx_v_tmp;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":757
 *             k = tmp
 * 
 *     result = np.empty((n, k), dtype=object)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_2 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  __pyx_t_7 = 0;
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_builtin_object) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack);
    if (unlikely(__pyx_t_9 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0]; __pyx_bstride_1_result = __pyx_bstruct_result.strides[1];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0]; __pyx_bshape_1_result = __pyx_bstruct_result.shape[1];
    if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":759
 *     result = np.empty((n, k), dtype=object)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             row = rows[i]
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_12);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":760
 * 
 *     try:
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             row = rows[i]
 *             for j from 0 <= j < len(row):
 */
      __pyx_t_1 = __pyx_v_n;
      for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
        __pyx_v_i = __pyx_t_3;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":761
 *     try:
 *         for i in range(n):
 *             row = rows[i]             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < len(row):
 *                 result[i, j] = row[j]
 */
        __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_rows), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_row));
        __pyx_v_row = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":762
 *         for i in range(n):
 *             row = rows[i]
 *             for j from 0 <= j < len(row):             # <<<<<<<<<<<<<<
 *                 result[i, j] = row[j]
 *     except Exception:
 */
        if (unlikely(((PyObject *)__pyx_v_row) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L8_error;} 
        }
        __pyx_t_13 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_row)); 
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_13; __pyx_v_j++) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":763
 *             row = rows[i]
 *             for j from 0 <= j < len(row):
 *                 result[i, j] = row[j]             # <<<<<<<<<<<<<<
 *     except Exception:
 *         # upcast any subclasses to tuple
 */
          __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_row), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_14 = __pyx_v_i;
          __pyx_t_15 = __pyx_v_j;
          __pyx_t_9 = -1;
          if (__pyx_t_14 < 0) {
            __pyx_t_14 += __pyx_bshape_0_result;
            if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 0;
          } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_result)) __pyx_t_9 = 0;
          if (__pyx_t_15 < 0) {
            __pyx_t_15 += __pyx_bshape_1_result;
            if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 1;
          } else if (unlikely(__pyx_t_15 >= __pyx_bshape_1_result)) __pyx_t_9 = 1;
          if (unlikely(__pyx_t_9 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_9);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
          }
          __pyx_t_16 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_14, __pyx_bstride_0_result, __pyx_t_15, __pyx_bstride_1_result);
          __Pyx_GOTREF(*__pyx_t_16);
          __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_t_2);
          *__pyx_t_16 = __pyx_t_2;
          __Pyx_GIVEREF(*__pyx_t_16);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
    }
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L15_try_end;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":764
 *             for j from 0 <= j < len(row):
 *                 result[i, j] = row[j]
 *     except Exception:             # <<<<<<<<<<<<<<
 *         # upcast any subclasses to tuple
 *         for i in range(n):
 */
    __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
    if (__pyx_t_9) {
      __Pyx_AddTraceback("pandas.lib.to_object_array_tuples", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":766
 *     except Exception:
 *         # upcast any subclasses to tuple
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             row = tuple(rows[i])
 *             for j from 0 <= j < len(row):
 */
      __pyx_t_1 = __pyx_v_n;
      for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
        __pyx_v_i = __pyx_t_3;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":767
 *         # upcast any subclasses to tuple
 *         for i in range(n):
 *             row = tuple(rows[i])             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < len(row):
 *                 result[i, j] = row[j]
 */
        __pyx_t_5 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_rows), __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_17));
        PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
        __Pyx_XDECREF(((PyObject *)__pyx_v_row));
        __pyx_v_row = ((PyObject*)__pyx_t_5);
        __pyx_t_5 = 0;

        /* "/home/wesm/code/pandas/pandas/src/inference.pyx":768
 *         for i in range(n):
 *             row = tuple(rows[i])
 *             for j from 0 <= j < len(row):             # <<<<<<<<<<<<<<
 *                 result[i, j] = row[j]
 * 
 */
        if (unlikely(((PyObject *)__pyx_v_row) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} 
        }
        __pyx_t_13 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_row)); 
        for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_13; __pyx_v_j++) {

          /* "/home/wesm/code/pandas/pandas/src/inference.pyx":769
 *             row = tuple(rows[i])
 *             for j from 0 <= j < len(row):
 *                 result[i, j] = row[j]             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
          __pyx_t_5 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_row), __pyx_v_j, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_18 = __pyx_v_i;
          __pyx_t_19 = __pyx_v_j;
          __pyx_t_9 = -1;
          if (__pyx_t_18 < 0) {
            __pyx_t_18 += __pyx_bshape_0_result;
            if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 0;
          } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_result)) __pyx_t_9 = 0;
          if (__pyx_t_19 < 0) {
            __pyx_t_19 += __pyx_bshape_1_result;
            if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 1;
          } else if (unlikely(__pyx_t_19 >= __pyx_bshape_1_result)) __pyx_t_9 = 1;
          if (unlikely(__pyx_t_9 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_9);
            {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
          }
          __pyx_t_16 = __Pyx_BufPtrStrided2d(PyObject **, __pyx_bstruct_result.buf, __pyx_t_18, __pyx_bstride_0_result, __pyx_t_19, __pyx_bstride_1_result);
          __Pyx_GOTREF(*__pyx_t_16);
          __Pyx_DECREF(*__pyx_t_16); __Pyx_INCREF(__pyx_t_5);
          *__pyx_t_16 = __pyx_t_5;
          __Pyx_GIVEREF(*__pyx_t_16);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L9_exception_handled;
    }
    __pyx_L10_except_error:;
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L9_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
    __pyx_L15_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":771
 *                 result[i, j] = row[j]
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_17);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.to_object_array_tuples", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/inference.pyx":774
 * 
 * 
 * def fast_multiget(dict mapping, ndarray keys, default=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(keys)
 */

static PyObject *__pyx_pf_6pandas_3lib_152fast_multiget(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_152fast_multiget = {__Pyx_NAMESTR("fast_multiget"), (PyCFunction)__pyx_pf_6pandas_3lib_152fast_multiget, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_152fast_multiget(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_mapping = 0;
  PyArrayObject *__pyx_v_keys = 0;
  PyObject *__pyx_v_default = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyObject *__pyx_v_val = 0;
  PyArrayObject *__pyx_v_output = 0;
  Py_buffer __pyx_bstruct_output;
  Py_ssize_t __pyx_bstride_0_output = 0;
  Py_ssize_t __pyx_bshape_0_output = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject **__pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mapping,&__pyx_n_s__keys,&__pyx_n_s__default,0};
  __Pyx_RefNannySetupContext("fast_multiget");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    values[2] = __pyx_k_174;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mapping);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__keys);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("fast_multiget", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__default);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fast_multiget") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_mapping = ((PyObject*)values[0]);
    __pyx_v_keys = ((PyArrayObject *)values[1]);
    __pyx_v_default = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fast_multiget", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.fast_multiget", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_output.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapping), (&PyDict_Type), 1, "mapping", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), __pyx_ptype_5numpy_ndarray, 1, "keys", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":776
 * def fast_multiget(dict mapping, ndarray keys, default=np.nan):
 *     cdef:
 *         Py_ssize_t i, n = len(keys)             # <<<<<<<<<<<<<<
 *         object val
 *         ndarray[object] output = np.empty(n, dtype='O')
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_keys)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":778
 *         Py_ssize_t i, n = len(keys)
 *         object val
 *         ndarray[object] output = np.empty(n, dtype='O')             # <<<<<<<<<<<<<<
 * 
 *     if n == 0:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__O)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_output, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
      __pyx_v_output = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_output.buf = NULL;
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_output = __pyx_bstruct_output.strides[0];
      __pyx_bshape_0_output = __pyx_bstruct_output.shape[0];
    }
  }
  __pyx_t_6 = 0;
  __pyx_v_output = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":780
 *         ndarray[object] output = np.empty(n, dtype='O')
 * 
 *     if n == 0:             # <<<<<<<<<<<<<<
 *         # kludge, for Series
 *         return np.empty(0, dtype='f8')
 */
  __pyx_t_7 = (__pyx_v_n == 0);
  if (__pyx_t_7) {

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":782
 *     if n == 0:
 *         # kludge, for Series
 *         return np.empty(0, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)__pyx_n_s__f8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_k_tuple_175), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":784
 *         return np.empty(0, dtype='f8')
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = util.get_value_1d(keys, i)
 *         if val in mapping:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":785
 * 
 *     for i in range(n):
 *         val = util.get_value_1d(keys, i)             # <<<<<<<<<<<<<<
 *         if val in mapping:
 *             output[i] = mapping[val]
 */
    __pyx_t_4 = get_value_1d(__pyx_v_keys, __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":786
 *     for i in range(n):
 *         val = util.get_value_1d(keys, i)
 *         if val in mapping:             # <<<<<<<<<<<<<<
 *             output[i] = mapping[val]
 *         else:
 */
    if (unlikely(((PyObject *)__pyx_v_mapping) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
    }
    __pyx_t_7 = ((PyDict_Contains(((PyObject *)__pyx_v_mapping), __pyx_v_val))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_7) {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":787
 *         val = util.get_value_1d(keys, i)
 *         if val in mapping:
 *             output[i] = mapping[val]             # <<<<<<<<<<<<<<
 *         else:
 *             output[i] = default
 */
      __pyx_t_4 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_mapping), __pyx_v_val); if (!__pyx_t_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_9 < 0) {
        __pyx_t_9 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_9 >= __pyx_bshape_0_output)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_output.buf, __pyx_t_9, __pyx_bstride_0_output);
      __Pyx_GOTREF(*__pyx_t_11);
      __Pyx_DECREF(*__pyx_t_11); __Pyx_INCREF(__pyx_t_4);
      *__pyx_t_11 = __pyx_t_4;
      __Pyx_GIVEREF(*__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":789
 *             output[i] = mapping[val]
 *         else:
 *             output[i] = default             # <<<<<<<<<<<<<<
 * 
 *     return maybe_convert_objects(output)
 */
      __pyx_t_12 = __pyx_v_i;
      __pyx_t_10 = -1;
      if (__pyx_t_12 < 0) {
        __pyx_t_12 += __pyx_bshape_0_output;
        if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 0;
      } else if (unlikely(__pyx_t_12 >= __pyx_bshape_0_output)) __pyx_t_10 = 0;
      if (unlikely(__pyx_t_10 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_10);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_11 = __Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_output.buf, __pyx_t_12, __pyx_bstride_0_output);
      __Pyx_GOTREF(*__pyx_t_11);
      __Pyx_DECREF(*__pyx_t_11); __Pyx_INCREF(__pyx_v_default);
      *__pyx_t_11 = __pyx_v_default;
      __Pyx_GIVEREF(*__pyx_t_11);
    }
    __pyx_L9:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":791
 *             output[i] = default
 * 
 *     return maybe_convert_objects(output)             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s_89); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_v_output));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_output));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_output));
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.fast_multiget", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_output);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF((PyObject *)__pyx_v_output);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/join.pyx":3
 * import time
 * 
 * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                Py_ssize_t max_groups):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_153inner_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_153inner_join = {__Pyx_NAMESTR("inner_join"), (PyCFunction)__pyx_pf_6pandas_3lib_153inner_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_153inner_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  Py_ssize_t __pyx_v_max_groups;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_count;
  PyArrayObject *__pyx_v_left_count = 0;
  PyArrayObject *__pyx_v_right_count = 0;
  PyArrayObject *__pyx_v_left_sorter = 0;
  PyArrayObject *__pyx_v_right_sorter = 0;
  PyArrayObject *__pyx_v_left_indexer = 0;
  PyArrayObject *__pyx_v_right_indexer = 0;
  __pyx_t_5numpy_int64_t __pyx_v_lc;
  __pyx_t_5numpy_int64_t __pyx_v_rc;
  Py_ssize_t __pyx_v_left_pos;
  Py_ssize_t __pyx_v_right_pos;
  Py_ssize_t __pyx_v_position;
  Py_ssize_t __pyx_v_offset;
  Py_buffer __pyx_bstruct_left_count;
  Py_ssize_t __pyx_bstride_0_left_count = 0;
  Py_ssize_t __pyx_bshape_0_left_count = 0;
  Py_buffer __pyx_bstruct_right;
  Py_ssize_t __pyx_bstride_0_right = 0;
  Py_ssize_t __pyx_bshape_0_right = 0;
  Py_buffer __pyx_bstruct_right_indexer;
  Py_ssize_t __pyx_bstride_0_right_indexer = 0;
  Py_ssize_t __pyx_bshape_0_right_indexer = 0;
  Py_buffer __pyx_bstruct_right_sorter;
  Py_ssize_t __pyx_bstride_0_right_sorter = 0;
  Py_ssize_t __pyx_bshape_0_right_sorter = 0;
  Py_buffer __pyx_bstruct_right_count;
  Py_ssize_t __pyx_bstride_0_right_count = 0;
  Py_ssize_t __pyx_bshape_0_right_count = 0;
  Py_buffer __pyx_bstruct_left_sorter;
  Py_ssize_t __pyx_bstride_0_left_sorter = 0;
  Py_ssize_t __pyx_bshape_0_left_sorter = 0;
  Py_buffer __pyx_bstruct_left_indexer;
  Py_ssize_t __pyx_bstride_0_left_indexer = 0;
  Py_ssize_t __pyx_bshape_0_left_indexer = 0;
  Py_buffer __pyx_bstruct_left;
  Py_ssize_t __pyx_bstride_0_left = 0;
  Py_ssize_t __pyx_bshape_0_left = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  long __pyx_t_18;
  long __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyArrayObject *__pyx_t_21 = NULL;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __pyx_t_5numpy_int64_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  __pyx_t_5numpy_int64_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__right,&__pyx_n_s__max_groups,0};
  __Pyx_RefNannySetupContext("inner_join");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_groups);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, 2); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "inner_join") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_left = ((PyArrayObject *)values[0]);
    __pyx_v_right = ((PyArrayObject *)values[1]);
    __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inner_join", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.inner_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_left_count.buf = NULL;
  __pyx_bstruct_right_count.buf = NULL;
  __pyx_bstruct_left_sorter.buf = NULL;
  __pyx_bstruct_right_sorter.buf = NULL;
  __pyx_bstruct_left_indexer.buf = NULL;
  __pyx_bstruct_right_indexer.buf = NULL;
  __pyx_bstruct_left.buf = NULL;
  __pyx_bstruct_right.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_left = __pyx_bstruct_left.strides[0];
  __pyx_bshape_0_left = __pyx_bstruct_left.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_right = __pyx_bstruct_right.strides[0];
  __pyx_bshape_0_right = __pyx_bstruct_right.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":6
 *                Py_ssize_t max_groups):
 *     cdef:
 *         Py_ssize_t i, j, k, count = 0             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
 *         ndarray[int64_t] left_indexer, right_indexer
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":13
 *     # NA group in location 0
 * 
 *     left_sorter, left_count = groupsort_indexer(left, max_groups)             # <<<<<<<<<<<<<<
 *     right_sorter, right_count = groupsort_indexer(right, max_groups)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_sorter);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_sorter, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_sorter, (PyObject*)__pyx_v_left_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_left_sorter = __pyx_bstruct_left_sorter.strides[0];
    __pyx_bshape_0_left_sorter = __pyx_bstruct_left_sorter.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_count, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_count, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_left_count = __pyx_bstruct_left_count.strides[0];
    __pyx_bshape_0_left_count = __pyx_bstruct_left_count.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":14
 * 
 *     left_sorter, left_count = groupsort_indexer(left, max_groups)
 *     right_sorter, right_count = groupsort_indexer(right, max_groups)             # <<<<<<<<<<<<<<
 * 
 *     # First pass, determine size of result set, do not use the NA group
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L9_unpacking_done;
    __pyx_L8_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L9_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_sorter);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_sorter, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_sorter, (PyObject*)__pyx_v_right_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_right_sorter = __pyx_bstruct_right_sorter.strides[0];
    __pyx_bshape_0_right_sorter = __pyx_bstruct_right_sorter.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_count, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_count, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_right_count = __pyx_bstruct_right_count.strides[0];
    __pyx_bshape_0_right_count = __pyx_bstruct_right_count.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":17
 * 
 *     # First pass, determine size of result set, do not use the NA group
 *     for i in range(1, max_groups + 1):             # <<<<<<<<<<<<<<
 *         lc = left_count[i]
 *         rc = right_count[i]
 */
  __pyx_t_11 = (__pyx_v_max_groups + 1);
  for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":18
 *     # First pass, determine size of result set, do not use the NA group
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]             # <<<<<<<<<<<<<<
 *         rc = right_count[i]
 * 
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_left_count;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_13, __pyx_bstride_0_left_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":19
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]
 *         rc = right_count[i]             # <<<<<<<<<<<<<<
 * 
 *         if rc > 0 and lc > 0:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_right_count;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_14, __pyx_bstride_0_right_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":21
 *         rc = right_count[i]
 * 
 *         if rc > 0 and lc > 0:             # <<<<<<<<<<<<<<
 *             count += lc * rc
 * 
 */
    __pyx_t_15 = (__pyx_v_rc > 0);
    if (__pyx_t_15) {
      __pyx_t_16 = (__pyx_v_lc > 0);
      __pyx_t_17 = __pyx_t_16;
    } else {
      __pyx_t_17 = __pyx_t_15;
    }
    if (__pyx_t_17) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":22
 * 
 *         if rc > 0 and lc > 0:
 *             count += lc * rc             # <<<<<<<<<<<<<<
 * 
 *     # group 0 is the NA group
 */
      __pyx_v_count = (__pyx_v_count + (__pyx_v_lc * __pyx_v_rc));
      goto __pyx_L12;
    }
    __pyx_L12:;
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":26
 *     # group 0 is the NA group
 *     cdef:
 *         Py_ssize_t loc, left_pos = 0, right_pos = 0, position = 0             # <<<<<<<<<<<<<<
 *         Py_ssize_t offset
 * 
 */
  __pyx_v_left_pos = 0;
  __pyx_v_right_pos = 0;
  __pyx_v_position = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":30
 * 
 *     # exclude the NA group
 *     left_pos = left_count[0]             # <<<<<<<<<<<<<<
 *     right_pos = right_count[0]
 * 
 */
  __pyx_t_18 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_bshape_0_left_count;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_18, __pyx_bstride_0_left_count));

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":31
 *     # exclude the NA group
 *     left_pos = left_count[0]
 *     right_pos = right_count[0]             # <<<<<<<<<<<<<<
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)
 */
  __pyx_t_19 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_bshape_0_right_count;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_19, __pyx_bstride_0_right_count));

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":33
 *     right_pos = right_count[0]
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     right_indexer = np.empty(count, dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_20) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_20);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_left_indexer = __pyx_bstruct_left_indexer.strides[0];
    __pyx_bshape_0_left_indexer = __pyx_bstruct_left_indexer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20);
  __pyx_t_20 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":34
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)
 *     right_indexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, max_groups + 1):
 */
  __pyx_t_20 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_20, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_20));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_20, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_right_indexer = __pyx_bstruct_right_indexer.strides[0];
    __pyx_bshape_0_right_indexer = __pyx_bstruct_right_indexer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":36
 *     right_indexer = np.empty(count, dtype=np.int64)
 * 
 *     for i in range(1, max_groups + 1):             # <<<<<<<<<<<<<<
 *         lc = left_count[i]
 *         rc = right_count[i]
 */
  __pyx_t_11 = (__pyx_v_max_groups + 1);
  for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":37
 * 
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]             # <<<<<<<<<<<<<<
 *         rc = right_count[i]
 * 
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_bshape_0_left_count;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_22, __pyx_bstride_0_left_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":38
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]
 *         rc = right_count[i]             # <<<<<<<<<<<<<<
 * 
 *         if rc > 0 and lc > 0:
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_23 < 0) {
      __pyx_t_23 += __pyx_bshape_0_right_count;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_23, __pyx_bstride_0_right_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":40
 *         rc = right_count[i]
 * 
 *         if rc > 0 and lc > 0:             # <<<<<<<<<<<<<<
 *             for j in range(lc):
 *                 offset = position + j * rc
 */
    __pyx_t_17 = (__pyx_v_rc > 0);
    if (__pyx_t_17) {
      __pyx_t_15 = (__pyx_v_lc > 0);
      __pyx_t_16 = __pyx_t_15;
    } else {
      __pyx_t_16 = __pyx_t_17;
    }
    if (__pyx_t_16) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":41
 * 
 *         if rc > 0 and lc > 0:
 *             for j in range(lc):             # <<<<<<<<<<<<<<
 *                 offset = position + j * rc
 *                 for k in range(rc):
 */
      __pyx_t_24 = __pyx_v_lc;
      for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
        __pyx_v_j = __pyx_t_25;

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":42
 *         if rc > 0 and lc > 0:
 *             for j in range(lc):
 *                 offset = position + j * rc             # <<<<<<<<<<<<<<
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j
 */
        __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc));

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":43
 *             for j in range(lc):
 *                 offset = position + j * rc
 *                 for k in range(rc):             # <<<<<<<<<<<<<<
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k
 */
        __pyx_t_26 = __pyx_v_rc;
        for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
          __pyx_v_k = __pyx_t_27;

          /* "/home/wesm/code/pandas/pandas/src/join.pyx":44
 *                 offset = position + j * rc
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j             # <<<<<<<<<<<<<<
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc
 */
          __pyx_t_28 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_7 = -1;
          if (__pyx_t_28 < 0) {
            __pyx_t_28 += __pyx_bshape_0_left_indexer;
            if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_left_indexer)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[11]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_indexer.buf, __pyx_t_28, __pyx_bstride_0_left_indexer) = (__pyx_v_left_pos + __pyx_v_j);

          /* "/home/wesm/code/pandas/pandas/src/join.pyx":45
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k             # <<<<<<<<<<<<<<
 *             position += lc * rc
 *         left_pos += lc
 */
          __pyx_t_29 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_7 = -1;
          if (__pyx_t_29 < 0) {
            __pyx_t_29 += __pyx_bshape_0_right_indexer;
            if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_right_indexer)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[11]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_indexer.buf, __pyx_t_29, __pyx_bstride_0_right_indexer) = (__pyx_v_right_pos + __pyx_v_k);
        }
      }

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":46
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc             # <<<<<<<<<<<<<<
 *         left_pos += lc
 *         right_pos += rc
 */
      __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc));
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":47
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc
 *         left_pos += lc             # <<<<<<<<<<<<<<
 *         right_pos += rc
 * 
 */
    __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc);

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":48
 *             position += lc * rc
 *         left_pos += lc
 *         right_pos += rc             # <<<<<<<<<<<<<<
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),
 */
    __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc);
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":50
 *         right_pos += rc
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),             # <<<<<<<<<<<<<<
 *             _get_result_indexer(right_sorter, right_indexer))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_20));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter));
  PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
  PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer));
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":51
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),
 *             _get_result_indexer(right_sorter, right_indexer))             # <<<<<<<<<<<<<<
 * 
 * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,
 */
  __pyx_t_20 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_result_indexer); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_right_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_t_1 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_sorter);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_sorter);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.inner_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_sorter);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_sorter);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left_count);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_count);
  __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter);
  __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/join.pyx":53
 *             _get_result_indexer(right_sorter, right_indexer))
 * 
 * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                     Py_ssize_t max_groups, sort=True):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_154left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_154left_outer_join = {__Pyx_NAMESTR("left_outer_join"), (PyCFunction)__pyx_pf_6pandas_3lib_154left_outer_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_154left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  Py_ssize_t __pyx_v_max_groups;
  PyObject *__pyx_v_sort = 0;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_count;
  PyArrayObject *__pyx_v_left_count = 0;
  PyArrayObject *__pyx_v_right_count = 0;
  PyArrayObject *__pyx_v_left_sorter = 0;
  PyArrayObject *__pyx_v_right_sorter = 0;
  PyArrayObject *__pyx_v_rev = 0;
  PyArrayObject *__pyx_v_left_indexer = 0;
  PyArrayObject *__pyx_v_right_indexer = 0;
  __pyx_t_5numpy_int64_t __pyx_v_lc;
  __pyx_t_5numpy_int64_t __pyx_v_rc;
  Py_ssize_t __pyx_v_left_pos;
  Py_ssize_t __pyx_v_right_pos;
  Py_ssize_t __pyx_v_position;
  Py_ssize_t __pyx_v_offset;
  Py_buffer __pyx_bstruct_right;
  Py_ssize_t __pyx_bstride_0_right = 0;
  Py_ssize_t __pyx_bshape_0_right = 0;
  Py_buffer __pyx_bstruct_right_indexer;
  Py_ssize_t __pyx_bstride_0_right_indexer = 0;
  Py_ssize_t __pyx_bshape_0_right_indexer = 0;
  Py_buffer __pyx_bstruct_right_count;
  Py_ssize_t __pyx_bstride_0_right_count = 0;
  Py_ssize_t __pyx_bshape_0_right_count = 0;
  Py_buffer __pyx_bstruct_left_count;
  Py_ssize_t __pyx_bstride_0_left_count = 0;
  Py_ssize_t __pyx_bshape_0_left_count = 0;
  Py_buffer __pyx_bstruct_left_indexer;
  Py_ssize_t __pyx_bstride_0_left_indexer = 0;
  Py_ssize_t __pyx_bshape_0_left_indexer = 0;
  Py_buffer __pyx_bstruct_left;
  Py_ssize_t __pyx_bstride_0_left = 0;
  Py_ssize_t __pyx_bshape_0_left = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  long __pyx_t_18;
  long __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyArrayObject *__pyx_t_21 = NULL;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __pyx_t_5numpy_int64_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  __pyx_t_5numpy_int64_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_ssize_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  int __pyx_t_32;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__right,&__pyx_n_s__max_groups,&__pyx_n_s__sort,0};
  __Pyx_RefNannySetupContext("left_outer_join");
  __pyx_self = __pyx_self;
  {
    PyObject* values[4] = {0,0,0,0};
    values[3] = __pyx_k_176;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_groups);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, 2); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sort);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "left_outer_join") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_left = ((PyArrayObject *)values[0]);
    __pyx_v_right = ((PyArrayObject *)values[1]);
    __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_sort = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_left_count.buf = NULL;
  __pyx_bstruct_right_count.buf = NULL;
  __pyx_bstruct_left_indexer.buf = NULL;
  __pyx_bstruct_right_indexer.buf = NULL;
  __pyx_bstruct_left.buf = NULL;
  __pyx_bstruct_right.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_left = __pyx_bstruct_left.strides[0];
  __pyx_bshape_0_left = __pyx_bstruct_left.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_right = __pyx_bstruct_right.strides[0];
  __pyx_bshape_0_right = __pyx_bstruct_right.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":56
 *                     Py_ssize_t max_groups, sort=True):
 *     cdef:
 *         Py_ssize_t i, j, k, count = 0             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] left_count, right_count
 *         ndarray left_sorter, right_sorter, rev
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":64
 *     # NA group in location 0
 * 
 *     left_sorter, left_count = groupsort_indexer(left, max_groups)             # <<<<<<<<<<<<<<
 *     right_sorter, right_count = groupsort_indexer(right, max_groups)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_count, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_count, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_left_count = __pyx_bstruct_left_count.strides[0];
    __pyx_bshape_0_left_count = __pyx_bstruct_left_count.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":65
 * 
 *     left_sorter, left_count = groupsort_indexer(left, max_groups)
 *     right_sorter, right_count = groupsort_indexer(right, max_groups)             # <<<<<<<<<<<<<<
 * 
 *     # First pass, determine size of result set, do not use the NA group
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L9_unpacking_done;
    __pyx_L8_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L9_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_count, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_count, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_right_count = __pyx_bstruct_right_count.strides[0];
    __pyx_bshape_0_right_count = __pyx_bstruct_right_count.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":68
 * 
 *     # First pass, determine size of result set, do not use the NA group
 *     for i in range(1, max_groups + 1):             # <<<<<<<<<<<<<<
 *         if right_count[i] > 0:
 *             count += left_count[i] * right_count[i]
 */
  __pyx_t_11 = (__pyx_v_max_groups + 1);
  for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":69
 *     # First pass, determine size of result set, do not use the NA group
 *     for i in range(1, max_groups + 1):
 *         if right_count[i] > 0:             # <<<<<<<<<<<<<<
 *             count += left_count[i] * right_count[i]
 *         else:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_right_count;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_14 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_13, __pyx_bstride_0_right_count)) > 0);
    if (__pyx_t_14) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":70
 *     for i in range(1, max_groups + 1):
 *         if right_count[i] > 0:
 *             count += left_count[i] * right_count[i]             # <<<<<<<<<<<<<<
 *         else:
 *             count += left_count[i]
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_left_count;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_right_count;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_count = (__pyx_v_count + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_15, __pyx_bstride_0_left_count)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_16, __pyx_bstride_0_right_count))));
      goto __pyx_L12;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":72
 *             count += left_count[i] * right_count[i]
 *         else:
 *             count += left_count[i]             # <<<<<<<<<<<<<<
 * 
 *     # group 0 is the NA group
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_7 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_left_count;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
      if (unlikely(__pyx_t_7 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_7);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_count = (__pyx_v_count + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_17, __pyx_bstride_0_left_count)));
    }
    __pyx_L12:;
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":76
 *     # group 0 is the NA group
 *     cdef:
 *         Py_ssize_t loc, left_pos = 0, right_pos = 0, position = 0             # <<<<<<<<<<<<<<
 *         Py_ssize_t offset
 * 
 */
  __pyx_v_left_pos = 0;
  __pyx_v_right_pos = 0;
  __pyx_v_position = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":80
 * 
 *     # exclude the NA group
 *     left_pos = left_count[0]             # <<<<<<<<<<<<<<
 *     right_pos = right_count[0]
 * 
 */
  __pyx_t_18 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_bshape_0_left_count;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_18, __pyx_bstride_0_left_count));

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":81
 *     # exclude the NA group
 *     left_pos = left_count[0]
 *     right_pos = right_count[0]             # <<<<<<<<<<<<<<
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)
 */
  __pyx_t_19 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_bshape_0_right_count;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_19, __pyx_bstride_0_right_count));

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":83
 *     right_pos = right_count[0]
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     right_indexer = np.empty(count, dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_20) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_20);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_left_indexer = __pyx_bstruct_left_indexer.strides[0];
    __pyx_bshape_0_left_indexer = __pyx_bstruct_left_indexer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20);
  __pyx_t_20 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":84
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)
 *     right_indexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, max_groups + 1):
 */
  __pyx_t_20 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_20, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_20));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_20, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_right_indexer = __pyx_bstruct_right_indexer.strides[0];
    __pyx_bshape_0_right_indexer = __pyx_bstruct_right_indexer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":86
 *     right_indexer = np.empty(count, dtype=np.int64)
 * 
 *     for i in range(1, max_groups + 1):             # <<<<<<<<<<<<<<
 *         lc = left_count[i]
 *         rc = right_count[i]
 */
  __pyx_t_11 = (__pyx_v_max_groups + 1);
  for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":87
 * 
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]             # <<<<<<<<<<<<<<
 *         rc = right_count[i]
 * 
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_bshape_0_left_count;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_22, __pyx_bstride_0_left_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":88
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]
 *         rc = right_count[i]             # <<<<<<<<<<<<<<
 * 
 *         if rc == 0:
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_23 < 0) {
      __pyx_t_23 += __pyx_bshape_0_right_count;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_23, __pyx_bstride_0_right_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":90
 *         rc = right_count[i]
 * 
 *         if rc == 0:             # <<<<<<<<<<<<<<
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j
 */
    __pyx_t_14 = (__pyx_v_rc == 0);
    if (__pyx_t_14) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":91
 * 
 *         if rc == 0:
 *             for j in range(lc):             # <<<<<<<<<<<<<<
 *                 left_indexer[position + j] = left_pos + j
 *                 right_indexer[position + j] = -1
 */
      __pyx_t_24 = __pyx_v_lc;
      for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
        __pyx_v_j = __pyx_t_25;

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":92
 *         if rc == 0:
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j             # <<<<<<<<<<<<<<
 *                 right_indexer[position + j] = -1
 *             position += lc
 */
        __pyx_t_26 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_7 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_bshape_0_left_indexer;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_left_indexer)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[11]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_indexer.buf, __pyx_t_26, __pyx_bstride_0_left_indexer) = (__pyx_v_left_pos + __pyx_v_j);

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":93
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j
 *                 right_indexer[position + j] = -1             # <<<<<<<<<<<<<<
 *             position += lc
 *         else:
 */
        __pyx_t_27 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_7 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_bshape_0_right_indexer;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_right_indexer)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[11]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_indexer.buf, __pyx_t_27, __pyx_bstride_0_right_indexer) = -1;
      }

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":94
 *                 left_indexer[position + j] = left_pos + j
 *                 right_indexer[position + j] = -1
 *             position += lc             # <<<<<<<<<<<<<<
 *         else:
 *             for j in range(lc):
 */
      __pyx_v_position = (__pyx_v_position + __pyx_v_lc);
      goto __pyx_L15;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":96
 *             position += lc
 *         else:
 *             for j in range(lc):             # <<<<<<<<<<<<<<
 *                 offset = position + j * rc
 *                 for k in range(rc):
 */
      __pyx_t_24 = __pyx_v_lc;
      for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
        __pyx_v_j = __pyx_t_25;

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":97
 *         else:
 *             for j in range(lc):
 *                 offset = position + j * rc             # <<<<<<<<<<<<<<
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j
 */
        __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc));

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":98
 *             for j in range(lc):
 *                 offset = position + j * rc
 *                 for k in range(rc):             # <<<<<<<<<<<<<<
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k
 */
        __pyx_t_28 = __pyx_v_rc;
        for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
          __pyx_v_k = __pyx_t_29;

          /* "/home/wesm/code/pandas/pandas/src/join.pyx":99
 *                 offset = position + j * rc
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j             # <<<<<<<<<<<<<<
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc
 */
          __pyx_t_30 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_7 = -1;
          if (__pyx_t_30 < 0) {
            __pyx_t_30 += __pyx_bshape_0_left_indexer;
            if (unlikely(__pyx_t_30 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_30 >= __pyx_bshape_0_left_indexer)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[11]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_indexer.buf, __pyx_t_30, __pyx_bstride_0_left_indexer) = (__pyx_v_left_pos + __pyx_v_j);

          /* "/home/wesm/code/pandas/pandas/src/join.pyx":100
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k             # <<<<<<<<<<<<<<
 *             position += lc * rc
 *         left_pos += lc
 */
          __pyx_t_31 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_7 = -1;
          if (__pyx_t_31 < 0) {
            __pyx_t_31 += __pyx_bshape_0_right_indexer;
            if (unlikely(__pyx_t_31 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_31 >= __pyx_bshape_0_right_indexer)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[11]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_indexer.buf, __pyx_t_31, __pyx_bstride_0_right_indexer) = (__pyx_v_right_pos + __pyx_v_k);
        }
      }

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":101
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc             # <<<<<<<<<<<<<<
 *         left_pos += lc
 *         right_pos += rc
 */
      __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc));
    }
    __pyx_L15:;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":102
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc
 *         left_pos += lc             # <<<<<<<<<<<<<<
 *         right_pos += rc
 * 
 */
    __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc);

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":103
 *             position += lc * rc
 *         left_pos += lc
 *         right_pos += rc             # <<<<<<<<<<<<<<
 * 
 *     left_indexer = _get_result_indexer(left_sorter, left_indexer)
 */
    __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc);
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":105
 *         right_pos += rc
 * 
 *     left_indexer = _get_result_indexer(left_sorter, left_indexer)             # <<<<<<<<<<<<<<
 *     right_indexer = _get_result_indexer(right_sorter, right_indexer)
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_20));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter));
  PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
  PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer));
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_left_indexer = __pyx_bstruct_left_indexer.strides[0];
    __pyx_bshape_0_left_indexer = __pyx_bstruct_left_indexer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_left_indexer));
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":106
 * 
 *     left_indexer = _get_result_indexer(left_sorter, left_indexer)
 *     right_indexer = _get_result_indexer(right_sorter, right_indexer)             # <<<<<<<<<<<<<<
 * 
 *     if not sort:
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_result_indexer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_20));
  __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter));
  PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_right_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer));
  PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_right_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_right_indexer = __pyx_bstruct_right_indexer.strides[0];
    __pyx_bshape_0_right_indexer = __pyx_bstruct_right_indexer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":108
 *     right_indexer = _get_result_indexer(right_sorter, right_indexer)
 * 
 *     if not sort:             # <<<<<<<<<<<<<<
 *         if left_sorter.dtype != np.int_:
 *             left_sorter = left_sorter.astype(np.int_)
 */
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_sort); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_32 = (!__pyx_t_14);
  if (__pyx_t_32) {

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":109
 * 
 *     if not sort:
 *         if left_sorter.dtype != np.int_:             # <<<<<<<<<<<<<<
 *             left_sorter = left_sorter.astype(np.int_)
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s__dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_20 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_20, __pyx_n_s__int_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __pyx_t_20 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_32 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_32 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    if (__pyx_t_32) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":110
 *     if not sort:
 *         if left_sorter.dtype != np.int_:
 *             left_sorter = left_sorter.astype(np.int_)             # <<<<<<<<<<<<<<
 * 
 *         rev = np.empty(len(left), dtype=np.int_)
 */
      __pyx_t_20 = PyObject_GetAttr(((PyObject *)__pyx_v_left_sorter), __pyx_n_s__astype); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_v_left_sorter));
      __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L23;
    }
    __pyx_L23:;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":112
 *             left_sorter = left_sorter.astype(np.int_)
 * 
 *         rev = np.empty(len(left), dtype=np.int_)             # <<<<<<<<<<<<<<
 *         rev.put(left_sorter, np.arange(len(left)))
 * 
 */
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_20));
    PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_20), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_rev = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":113
 * 
 *         rev = np.empty(len(left), dtype=np.int_)
 *         rev.put(left_sorter, np.arange(len(left)))             # <<<<<<<<<<<<<<
 * 
 *         right_indexer = right_indexer.take(rev)
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_rev), __pyx_n_s__put); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_20 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__arange); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_left)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left_sorter));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter));
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":115
 *         rev.put(left_sorter, np.arange(len(left)))
 * 
 *         right_indexer = right_indexer.take(rev)             # <<<<<<<<<<<<<<
 *         left_indexer = left_indexer.take(rev)
 * 
 */
    __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_right_indexer), __pyx_n_s__take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(((PyObject *)__pyx_v_rev));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_rev));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_rev));
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_21 = ((PyArrayObject *)__pyx_t_2);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      __pyx_bstride_0_right_indexer = __pyx_bstruct_right_indexer.strides[0];
      __pyx_bshape_0_right_indexer = __pyx_bstruct_right_indexer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_21 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_right_indexer));
    __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":116
 * 
 *         right_indexer = right_indexer.take(rev)
 *         left_indexer = left_indexer.take(rev)             # <<<<<<<<<<<<<<
 * 
 *     return left_indexer, right_indexer
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_left_indexer), __pyx_n_s__take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(((PyObject *)__pyx_v_rev));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_rev));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_rev));
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
      __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_7 < 0)) {
        PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        }
      }
      __pyx_bstride_0_left_indexer = __pyx_bstruct_left_indexer.strides[0];
      __pyx_bshape_0_left_indexer = __pyx_bstruct_left_indexer.shape[0];
      if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_21 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_left_indexer));
    __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L22;
  }
  __pyx_L22:;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":118
 *         left_indexer = left_indexer.take(rev)
 * 
 *     return left_indexer, right_indexer             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_left_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer));
  __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left_count);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_count);
  __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter);
  __Pyx_XDECREF((PyObject *)__pyx_v_rev);
  __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/join.pyx":122
 * 
 * 
 * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t max_groups):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_155full_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_155full_outer_join = {__Pyx_NAMESTR("full_outer_join"), (PyCFunction)__pyx_pf_6pandas_3lib_155full_outer_join, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_155full_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_left = 0;
  PyArrayObject *__pyx_v_right = 0;
  Py_ssize_t __pyx_v_max_groups;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_j;
  Py_ssize_t __pyx_v_k;
  Py_ssize_t __pyx_v_count;
  PyArrayObject *__pyx_v_left_count = 0;
  PyArrayObject *__pyx_v_right_count = 0;
  PyArrayObject *__pyx_v_left_sorter = 0;
  PyArrayObject *__pyx_v_right_sorter = 0;
  PyArrayObject *__pyx_v_left_indexer = 0;
  PyArrayObject *__pyx_v_right_indexer = 0;
  __pyx_t_5numpy_int64_t __pyx_v_lc;
  __pyx_t_5numpy_int64_t __pyx_v_rc;
  __pyx_t_5numpy_int64_t __pyx_v_left_pos;
  __pyx_t_5numpy_int64_t __pyx_v_right_pos;
  Py_ssize_t __pyx_v_offset;
  Py_ssize_t __pyx_v_position;
  Py_buffer __pyx_bstruct_left_count;
  Py_ssize_t __pyx_bstride_0_left_count = 0;
  Py_ssize_t __pyx_bshape_0_left_count = 0;
  Py_buffer __pyx_bstruct_right;
  Py_ssize_t __pyx_bstride_0_right = 0;
  Py_ssize_t __pyx_bshape_0_right = 0;
  Py_buffer __pyx_bstruct_right_indexer;
  Py_ssize_t __pyx_bstride_0_right_indexer = 0;
  Py_ssize_t __pyx_bshape_0_right_indexer = 0;
  Py_buffer __pyx_bstruct_right_sorter;
  Py_ssize_t __pyx_bstride_0_right_sorter = 0;
  Py_ssize_t __pyx_bshape_0_right_sorter = 0;
  Py_buffer __pyx_bstruct_right_count;
  Py_ssize_t __pyx_bstride_0_right_count = 0;
  Py_ssize_t __pyx_bshape_0_right_count = 0;
  Py_buffer __pyx_bstruct_left_sorter;
  Py_ssize_t __pyx_bstride_0_left_sorter = 0;
  Py_ssize_t __pyx_bshape_0_left_sorter = 0;
  Py_buffer __pyx_bstruct_left_indexer;
  Py_ssize_t __pyx_bstride_0_left_indexer = 0;
  Py_ssize_t __pyx_bshape_0_left_indexer = 0;
  Py_buffer __pyx_bstruct_left;
  Py_ssize_t __pyx_bstride_0_left = 0;
  Py_ssize_t __pyx_bshape_0_left = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_t_17;
  long __pyx_t_18;
  long __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyArrayObject *__pyx_t_21 = NULL;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  __pyx_t_5numpy_int64_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  Py_ssize_t __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  __pyx_t_5numpy_int64_t __pyx_t_30;
  Py_ssize_t __pyx_t_31;
  Py_ssize_t __pyx_t_32;
  Py_ssize_t __pyx_t_33;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__right,&__pyx_n_s__max_groups,0};
  __Pyx_RefNannySetupContext("full_outer_join");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_groups);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, 2); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "full_outer_join") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_left = ((PyArrayObject *)values[0]);
    __pyx_v_right = ((PyArrayObject *)values[1]);
    __pyx_v_max_groups = __Pyx_PyIndex_AsSsize_t(values[2]); if (unlikely((__pyx_v_max_groups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("full_outer_join", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.full_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_left_count.buf = NULL;
  __pyx_bstruct_right_count.buf = NULL;
  __pyx_bstruct_left_sorter.buf = NULL;
  __pyx_bstruct_right_sorter.buf = NULL;
  __pyx_bstruct_left_indexer.buf = NULL;
  __pyx_bstruct_right_indexer.buf = NULL;
  __pyx_bstruct_left.buf = NULL;
  __pyx_bstruct_right.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left), __pyx_ptype_5numpy_ndarray, 1, "left", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right), __pyx_ptype_5numpy_ndarray, 1, "right", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left, (PyObject*)__pyx_v_left, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_left = __pyx_bstruct_left.strides[0];
  __pyx_bshape_0_left = __pyx_bstruct_left.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right, (PyObject*)__pyx_v_right, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_right = __pyx_bstruct_right.strides[0];
  __pyx_bshape_0_right = __pyx_bstruct_right.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":125
 *                           Py_ssize_t max_groups):
 *     cdef:
 *         Py_ssize_t i, j, k, count = 0             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
 *         ndarray[int64_t] left_indexer, right_indexer
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":132
 *     # NA group in location 0
 * 
 *     left_sorter, left_count = groupsort_indexer(left, max_groups)             # <<<<<<<<<<<<<<
 *     right_sorter, right_count = groupsort_indexer(right, max_groups)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__groupsort_indexer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_left));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L7_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_sorter);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_sorter, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_sorter, (PyObject*)__pyx_v_left_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_left_sorter = __pyx_bstruct_left_sorter.strides[0];
    __pyx_bshape_0_left_sorter = __pyx_bstruct_left_sorter.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_left_sorter = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_count, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_count, (PyObject*)__pyx_v_left_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_left_count = __pyx_bstruct_left_count.strides[0];
    __pyx_bshape_0_left_count = __pyx_bstruct_left_count.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_left_count = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":133
 * 
 *     left_sorter, left_count = groupsort_indexer(left, max_groups)
 *     right_sorter, right_count = groupsort_indexer(right, max_groups)             # <<<<<<<<<<<<<<
 * 
 *     # First pass, determine size of result set, do not use the NA group
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__groupsort_indexer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_max_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_right));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    if (likely(PyTuple_CheckExact(sequence))) {
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
        if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L9_unpacking_done;
    __pyx_L8_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
    if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L9_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_sorter);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_sorter, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_sorter, (PyObject*)__pyx_v_right_sorter, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_right_sorter = __pyx_bstruct_right_sorter.strides[0];
    __pyx_bshape_0_right_sorter = __pyx_bstruct_right_sorter.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_right_sorter = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_count, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_count, (PyObject*)__pyx_v_right_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_right_count = __pyx_bstruct_right_count.strides[0];
    __pyx_bshape_0_right_count = __pyx_bstruct_right_count.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_right_count = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":136
 * 
 *     # First pass, determine size of result set, do not use the NA group
 *     for i in range(1, max_groups + 1):             # <<<<<<<<<<<<<<
 *         lc = left_count[i]
 *         rc = right_count[i]
 */
  __pyx_t_11 = (__pyx_v_max_groups + 1);
  for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":137
 *     # First pass, determine size of result set, do not use the NA group
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]             # <<<<<<<<<<<<<<
 *         rc = right_count[i]
 * 
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_left_count;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_13, __pyx_bstride_0_left_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":138
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]
 *         rc = right_count[i]             # <<<<<<<<<<<<<<
 * 
 *         if rc > 0 and lc > 0:
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_right_count;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_14, __pyx_bstride_0_right_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":140
 *         rc = right_count[i]
 * 
 *         if rc > 0 and lc > 0:             # <<<<<<<<<<<<<<
 *             count += lc * rc
 *         else:
 */
    __pyx_t_15 = (__pyx_v_rc > 0);
    if (__pyx_t_15) {
      __pyx_t_16 = (__pyx_v_lc > 0);
      __pyx_t_17 = __pyx_t_16;
    } else {
      __pyx_t_17 = __pyx_t_15;
    }
    if (__pyx_t_17) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":141
 * 
 *         if rc > 0 and lc > 0:
 *             count += lc * rc             # <<<<<<<<<<<<<<
 *         else:
 *             count += lc + rc
 */
      __pyx_v_count = (__pyx_v_count + (__pyx_v_lc * __pyx_v_rc));
      goto __pyx_L12;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":143
 *             count += lc * rc
 *         else:
 *             count += lc + rc             # <<<<<<<<<<<<<<
 * 
 *     # group 0 is the NA group
 */
      __pyx_v_count = (__pyx_v_count + (__pyx_v_lc + __pyx_v_rc));
    }
    __pyx_L12:;
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":147
 *     # group 0 is the NA group
 *     cdef:
 *         int64_t left_pos = 0, right_pos = 0             # <<<<<<<<<<<<<<
 *         Py_ssize_t offset, position = 0
 * 
 */
  __pyx_v_left_pos = 0;
  __pyx_v_right_pos = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":148
 *     cdef:
 *         int64_t left_pos = 0, right_pos = 0
 *         Py_ssize_t offset, position = 0             # <<<<<<<<<<<<<<
 * 
 *     # exclude the NA group
 */
  __pyx_v_position = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":151
 * 
 *     # exclude the NA group
 *     left_pos = left_count[0]             # <<<<<<<<<<<<<<
 *     right_pos = right_count[0]
 * 
 */
  __pyx_t_18 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_18 < 0) {
    __pyx_t_18 += __pyx_bshape_0_left_count;
    if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_left_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_18, __pyx_bstride_0_left_count));

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":152
 *     # exclude the NA group
 *     left_pos = left_count[0]
 *     right_pos = right_count[0]             # <<<<<<<<<<<<<<
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)
 */
  __pyx_t_19 = 0;
  __pyx_t_7 = -1;
  if (__pyx_t_19 < 0) {
    __pyx_t_19 += __pyx_bshape_0_right_count;
    if (unlikely(__pyx_t_19 < 0)) __pyx_t_7 = 0;
  } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
  if (unlikely(__pyx_t_7 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_7);
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_right_pos = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_19, __pyx_bstride_0_right_count));

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":154
 *     right_pos = right_count[0]
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     right_indexer = np.empty(count, dtype=np.int64)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int64); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_20) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_20) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_20, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_20);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_left_indexer, (PyObject*)__pyx_v_left_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_left_indexer = __pyx_bstruct_left_indexer.strides[0];
    __pyx_bshape_0_left_indexer = __pyx_bstruct_left_indexer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_left_indexer = ((PyArrayObject *)__pyx_t_20);
  __pyx_t_20 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":155
 * 
 *     left_indexer = np.empty(count, dtype=np.int64)
 *     right_indexer = np.empty(count, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, max_groups + 1):
 */
  __pyx_t_20 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_20, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_count); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_20));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_20, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_20)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_21 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_right_indexer, (PyObject*)__pyx_v_right_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_right_indexer = __pyx_bstruct_right_indexer.strides[0];
    __pyx_bshape_0_right_indexer = __pyx_bstruct_right_indexer.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_21 = 0;
  __pyx_v_right_indexer = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":157
 *     right_indexer = np.empty(count, dtype=np.int64)
 * 
 *     for i in range(1, max_groups + 1):             # <<<<<<<<<<<<<<
 *         lc = left_count[i]
 *         rc = right_count[i]
 */
  __pyx_t_11 = (__pyx_v_max_groups + 1);
  for (__pyx_t_12 = 1; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":158
 * 
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]             # <<<<<<<<<<<<<<
 *         rc = right_count[i]
 * 
 */
    __pyx_t_22 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_22 < 0) {
      __pyx_t_22 += __pyx_bshape_0_left_count;
      if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_22 >= __pyx_bshape_0_left_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_lc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_count.buf, __pyx_t_22, __pyx_bstride_0_left_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":159
 *     for i in range(1, max_groups + 1):
 *         lc = left_count[i]
 *         rc = right_count[i]             # <<<<<<<<<<<<<<
 * 
 *         if rc == 0:
 */
    __pyx_t_23 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_23 < 0) {
      __pyx_t_23 += __pyx_bshape_0_right_count;
      if (unlikely(__pyx_t_23 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_23 >= __pyx_bshape_0_right_count)) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_rc = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_count.buf, __pyx_t_23, __pyx_bstride_0_right_count));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":161
 *         rc = right_count[i]
 * 
 *         if rc == 0:             # <<<<<<<<<<<<<<
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j
 */
    __pyx_t_17 = (__pyx_v_rc == 0);
    if (__pyx_t_17) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":162
 * 
 *         if rc == 0:
 *             for j in range(lc):             # <<<<<<<<<<<<<<
 *                 left_indexer[position + j] = left_pos + j
 *                 right_indexer[position + j] = -1
 */
      __pyx_t_24 = __pyx_v_lc;
      for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
        __pyx_v_j = __pyx_t_25;

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":163
 *         if rc == 0:
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j             # <<<<<<<<<<<<<<
 *                 right_indexer[position + j] = -1
 *             position += lc
 */
        __pyx_t_26 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_7 = -1;
        if (__pyx_t_26 < 0) {
          __pyx_t_26 += __pyx_bshape_0_left_indexer;
          if (unlikely(__pyx_t_26 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_26 >= __pyx_bshape_0_left_indexer)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[11]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_indexer.buf, __pyx_t_26, __pyx_bstride_0_left_indexer) = (__pyx_v_left_pos + __pyx_v_j);

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":164
 *             for j in range(lc):
 *                 left_indexer[position + j] = left_pos + j
 *                 right_indexer[position + j] = -1             # <<<<<<<<<<<<<<
 *             position += lc
 *         elif lc == 0:
 */
        __pyx_t_27 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_7 = -1;
        if (__pyx_t_27 < 0) {
          __pyx_t_27 += __pyx_bshape_0_right_indexer;
          if (unlikely(__pyx_t_27 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_27 >= __pyx_bshape_0_right_indexer)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[11]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_indexer.buf, __pyx_t_27, __pyx_bstride_0_right_indexer) = -1;
      }

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":165
 *                 left_indexer[position + j] = left_pos + j
 *                 right_indexer[position + j] = -1
 *             position += lc             # <<<<<<<<<<<<<<
 *         elif lc == 0:
 *             for j in range(rc):
 */
      __pyx_v_position = (__pyx_v_position + __pyx_v_lc);
      goto __pyx_L15;
    }

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":166
 *                 right_indexer[position + j] = -1
 *             position += lc
 *         elif lc == 0:             # <<<<<<<<<<<<<<
 *             for j in range(rc):
 *                 left_indexer[position + j] = -1
 */
    __pyx_t_17 = (__pyx_v_lc == 0);
    if (__pyx_t_17) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":167
 *             position += lc
 *         elif lc == 0:
 *             for j in range(rc):             # <<<<<<<<<<<<<<
 *                 left_indexer[position + j] = -1
 *                 right_indexer[position + j] = right_pos + j
 */
      __pyx_t_24 = __pyx_v_rc;
      for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
        __pyx_v_j = __pyx_t_25;

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":168
 *         elif lc == 0:
 *             for j in range(rc):
 *                 left_indexer[position + j] = -1             # <<<<<<<<<<<<<<
 *                 right_indexer[position + j] = right_pos + j
 *             position += rc
 */
        __pyx_t_28 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_7 = -1;
        if (__pyx_t_28 < 0) {
          __pyx_t_28 += __pyx_bshape_0_left_indexer;
          if (unlikely(__pyx_t_28 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_28 >= __pyx_bshape_0_left_indexer)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[11]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_indexer.buf, __pyx_t_28, __pyx_bstride_0_left_indexer) = -1;

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":169
 *             for j in range(rc):
 *                 left_indexer[position + j] = -1
 *                 right_indexer[position + j] = right_pos + j             # <<<<<<<<<<<<<<
 *             position += rc
 *         else:
 */
        __pyx_t_29 = (__pyx_v_position + __pyx_v_j);
        __pyx_t_7 = -1;
        if (__pyx_t_29 < 0) {
          __pyx_t_29 += __pyx_bshape_0_right_indexer;
          if (unlikely(__pyx_t_29 < 0)) __pyx_t_7 = 0;
        } else if (unlikely(__pyx_t_29 >= __pyx_bshape_0_right_indexer)) __pyx_t_7 = 0;
        if (unlikely(__pyx_t_7 != -1)) {
          __Pyx_RaiseBufferIndexError(__pyx_t_7);
          {__pyx_filename = __pyx_f[11]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_indexer.buf, __pyx_t_29, __pyx_bstride_0_right_indexer) = (__pyx_v_right_pos + __pyx_v_j);
      }

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":170
 *                 left_indexer[position + j] = -1
 *                 right_indexer[position + j] = right_pos + j
 *             position += rc             # <<<<<<<<<<<<<<
 *         else:
 *             for j in range(lc):
 */
      __pyx_v_position = (__pyx_v_position + __pyx_v_rc);
      goto __pyx_L15;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":172
 *             position += rc
 *         else:
 *             for j in range(lc):             # <<<<<<<<<<<<<<
 *                 offset = position + j * rc
 *                 for k in range(rc):
 */
      __pyx_t_24 = __pyx_v_lc;
      for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
        __pyx_v_j = __pyx_t_25;

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":173
 *         else:
 *             for j in range(lc):
 *                 offset = position + j * rc             # <<<<<<<<<<<<<<
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j
 */
        __pyx_v_offset = (__pyx_v_position + (__pyx_v_j * __pyx_v_rc));

        /* "/home/wesm/code/pandas/pandas/src/join.pyx":174
 *             for j in range(lc):
 *                 offset = position + j * rc
 *                 for k in range(rc):             # <<<<<<<<<<<<<<
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k
 */
        __pyx_t_30 = __pyx_v_rc;
        for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
          __pyx_v_k = __pyx_t_31;

          /* "/home/wesm/code/pandas/pandas/src/join.pyx":175
 *                 offset = position + j * rc
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j             # <<<<<<<<<<<<<<
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc
 */
          __pyx_t_32 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_7 = -1;
          if (__pyx_t_32 < 0) {
            __pyx_t_32 += __pyx_bshape_0_left_indexer;
            if (unlikely(__pyx_t_32 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_32 >= __pyx_bshape_0_left_indexer)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[11]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_left_indexer.buf, __pyx_t_32, __pyx_bstride_0_left_indexer) = (__pyx_v_left_pos + __pyx_v_j);

          /* "/home/wesm/code/pandas/pandas/src/join.pyx":176
 *                 for k in range(rc):
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k             # <<<<<<<<<<<<<<
 *             position += lc * rc
 *         left_pos += lc
 */
          __pyx_t_33 = (__pyx_v_offset + __pyx_v_k);
          __pyx_t_7 = -1;
          if (__pyx_t_33 < 0) {
            __pyx_t_33 += __pyx_bshape_0_right_indexer;
            if (unlikely(__pyx_t_33 < 0)) __pyx_t_7 = 0;
          } else if (unlikely(__pyx_t_33 >= __pyx_bshape_0_right_indexer)) __pyx_t_7 = 0;
          if (unlikely(__pyx_t_7 != -1)) {
            __Pyx_RaiseBufferIndexError(__pyx_t_7);
            {__pyx_filename = __pyx_f[11]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_right_indexer.buf, __pyx_t_33, __pyx_bstride_0_right_indexer) = (__pyx_v_right_pos + __pyx_v_k);
        }
      }

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":177
 *                     left_indexer[offset + k] = left_pos + j
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc             # <<<<<<<<<<<<<<
 *         left_pos += lc
 *         right_pos += rc
 */
      __pyx_v_position = (__pyx_v_position + (__pyx_v_lc * __pyx_v_rc));
    }
    __pyx_L15:;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":178
 *                     right_indexer[offset + k] = right_pos + k
 *             position += lc * rc
 *         left_pos += lc             # <<<<<<<<<<<<<<
 *         right_pos += rc
 * 
 */
    __pyx_v_left_pos = (__pyx_v_left_pos + __pyx_v_lc);

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":179
 *             position += lc * rc
 *         left_pos += lc
 *         right_pos += rc             # <<<<<<<<<<<<<<
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),
 */
    __pyx_v_right_pos = (__pyx_v_right_pos + __pyx_v_rc);
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":181
 *         right_pos += rc
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),             # <<<<<<<<<<<<<<
 *             _get_result_indexer(right_sorter, right_indexer))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_result_indexer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_20));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_sorter));
  PyTuple_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_v_left_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_left_indexer));
  PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_left_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_left_indexer));
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":182
 * 
 *     return (_get_result_indexer(left_sorter, left_indexer),
 *             _get_result_indexer(right_sorter, right_indexer))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_GetName(__pyx_m, __pyx_n_s___get_result_indexer); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_v_right_sorter));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_right_sorter));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_sorter));
  __Pyx_INCREF(((PyObject *)__pyx_v_right_indexer));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_right_indexer));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_right_indexer));
  __pyx_t_1 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_20);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_sorter);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_sorter);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.full_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_count);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_sorter);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_right_count);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_sorter);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_left);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_left_count);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_count);
  __Pyx_XDECREF((PyObject *)__pyx_v_left_sorter);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_sorter);
  __Pyx_XDECREF((PyObject *)__pyx_v_left_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_right_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/join.pyx":186
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */

static PyObject *__pyx_pf_6pandas_3lib_156_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_156_get_result_indexer = {__Pyx_NAMESTR("_get_result_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_156_get_result_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_156_get_result_indexer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sorter = 0;
  PyObject *__pyx_v_indexer = 0;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sorter,&__pyx_n_s__indexer,0};
  __Pyx_RefNannySetupContext("_get_result_indexer");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sorter);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__indexer);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_get_result_indexer", 1, 2, 2, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_get_result_indexer") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_sorter = values[0];
    __pyx_v_indexer = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_result_indexer", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib._get_result_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_indexer);

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":187
 * 
 * def _get_result_indexer(sorter, indexer):
 *     if indexer.dtype != np.int_:             # <<<<<<<<<<<<<<
 *         indexer = indexer.astype(np.int_)
 *     if len(sorter) > 0:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_indexer, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":188
 * def _get_result_indexer(sorter, indexer):
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)             # <<<<<<<<<<<<<<
 *     if len(sorter) > 0:
 *         res = sorter.take(indexer)
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_indexer, __pyx_n_s__astype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_indexer);
    __pyx_v_indexer = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":189
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 *     if len(sorter) > 0:             # <<<<<<<<<<<<<<
 *         res = sorter.take(indexer)
 *         np.putmask(res, indexer == -1, -1)
 */
  __pyx_t_5 = PyObject_Length(__pyx_v_sorter); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (__pyx_t_5 > 0);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":190
 *         indexer = indexer.astype(np.int_)
 *     if len(sorter) > 0:
 *         res = sorter.take(indexer)             # <<<<<<<<<<<<<<
 *         np.putmask(res, indexer == -1, -1)
 *     else:
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_sorter, __pyx_n_s__take); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_indexer);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_indexer);
    __Pyx_GIVEREF(__pyx_v_indexer);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_res = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":191
 *     if len(sorter) > 0:
 *         res = sorter.take(indexer)
 *         np.putmask(res, indexer == -1, -1)             # <<<<<<<<<<<<<<
 *     else:
 *         # length-0 case
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__putmask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_indexer, __pyx_int_neg_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_res);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_res);
    __Pyx_GIVEREF(__pyx_v_res);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":194
 *     else:
 *         # length-0 case
 *         res = np.empty(len(indexer), dtype=np.int64)             # <<<<<<<<<<<<<<
 *         res.fill(-1)
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = PyObject_Length(__pyx_v_indexer); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_res = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":195
 *         # length-0 case
 *         res = np.empty(len(indexer), dtype=np.int64)
 *         res.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     return res
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__fill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_177), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":197
 *         res.fill(-1)
 * 
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pandas.lib._get_result_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_indexer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/join.pyx":201
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */

static PyObject *__pyx_pf_6pandas_3lib_157ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_157ffill_indexer = {__Pyx_NAMESTR("ffill_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_157ffill_indexer, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_157ffill_indexer(PyObject *__pyx_self, PyObject *__pyx_v_indexer) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  __pyx_t_5numpy_int64_t __pyx_v_last_obs;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ffill_indexer");
  __pyx_self = __pyx_self;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_indexer.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0];
  __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":203
 * def ffill_indexer(ndarray[int64_t] indexer):
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] result
 *         int64_t val, last_obs
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_indexer); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":207
 *         int64_t val, last_obs
 * 
 *     result = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     last_obs = -1
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":208
 * 
 *     result = np.empty(n, dtype=np.int64)
 *     last_obs = -1             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_v_last_obs = -1;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":210
 *     last_obs = -1
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         val = indexer[i]
 *         if val == -1:
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":211
 * 
 *     for i in range(n):
 *         val = indexer[i]             # <<<<<<<<<<<<<<
 *         if val == -1:
 *             result[i] = last_obs
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_indexer;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_indexer)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_indexer.buf, __pyx_t_13, __pyx_bstride_0_indexer));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":212
 *     for i in range(n):
 *         val = indexer[i]
 *         if val == -1:             # <<<<<<<<<<<<<<
 *             result[i] = last_obs
 *         else:
 */
    __pyx_t_14 = (__pyx_v_val == -1);
    if (__pyx_t_14) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":213
 *         val = indexer[i]
 *         if val == -1:
 *             result[i] = last_obs             # <<<<<<<<<<<<<<
 *         else:
 *             result[i] = val
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_15, __pyx_bstride_0_result) = __pyx_v_last_obs;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":215
 *             result[i] = last_obs
 *         else:
 *             result[i] = val             # <<<<<<<<<<<<<<
 *             last_obs = val
 * 
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_16, __pyx_bstride_0_result) = __pyx_v_val;

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":216
 *         else:
 *             result[i] = val
 *             last_obs = val             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_v_last_obs = __pyx_v_val;
    }
    __pyx_L7:;
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":218
 *             last_obs = val
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.ffill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/join.pyx":221
 * 
 * 
 * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids,             # <<<<<<<<<<<<<<
 *                    int64_t max_group):
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_158ffill_by_group(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_158ffill_by_group = {__Pyx_NAMESTR("ffill_by_group"), (PyCFunction)__pyx_pf_6pandas_3lib_158ffill_by_group, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_158ffill_by_group(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_group_ids = 0;
  __pyx_t_5numpy_int64_t __pyx_v_max_group;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_result = 0;
  PyArrayObject *__pyx_v_last_obs = 0;
  __pyx_t_5numpy_int64_t __pyx_v_gid;
  __pyx_t_5numpy_int64_t __pyx_v_val;
  Py_buffer __pyx_bstruct_group_ids;
  Py_ssize_t __pyx_bstride_0_group_ids = 0;
  Py_ssize_t __pyx_bshape_0_group_ids = 0;
  Py_buffer __pyx_bstruct_last_obs;
  Py_ssize_t __pyx_bstride_0_last_obs = 0;
  Py_ssize_t __pyx_bshape_0_last_obs = 0;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyArrayObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  int __pyx_t_15;
  __pyx_t_5numpy_int64_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __pyx_t_5numpy_int64_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__indexer,&__pyx_n_s__group_ids,&__pyx_n_s__max_group,0};
  __Pyx_RefNannySetupContext("ffill_by_group");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__indexer);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group_ids);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_group);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, 2); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "ffill_by_group") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_indexer = ((PyArrayObject *)values[0]);
    __pyx_v_group_ids = ((PyArrayObject *)values[1]);
    __pyx_v_max_group = __Pyx_PyInt_from_py_npy_int64(values[2]); if (unlikely((__pyx_v_max_group == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ffill_by_group", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.ffill_by_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_last_obs.buf = NULL;
  __pyx_bstruct_indexer.buf = NULL;
  __pyx_bstruct_group_ids.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indexer), __pyx_ptype_5numpy_ndarray, 1, "indexer", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_group_ids), __pyx_ptype_5numpy_ndarray, 1, "group_ids", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0];
  __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_group_ids, (PyObject*)__pyx_v_group_ids, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_group_ids = __pyx_bstruct_group_ids.strides[0];
  __pyx_bshape_0_group_ids = __pyx_bstruct_group_ids.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":224
 *                    int64_t max_group):
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)             # <<<<<<<<<<<<<<
 *         ndarray[int64_t] result, last_obs
 *         int64_t gid, val
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_indexer)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_1;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":228
 *         int64_t gid, val
 * 
 *     result = np.empty(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":230
 *     result = np.empty(n, dtype=np.int64)
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     last_obs.fill(-1)
 * 
 */
  __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyInt_to_py_npy_int64(__pyx_v_max_group); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_last_obs);
    __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_last_obs, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_8 < 0)) {
      PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_last_obs, (PyObject*)__pyx_v_last_obs, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
    }
    __pyx_bstride_0_last_obs = __pyx_bstruct_last_obs.strides[0];
    __pyx_bshape_0_last_obs = __pyx_bstruct_last_obs.shape[0];
    if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = 0;
  __pyx_v_last_obs = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":231
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)
 *     last_obs.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_last_obs), __pyx_n_s__fill); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_178), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":233
 *     last_obs.fill(-1)
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         gid = group_ids[i]
 *         val = indexer[i]
 */
  __pyx_t_1 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_1; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":234
 * 
 *     for i in range(n):
 *         gid = group_ids[i]             # <<<<<<<<<<<<<<
 *         val = indexer[i]
 *         if val == -1:
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_group_ids;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_group_ids)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_gid = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_group_ids.buf, __pyx_t_13, __pyx_bstride_0_group_ids));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":235
 *     for i in range(n):
 *         gid = group_ids[i]
 *         val = indexer[i]             # <<<<<<<<<<<<<<
 *         if val == -1:
 *             result[i] = last_obs[gid]
 */
    __pyx_t_14 = __pyx_v_i;
    __pyx_t_8 = -1;
    if (__pyx_t_14 < 0) {
      __pyx_t_14 += __pyx_bshape_0_indexer;
      if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
    } else if (unlikely(__pyx_t_14 >= __pyx_bshape_0_indexer)) __pyx_t_8 = 0;
    if (unlikely(__pyx_t_8 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_8);
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_val = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_indexer.buf, __pyx_t_14, __pyx_bstride_0_indexer));

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":236
 *         gid = group_ids[i]
 *         val = indexer[i]
 *         if val == -1:             # <<<<<<<<<<<<<<
 *             result[i] = last_obs[gid]
 *         else:
 */
    __pyx_t_15 = (__pyx_v_val == -1);
    if (__pyx_t_15) {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":237
 *         val = indexer[i]
 *         if val == -1:
 *             result[i] = last_obs[gid]             # <<<<<<<<<<<<<<
 *         else:
 *             result[i] = val
 */
      __pyx_t_16 = __pyx_v_gid;
      __pyx_t_8 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_last_obs;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_last_obs)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_17, __pyx_bstride_0_result) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_last_obs.buf, __pyx_t_16, __pyx_bstride_0_last_obs));
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":239
 *             result[i] = last_obs[gid]
 *         else:
 *             result[i] = val             # <<<<<<<<<<<<<<
 *             last_obs[gid] = val
 * 
 */
      __pyx_t_18 = __pyx_v_i;
      __pyx_t_8 = -1;
      if (__pyx_t_18 < 0) {
        __pyx_t_18 += __pyx_bshape_0_result;
        if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_18 >= __pyx_bshape_0_result)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_18, __pyx_bstride_0_result) = __pyx_v_val;

      /* "/home/wesm/code/pandas/pandas/src/join.pyx":240
 *         else:
 *             result[i] = val
 *             last_obs[gid] = val             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
      __pyx_t_19 = __pyx_v_gid;
      __pyx_t_8 = -1;
      if (__pyx_t_19 < 0) {
        __pyx_t_19 += __pyx_bshape_0_last_obs;
        if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 0;
      } else if (unlikely(__pyx_t_19 >= __pyx_bshape_0_last_obs)) __pyx_t_8 = 0;
      if (unlikely(__pyx_t_8 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_8);
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_last_obs.buf, __pyx_t_19, __pyx_bstride_0_last_obs) = __pyx_v_val;
    }
    __pyx_L8:;
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":242
 *             last_obs[gid] = val
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_group_ids);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_last_obs);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.ffill_by_group", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_group_ids);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_last_obs);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_last_obs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/join.pyx":247
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def join_sorter(ndarray[int64_t] index, Py_ssize_t ngroups):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, loc, label, n
 */

static PyObject *__pyx_pf_6pandas_3lib_159join_sorter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_159join_sorter = {__Pyx_NAMESTR("join_sorter"), (PyCFunction)__pyx_pf_6pandas_3lib_159join_sorter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_159join_sorter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_index = 0;
  Py_ssize_t __pyx_v_ngroups;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_label;
  Py_ssize_t __pyx_v_n;
  PyArrayObject *__pyx_v_counts = 0;
  PyArrayObject *__pyx_v_where = 0;
  PyArrayObject *__pyx_v_result = 0;
  Py_buffer __pyx_bstruct_index;
  Py_ssize_t __pyx_bstride_0_index = 0;
  Py_ssize_t __pyx_bshape_0_index = 0;
  Py_buffer __pyx_bstruct_result;
  Py_ssize_t __pyx_bstride_0_result = 0;
  Py_ssize_t __pyx_bshape_0_result = 0;
  Py_buffer __pyx_bstruct_counts;
  Py_ssize_t __pyx_bstride_0_counts = 0;
  Py_ssize_t __pyx_bshape_0_counts = 0;
  Py_buffer __pyx_bstruct_where;
  Py_ssize_t __pyx_bstride_0_where = 0;
  Py_ssize_t __pyx_bshape_0_where = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyArrayObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  __pyx_t_5numpy_int64_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  __pyx_t_5numpy_int64_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__index,&__pyx_n_s__ngroups,0};
  __Pyx_RefNannySetupContext("join_sorter");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ngroups);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("join_sorter", 1, 2, 2, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "join_sorter") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_index = ((PyArrayObject *)values[0]);
    __pyx_v_ngroups = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_ngroups == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("join_sorter", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.join_sorter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_bstruct_counts.buf = NULL;
  __pyx_bstruct_where.buf = NULL;
  __pyx_bstruct_result.buf = NULL;
  __pyx_bstruct_index.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_index, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_index = __pyx_bstruct_index.strides[0];
  __pyx_bshape_0_index = __pyx_bstruct_index.shape[0];

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":253
 * 
 *     # count group sizes, location 0 for NA
 *     counts = np.zeros(ngroups + 1, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     n = len(index)
 *     for i from 0 <= i < n:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_ngroups + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_counts, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_counts = __pyx_bstruct_counts.strides[0];
    __pyx_bshape_0_counts = __pyx_bstruct_counts.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_counts = ((PyArrayObject *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":254
 *     # count group sizes, location 0 for NA
 *     counts = np.zeros(ngroups + 1, dtype=np.int64)
 *     n = len(index)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         counts[index[i] + 1] += 1
 */
  __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_index)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_11;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":255
 *     counts = np.zeros(ngroups + 1, dtype=np.int64)
 *     n = len(index)
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         counts[index[i] + 1] += 1
 * 
 */
  __pyx_t_11 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":256
 *     n = len(index)
 *     for i from 0 <= i < n:
 *         counts[index[i] + 1] += 1             # <<<<<<<<<<<<<<
 * 
 *     # mark the start of each contiguous group of like-indexed data
 */
    __pyx_t_12 = __pyx_v_i;
    __pyx_t_13 = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_index.buf, __pyx_t_12, __pyx_bstride_0_index)) + 1);
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_13, __pyx_bstride_0_counts) += 1;
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":259
 * 
 *     # mark the start of each contiguous group of like-indexed data
 *     where = np.zeros(ngroups + 1, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     for i from 1 <= i < ngroups + 1:
 *         where[i] = where[i - 1] + counts[i - 1]
 */
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_ngroups + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_4);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_where);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_where, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_where, (PyObject*)__pyx_v_where, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      }
    }
    __pyx_bstride_0_where = __pyx_bstruct_where.strides[0];
    __pyx_bshape_0_where = __pyx_bstruct_where.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_where = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":260
 *     # mark the start of each contiguous group of like-indexed data
 *     where = np.zeros(ngroups + 1, dtype=np.int64)
 *     for i from 1 <= i < ngroups + 1:             # <<<<<<<<<<<<<<
 *         where[i] = where[i - 1] + counts[i - 1]
 * 
 */
  __pyx_t_11 = (__pyx_v_ngroups + 1);
  for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":261
 *     where = np.zeros(ngroups + 1, dtype=np.int64)
 *     for i from 1 <= i < ngroups + 1:
 *         where[i] = where[i - 1] + counts[i - 1]             # <<<<<<<<<<<<<<
 * 
 *     # this is our indexer
 */
    __pyx_t_14 = (__pyx_v_i - 1);
    __pyx_t_15 = (__pyx_v_i - 1);
    __pyx_t_16 = __pyx_v_i;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_where.buf, __pyx_t_16, __pyx_bstride_0_where) = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_where.buf, __pyx_t_14, __pyx_bstride_0_where)) + (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_counts.buf, __pyx_t_15, __pyx_bstride_0_counts)));
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":264
 * 
 *     # this is our indexer
 *     result = np.zeros(n, dtype=np.int64)             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < n:
 *         label = index[i] + 1
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_7 < 0)) {
      PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_result, (PyObject*)__pyx_v_result, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
    }
    __pyx_bstride_0_result = __pyx_bstruct_result.strides[0];
    __pyx_bshape_0_result = __pyx_bstruct_result.shape[0];
    if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = 0;
  __pyx_v_result = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":265
 *     # this is our indexer
 *     result = np.zeros(n, dtype=np.int64)
 *     for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *         label = index[i] + 1
 *         result[where[label]] = i
 */
  __pyx_t_11 = __pyx_v_n;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":266
 *     result = np.zeros(n, dtype=np.int64)
 *     for i from 0 <= i < n:
 *         label = index[i] + 1             # <<<<<<<<<<<<<<
 *         result[where[label]] = i
 *         where[label] += 1
 */
    __pyx_t_17 = __pyx_v_i;
    __pyx_v_label = ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_index.buf, __pyx_t_17, __pyx_bstride_0_index)) + 1);

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":267
 *     for i from 0 <= i < n:
 *         label = index[i] + 1
 *         result[where[label]] = i             # <<<<<<<<<<<<<<
 *         where[label] += 1
 * 
 */
    __pyx_t_18 = __pyx_v_label;
    __pyx_t_19 = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_where.buf, __pyx_t_18, __pyx_bstride_0_where));
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_result.buf, __pyx_t_19, __pyx_bstride_0_result) = __pyx_v_i;

    /* "/home/wesm/code/pandas/pandas/src/join.pyx":268
 *         label = index[i] + 1
 *         result[where[label]] = i
 *         where[label] += 1             # <<<<<<<<<<<<<<
 * 
 *     return result, counts
 */
    __pyx_t_20 = __pyx_v_label;
    *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_where.buf, __pyx_t_20, __pyx_bstride_0_where) += 1;
  }

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":270
 *         where[label] += 1
 * 
 *     return result, counts             # <<<<<<<<<<<<<<
 * 
 * def _big_join_sorter(index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_counts));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_counts));
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_where);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.join_sorter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_index);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_result);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_counts);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_where);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_counts);
  __Pyx_XDECREF((PyObject *)__pyx_v_where);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/join.pyx":272
 *     return result, counts
 * 
 * def _big_join_sorter(index):             # <<<<<<<<<<<<<<
 *     pass
 */

static PyObject *__pyx_pf_6pandas_3lib_160_big_join_sorter(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_160_big_join_sorter = {__Pyx_NAMESTR("_big_join_sorter"), (PyCFunction)__pyx_pf_6pandas_3lib_160_big_join_sorter, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_160_big_join_sorter(PyObject *__pyx_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_big_join_sorter");
  __pyx_self = __pyx_self;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":31
 * #     int PyTuple_Check(object)
 * 
 * cdef inline is_definitely_invalid_key(object val):             # <<<<<<<<<<<<<<
 *     if PyTuple_Check(val):
 *         try:
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_is_definitely_invalid_key(PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_hash_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_definitely_invalid_key");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":32
 * 
 * cdef inline is_definitely_invalid_key(object val):
 *     if PyTuple_Check(val):             # <<<<<<<<<<<<<<
 *         try:
 *             hash(val)
 */
  __pyx_t_1 = PyTuple_Check(__pyx_v_val);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":33
 * cdef inline is_definitely_invalid_key(object val):
 *     if PyTuple_Check(val):
 *         try:             # <<<<<<<<<<<<<<
 *             hash(val)
 *         except TypeError:
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      /*try:*/ {

        /* "/home/wesm/code/pandas/pandas/src/engines.pyx":34
 *     if PyTuple_Check(val):
 *         try:
 *             hash(val)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             return True
 */
        __pyx_t_5 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      }
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L11_try_end;
      __pyx_L4_error:;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":35
 *         try:
 *             hash(val)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
      __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_6) {
        __Pyx_AddTraceback("pandas.lib.is_definitely_invalid_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "/home/wesm/code/pandas/pandas/src/engines.pyx":36
 *             hash(val)
 *         except TypeError:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     return (PySlice_Check(val) or cnp.PyArray_Check(val)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L7_except_return;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L5_exception_handled;
      }
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L1_error;
      __pyx_L7_except_return:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      goto __pyx_L0;
      __pyx_L5_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
      __pyx_L11_try_end:;
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":38
 *             return True
 * 
 *     return (PySlice_Check(val) or cnp.PyArray_Check(val)             # <<<<<<<<<<<<<<
 *             or PyList_Check(val))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_9 = PyInt_FromLong(PySlice_Check(__pyx_v_val)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_1) {
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":39
 * 
 *     return (PySlice_Check(val) or cnp.PyArray_Check(val)
 *             or PyList_Check(val))             # <<<<<<<<<<<<<<
 * 
 * def get_value_at(ndarray arr, object loc):
 */
    __pyx_t_1 = PyArray_Check(__pyx_v_val);
    if (!__pyx_t_1) {
      __pyx_t_11 = PyList_Check(__pyx_v_val);
      __pyx_t_12 = __pyx_t_11;
    } else {
      __pyx_t_12 = __pyx_t_1;
    }
    __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __pyx_t_8;
    __pyx_t_8 = 0;
  } else {
    __pyx_t_7 = __pyx_t_9;
    __pyx_t_9 = 0;
  }
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("pandas.lib.is_definitely_invalid_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":41
 *             or PyList_Check(val))
 * 
 * def get_value_at(ndarray arr, object loc):             # <<<<<<<<<<<<<<
 *     return util.get_value_at(arr, loc)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_161get_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_161get_value_at = {__Pyx_NAMESTR("get_value_at"), (PyCFunction)__pyx_pf_6pandas_3lib_161get_value_at, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_161get_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__loc,0};
  __Pyx_RefNannySetupContext("get_value_at");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_value_at", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_value_at") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_loc = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_value_at", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":42
 * 
 * def get_value_at(ndarray arr, object loc):
 *     return util.get_value_at(arr, loc)             # <<<<<<<<<<<<<<
 * 
 * def set_value_at(ndarray arr, object loc, object val):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":44
 *     return util.get_value_at(arr, loc)
 * 
 * def set_value_at(ndarray arr, object loc, object val):             # <<<<<<<<<<<<<<
 *     return util.set_value_at(arr, loc, val)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_162set_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pandas_3lib_162set_value_at = {__Pyx_NAMESTR("set_value_at"), (PyCFunction)__pyx_pf_6pandas_3lib_162set_value_at, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pandas_3lib_162set_value_at(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__loc,&__pyx_n_s__val,0};
  __Pyx_RefNannySetupContext("set_value_at");
  __pyx_self = __pyx_self;
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__val);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_value_at") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_loc = values[1];
    __pyx_v_val = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_value_at", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":45
 * 
 * def set_value_at(ndarray arr, object loc, object val):
 *     return util.set_value_at(arr, loc, val)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_4util_set_value_at(__pyx_v_arr, __pyx_v_loc, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":63
 *         bint initialized, monotonic_check, unique_check
 * 
 *     def __init__(self, vgetter, n):             # <<<<<<<<<<<<<<
 *         self.vgetter = vgetter
 * 
 */

static int __pyx_pf_6pandas_3lib_11IndexEngine___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pandas_3lib_11IndexEngine___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vgetter = 0;
  PyObject *__pyx_v_n = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vgetter,&__pyx_n_s__n,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vgetter);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_vgetter = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.IndexEngine.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":64
 * 
 *     def __init__(self, vgetter, n):
 *         self.vgetter = vgetter             # <<<<<<<<<<<<<<
 * 
 *         self.over_size_threshold = n >= _SIZE_CUTOFF
 */
  __Pyx_INCREF(__pyx_v_vgetter);
  __Pyx_GIVEREF(__pyx_v_vgetter);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->vgetter);
  __Pyx_DECREF(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->vgetter);
  ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->vgetter = __pyx_v_vgetter;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":66
 *         self.vgetter = vgetter
 * 
 *         self.over_size_threshold = n >= _SIZE_CUTOFF             # <<<<<<<<<<<<<<
 * 
 *         self.initialized = 0
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_6pandas_3lib__SIZE_CUTOFF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->over_size_threshold = __pyx_t_3;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":68
 *         self.over_size_threshold = n >= _SIZE_CUTOFF
 * 
 *         self.initialized = 0             # <<<<<<<<<<<<<<
 *         self.monotonic_check = 0
 * 
 */
  ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->initialized = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":69
 * 
 *         self.initialized = 0
 *         self.monotonic_check = 0             # <<<<<<<<<<<<<<
 * 
 *         self.unique = 0
 */
  ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->monotonic_check = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":71
 *         self.monotonic_check = 0
 * 
 *         self.unique = 0             # <<<<<<<<<<<<<<
 *         self.monotonic = 0
 * 
 */
  ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->unique = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":72
 * 
 *         self.unique = 0
 *         self.monotonic = 0             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, object val):
 */
  ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->monotonic = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":74
 *         self.monotonic = 0
 * 
 *     def __contains__(self, object val):             # <<<<<<<<<<<<<<
 *         self._ensure_mapping_populated()
 *         hash(val)
 */

static int __pyx_pf_6pandas_3lib_11IndexEngine_1__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pf_6pandas_3lib_11IndexEngine_1__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_hash_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__contains__");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":75
 * 
 *     def __contains__(self, object val):
 *         self._ensure_mapping_populated()             # <<<<<<<<<<<<<<
 *         hash(val)
 *         return val in self.mapping
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->__pyx_vtab)->_ensure_mapping_populated(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":76
 *     def __contains__(self, object val):
 *         self._ensure_mapping_populated()
 *         hash(val)             # <<<<<<<<<<<<<<
 *         return val in self.mapping
 * 
 */
  __pyx_t_2 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":77
 *         self._ensure_mapping_populated()
 *         hash(val)
 *         return val in self.mapping             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_value(self, ndarray arr, object key):
 */
  __pyx_t_3 = ((PySequence_Contains(((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->mapping), __pyx_v_val))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":79
 *         return val in self.mapping
 * 
 *     cpdef get_value(self, ndarray arr, object key):             # <<<<<<<<<<<<<<
 *         '''
 *         arr : 1-dimensional ndarray
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_2get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_11IndexEngine_get_value(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_11IndexEngine_2get_value)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_arr));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_arr));
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":87
 *             void* data_ptr
 * 
 *         loc = self.get_loc(key)             # <<<<<<<<<<<<<<
 *         if PySlice_Check(loc) or cnp.PyArray_Check(loc):
 *             return arr[loc]
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_loc(__pyx_v_self, __pyx_v_key, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_loc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":88
 * 
 *         loc = self.get_loc(key)
 *         if PySlice_Check(loc) or cnp.PyArray_Check(loc):             # <<<<<<<<<<<<<<
 *             return arr[loc]
 *         else:
 */
  if (!PySlice_Check(__pyx_v_loc)) {
    __pyx_t_4 = PyArray_Check(__pyx_v_loc);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = PySlice_Check(__pyx_v_loc);
  }
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":89
 *         loc = self.get_loc(key)
 *         if PySlice_Check(loc) or cnp.PyArray_Check(loc):
 *             return arr[loc]             # <<<<<<<<<<<<<<
 *         else:
 *             if arr.descr.type_num == NPY_DATETIME:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_arr), __pyx_v_loc); if (!__pyx_t_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":91
 *             return arr[loc]
 *         else:
 *             if arr.descr.type_num == NPY_DATETIME:             # <<<<<<<<<<<<<<
 *                 return Timestamp(util.get_value_at(arr, loc))
 *             return util.get_value_at(arr, loc)
 */
    __pyx_t_5 = (__pyx_v_arr->descr->type_num == NPY_DATETIME);
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":92
 *         else:
 *             if arr.descr.type_num == NPY_DATETIME:
 *                 return Timestamp(util.get_value_at(arr, loc))             # <<<<<<<<<<<<<<
 *             return util.get_value_at(arr, loc)
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":93
 *             if arr.descr.type_num == NPY_DATETIME:
 *                 return Timestamp(util.get_value_at(arr, loc))
 *             return util.get_value_at(arr, loc)             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_value(self, ndarray arr, object key, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __pyx_f_4util_get_value_at(__pyx_v_arr, __pyx_v_loc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":79
 *         return val in self.mapping
 * 
 *     cpdef get_value(self, ndarray arr, object key):             # <<<<<<<<<<<<<<
 *         '''
 *         arr : 1-dimensional ndarray
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_2get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_11IndexEngine_2get_value[] = "\n        arr : 1-dimensional ndarray\n        ";
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_2get_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__key,0};
  __Pyx_RefNannySetupContext("get_value");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_value") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_key = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_value", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->__pyx_vtab)->get_value(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self), __pyx_v_arr, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":95
 *             return util.get_value_at(arr, loc)
 * 
 *     cpdef set_value(self, ndarray arr, object key, object value):             # <<<<<<<<<<<<<<
 *         '''
 *         arr : 1-dimensional ndarray
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_3set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_11IndexEngine_set_value(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self, PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_loc = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_value");
  __Pyx_INCREF(__pyx_v_value);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_11IndexEngine_3set_value)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_arr));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_arr));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_arr));
      __Pyx_INCREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      __Pyx_INCREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":103
 *             void* data_ptr
 * 
 *         loc = self.get_loc(key)             # <<<<<<<<<<<<<<
 *         value = convert_scalar(arr, value)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->get_loc(__pyx_v_self, __pyx_v_key, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_loc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":104
 * 
 *         loc = self.get_loc(key)
 *         value = convert_scalar(arr, value)             # <<<<<<<<<<<<<<
 * 
 *         if PySlice_Check(loc) or cnp.PyArray_Check(loc):
 */
  __pyx_t_1 = __pyx_f_6pandas_3lib_convert_scalar(__pyx_v_arr, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":106
 *         value = convert_scalar(arr, value)
 * 
 *         if PySlice_Check(loc) or cnp.PyArray_Check(loc):             # <<<<<<<<<<<<<<
 *             arr[loc] = value
 *         else:
 */
  if (!PySlice_Check(__pyx_v_loc)) {
    __pyx_t_4 = PyArray_Check(__pyx_v_loc);
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = PySlice_Check(__pyx_v_loc);
  }
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":107
 * 
 *         if PySlice_Check(loc) or cnp.PyArray_Check(loc):
 *             arr[loc] = value             # <<<<<<<<<<<<<<
 *         else:
 *             util.set_value_at(arr, loc, value)
 */
    if (PyObject_SetItem(((PyObject *)__pyx_v_arr), __pyx_v_loc, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":109
 *             arr[loc] = value
 *         else:
 *             util.set_value_at(arr, loc, value)             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_loc(self, object val):
 */
    __pyx_t_1 = __pyx_f_4util_set_value_at(__pyx_v_arr, __pyx_v_loc, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":95
 *             return util.get_value_at(arr, loc)
 * 
 *     cpdef set_value(self, ndarray arr, object key, object value):             # <<<<<<<<<<<<<<
 *         '''
 *         arr : 1-dimensional ndarray
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_3set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pandas_3lib_11IndexEngine_3set_value[] = "\n        arr : 1-dimensional ndarray\n        ";
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_3set_value(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__key,&__pyx_n_s__value,0};
  __Pyx_RefNannySetupContext("set_value");
  {
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[2])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, 2); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_value") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_key = values[1];
    __pyx_v_value = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_value", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->__pyx_vtab)->set_value(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self), __pyx_v_arr, __pyx_v_key, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":111
 *             util.set_value_at(arr, loc, value)
 * 
 *     cpdef get_loc(self, object val):             # <<<<<<<<<<<<<<
 *         if is_definitely_invalid_key(val):
 *             raise TypeError
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_4get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_11IndexEngine_get_loc(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_loc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_loc");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_11IndexEngine_4get_loc)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":112
 * 
 *     cpdef get_loc(self, object val):
 *         if is_definitely_invalid_key(val):             # <<<<<<<<<<<<<<
 *             raise TypeError
 * 
 */
  __pyx_t_1 = __pyx_f_6pandas_3lib_is_definitely_invalid_key(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":113
 *     cpdef get_loc(self, object val):
 *         if is_definitely_invalid_key(val):
 *             raise TypeError             # <<<<<<<<<<<<<<
 * 
 *         if self.over_size_threshold and self.is_monotonic:
 */
    __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
    {__pyx_filename = __pyx_f[12]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":115
 *             raise TypeError
 * 
 *         if self.over_size_threshold and self.is_monotonic:             # <<<<<<<<<<<<<<
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)
 */
  __pyx_t_4 = __pyx_v_self->over_size_threshold;
  if (__pyx_t_4) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":116
 * 
 *         if self.over_size_threshold and self.is_monotonic:
 *             if not self.is_unique:             # <<<<<<<<<<<<<<
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (!__pyx_t_6);
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":117
 *         if self.over_size_threshold and self.is_monotonic:
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)             # <<<<<<<<<<<<<<
 *             values = self._get_index_values()
 *             loc = values.searchsorted(val, side='left')
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_loc_duplicates(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":118
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()             # <<<<<<<<<<<<<<
 *             loc = values.searchsorted(val, side='left')
 *             if util.get_value_at(values, loc) != val:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_values = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":119
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()
 *             loc = values.searchsorted(val, side='left')             # <<<<<<<<<<<<<<
 *             if util.get_value_at(values, loc) != val:
 *                 raise KeyError(val)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__left)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_loc = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":120
 *             values = self._get_index_values()
 *             loc = values.searchsorted(val, side='left')
 *             if util.get_value_at(values, loc) != val:             # <<<<<<<<<<<<<<
 *                 raise KeyError(val)
 *             return loc
 */
    if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = __pyx_v_values;
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_2 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_7), __pyx_v_loc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_v_val, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":121
 *             loc = values.searchsorted(val, side='left')
 *             if util.get_value_at(values, loc) != val:
 *                 raise KeyError(val)             # <<<<<<<<<<<<<<
 *             return loc
 * 
 */
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_2 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":122
 *             if util.get_value_at(values, loc) != val:
 *                 raise KeyError(val)
 *             return loc             # <<<<<<<<<<<<<<
 * 
 *         self._ensure_mapping_populated()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_loc);
    __pyx_r = __pyx_v_loc;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":124
 *             return loc
 * 
 *         self._ensure_mapping_populated()             # <<<<<<<<<<<<<<
 *         if not self.unique:
 *             return self._get_loc_duplicates(val)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":125
 * 
 *         self._ensure_mapping_populated()
 *         if not self.unique:             # <<<<<<<<<<<<<<
 *             return self._get_loc_duplicates(val)
 * 
 */
  __pyx_t_4 = (!__pyx_v_self->unique);
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":126
 *         self._ensure_mapping_populated()
 *         if not self.unique:
 *             return self._get_loc_duplicates(val)             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_loc_duplicates(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":128
 *             return self._get_loc_duplicates(val)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             return self.mapping.get_item(val)
 *         except TypeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":129
 * 
 *         try:
 *             return self.mapping.get_item(val)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             self._check_type(val)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self->mapping), __pyx_n_s__get_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L12_try_return;
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L15_try_end;
    __pyx_L12_try_return:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L0;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":130
 *         try:
 *             return self.mapping.get_item(val)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             self._check_type(val)
 *             raise KeyError(val)
 */
    __pyx_t_11 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("pandas.lib.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":131
 *             return self.mapping.get_item(val)
 *         except TypeError:
 *             self._check_type(val)             # <<<<<<<<<<<<<<
 *             raise KeyError(val)
 * 
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_check_type(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":132
 *         except TypeError:
 *             self._check_type(val)
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _get_loc_duplicates(self, object val):
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_12 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_12, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L9_exception_handled;
    }
    __pyx_L10_except_error:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L9_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L15_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":111
 *             util.set_value_at(arr, loc, value)
 * 
 *     cpdef get_loc(self, object val):             # <<<<<<<<<<<<<<
 *         if is_definitely_invalid_key(val):
 *             raise TypeError
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_4get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_4get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_loc");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->__pyx_vtab)->get_loc(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":134
 *             raise KeyError(val)
 * 
 *     cdef inline _get_loc_duplicates(self, object val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t diff
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_11IndexEngine__get_loc_duplicates(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) {
  Py_ssize_t __pyx_v_diff;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_left = NULL;
  PyObject *__pyx_v_right = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_loc_duplicates");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":138
 *             Py_ssize_t diff
 * 
 *         if self.is_monotonic:             # <<<<<<<<<<<<<<
 *             values = self._get_index_values()
 *             left = values.searchsorted(val, side='left')
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":139
 * 
 *         if self.is_monotonic:
 *             values = self._get_index_values()             # <<<<<<<<<<<<<<
 *             left = values.searchsorted(val, side='left')
 *             right = values.searchsorted(val, side='right')
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_values = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":140
 *         if self.is_monotonic:
 *             values = self._get_index_values()
 *             left = values.searchsorted(val, side='left')             # <<<<<<<<<<<<<<
 *             right = values.searchsorted(val, side='right')
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__left)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_v_left = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":141
 *             values = self._get_index_values()
 *             left = values.searchsorted(val, side='left')
 *             right = values.searchsorted(val, side='right')             # <<<<<<<<<<<<<<
 * 
 *             diff = right - left
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__right)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_right = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":143
 *             right = values.searchsorted(val, side='right')
 * 
 *             diff = right - left             # <<<<<<<<<<<<<<
 *             if diff == 0:
 *                 raise KeyError(val)
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_right, __pyx_v_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_diff = __pyx_t_6;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":146
 *             if diff == 0:
 *                 raise KeyError(val)
 *             elif diff == 1:             # <<<<<<<<<<<<<<
 *                 return left
 *             else:
 */
    switch (__pyx_v_diff) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":144
 * 
 *             diff = right - left
 *             if diff == 0:             # <<<<<<<<<<<<<<
 *                 raise KeyError(val)
 *             elif diff == 1:
 */
      case 0:

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":145
 *             diff = right - left
 *             if diff == 0:
 *                 raise KeyError(val)             # <<<<<<<<<<<<<<
 *             elif diff == 1:
 *                 return left
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":146
 *             if diff == 0:
 *                 raise KeyError(val)
 *             elif diff == 1:             # <<<<<<<<<<<<<<
 *                 return left
 *             else:
 */
      case 1:

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":147
 *                 raise KeyError(val)
 *             elif diff == 1:
 *                 return left             # <<<<<<<<<<<<<<
 *             else:
 *                 return slice(left, right)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_left);
      __pyx_r = __pyx_v_left;
      goto __pyx_L0;
      break;
      default:

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":149
 *                 return left
 *             else:
 *                 return slice(left, right)             # <<<<<<<<<<<<<<
 *         else:
 *             return self._maybe_get_bool_indexer(val)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_v_left);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_left);
      __Pyx_GIVEREF(__pyx_v_left);
      __Pyx_INCREF(__pyx_v_right);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_right);
      __Pyx_GIVEREF(__pyx_v_right);
      __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
      break;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":151
 *                 return slice(left, right)
 *         else:
 *             return self._maybe_get_bool_indexer(val)             # <<<<<<<<<<<<<<
 * 
 *     cdef _maybe_get_bool_indexer(self, object val):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_maybe_get_bool_indexer(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib.IndexEngine._get_loc_duplicates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_left);
  __Pyx_XDECREF(__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":153
 *             return self._maybe_get_bool_indexer(val)
 * 
 *     cdef _maybe_get_bool_indexer(self, object val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray[uint8_t] indexer
 */

static PyObject *__pyx_f_6pandas_3lib_11IndexEngine__maybe_get_bool_indexer(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) {
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_values = 0;
  int __pyx_v_count;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  int __pyx_v_last_true;
  PyObject *__pyx_v_result = NULL;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyArrayObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_maybe_get_bool_indexer");
  __pyx_bstruct_indexer.buf = NULL;
  __pyx_bstruct_values.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":157
 *             ndarray[uint8_t] indexer
 *             ndarray[object] values
 *             int count = 0             # <<<<<<<<<<<<<<
 *             Py_ssize_t i, n
 *             int last_true
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":161
 *             int last_true
 * 
 *         values = self._get_index_values()             # <<<<<<<<<<<<<<
 *         n = len(values)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_object, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      }
    }
    __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
    __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":162
 * 
 *         values = self._get_index_values()
 *         n = len(values)             # <<<<<<<<<<<<<<
 * 
 *         result = np.empty(n, dtype=bool)
 */
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_7;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":164
 *         n = len(values)
 * 
 *         result = np.empty(n, dtype=bool)             # <<<<<<<<<<<<<<
 *         indexer = result.view(np.uint8)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool))) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = PyEval_CallObjectWithKeywords(__pyx_t_8, ((PyObject *)__pyx_t_9), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":165
 * 
 *         result = np.empty(n, dtype=bool)
 *         indexer = result.view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_10 = PyObject_GetAttr(__pyx_v_result, __pyx_n_s__view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uint8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = ((PyArrayObject *)__pyx_t_9);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      }
    }
    __pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0];
    __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":167
 *         indexer = result.view(np.uint8)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             if values[i] == val:
 *                 count += 1
 */
  __pyx_t_7 = __pyx_v_n;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_7; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":168
 * 
 *         for i in range(n):
 *             if values[i] == val:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 indexer[i] = 1
 */
    __pyx_t_13 = __pyx_v_i;
    __pyx_t_3 = -1;
    if (__pyx_t_13 < 0) {
      __pyx_t_13 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_13 < 0)) __pyx_t_3 = 0;
    } else if (unlikely(__pyx_t_13 >= __pyx_bshape_0_values)) __pyx_t_3 = 0;
    if (unlikely(__pyx_t_3 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_3);
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = *__Pyx_BufPtrStrided1d(PyObject **, __pyx_bstruct_values.buf, __pyx_t_13, __pyx_bstride_0_values);
    __Pyx_INCREF((PyObject*)__pyx_t_9);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_v_val, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_14) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":169
 *         for i in range(n):
 *             if values[i] == val:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 indexer[i] = 1
 *                 last_true = i
 */
      __pyx_v_count = (__pyx_v_count + 1);

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":170
 *             if values[i] == val:
 *                 count += 1
 *                 indexer[i] = 1             # <<<<<<<<<<<<<<
 *                 last_true = i
 *             else:
 */
      __pyx_t_15 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_15 < 0) {
        __pyx_t_15 += __pyx_bshape_0_indexer;
        if (unlikely(__pyx_t_15 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_indexer)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_indexer.buf, __pyx_t_15, __pyx_bstride_0_indexer) = 1;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":171
 *                 count += 1
 *                 indexer[i] = 1
 *                 last_true = i             # <<<<<<<<<<<<<<
 *             else:
 *                 indexer[i] = 0
 */
      __pyx_v_last_true = __pyx_v_i;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":173
 *                 last_true = i
 *             else:
 *                 indexer[i] = 0             # <<<<<<<<<<<<<<
 * 
 *         if count == 0:
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_3 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_indexer;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_3 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_indexer)) __pyx_t_3 = 0;
      if (unlikely(__pyx_t_3 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_3);
        {__pyx_filename = __pyx_f[12]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_indexer.buf, __pyx_t_16, __pyx_bstride_0_indexer) = 0;
    }
    __pyx_L5:;
  }

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":175
 *                 indexer[i] = 0
 * 
 *         if count == 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(val)
 *         if count == 1:
 */
  __pyx_t_14 = (__pyx_v_count == 0);
  if (__pyx_t_14) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":176
 * 
 *         if count == 0:
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 *         if count == 1:
 *             return last_true
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_9 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    {__pyx_filename = __pyx_f[12]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":177
 *         if count == 0:
 *             raise KeyError(val)
 *         if count == 1:             # <<<<<<<<<<<<<<
 *             return last_true
 * 
 */
  __pyx_t_14 = (__pyx_v_count == 1);
  if (__pyx_t_14) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":178
 *             raise KeyError(val)
 *         if count == 1:
 *             return last_true             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_9 = PyInt_FromLong(__pyx_v_last_true); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":180
 *             return last_true
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     property is_unique:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.IndexEngine._maybe_get_bool_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":184
 *     property is_unique:
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if not self.unique_check:
 *                 self._do_unique_check()
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_9is_unique___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_9is_unique___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":185
 * 
 *         def __get__(self):
 *             if not self.unique_check:             # <<<<<<<<<<<<<<
 *                 self._do_unique_check()
 * 
 */
  __pyx_t_1 = (!((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->unique_check);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":186
 *         def __get__(self):
 *             if not self.unique_check:
 *                 self._do_unique_check()             # <<<<<<<<<<<<<<
 * 
 *             return self.unique == 1
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->__pyx_vtab)->_do_unique_check(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":188
 *                 self._do_unique_check()
 * 
 *             return self.unique == 1             # <<<<<<<<<<<<<<
 * 
 *     property is_monotonic:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->unique == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.is_unique.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":192
 *     property is_monotonic:
 * 
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if not self.monotonic_check:
 *                 self._do_monotonic_check()
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_12is_monotonic___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_12is_monotonic___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":193
 * 
 *         def __get__(self):
 *             if not self.monotonic_check:             # <<<<<<<<<<<<<<
 *                 self._do_monotonic_check()
 * 
 */
  __pyx_t_1 = (!((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->monotonic_check);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":194
 *         def __get__(self):
 *             if not self.monotonic_check:
 *                 self._do_monotonic_check()             # <<<<<<<<<<<<<<
 * 
 *             return self.monotonic == 1
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->__pyx_vtab)->_do_monotonic_check(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":196
 *                 self._do_monotonic_check()
 * 
 *             return self.monotonic == 1             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _do_monotonic_check(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong((((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->monotonic == 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.is_monotonic.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":198
 *             return self.monotonic == 1
 * 
 *     cdef inline _do_monotonic_check(self):             # <<<<<<<<<<<<<<
 *         try:
 *             values = self._get_index_values()
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_11IndexEngine__do_monotonic_check(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_unique = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_monotonic_check");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":199
 * 
 *     cdef inline _do_monotonic_check(self):
 *         try:             # <<<<<<<<<<<<<<
 *             values = self._get_index_values()
 *             self.monotonic, unique = self._call_monotonic(values)
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":200
 *     cdef inline _do_monotonic_check(self):
 *         try:
 *             values = self._get_index_values()             # <<<<<<<<<<<<<<
 *             self.monotonic, unique = self._call_monotonic(values)
 * 
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_values = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":201
 *         try:
 *             values = self._get_index_values()
 *             self.monotonic, unique = self._call_monotonic(values)             # <<<<<<<<<<<<<<
 * 
 *             if unique is not None:
 */
      __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s___call_monotonic); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_values);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_values);
      __Pyx_GIVEREF(__pyx_v_values);
      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
        PyObject* sequence = __pyx_t_6;
        if (likely(PyTuple_CheckExact(sequence))) {
          if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
            if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
            else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
            {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          if (unlikely(PyList_GET_SIZE(sequence) != 2)) {
            if (PyList_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
            else __Pyx_RaiseNeedMoreValuesError(PyList_GET_SIZE(sequence));
            {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
          }
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_StopIteration)) PyErr_Clear();
        if (!PyErr_Occurred()) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_L12_unpacking_done:;
      }
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_self->monotonic = __pyx_t_9;
      __pyx_v_unique = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":203
 *             self.monotonic, unique = self._call_monotonic(values)
 * 
 *             if unique is not None:             # <<<<<<<<<<<<<<
 *                 self.unique = unique
 *                 self.unique_check = 1
 */
      __pyx_t_9 = (__pyx_v_unique != Py_None);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/engines.pyx":204
 * 
 *             if unique is not None:
 *                 self.unique = unique             # <<<<<<<<<<<<<<
 *                 self.unique_check = 1
 * 
 */
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_unique); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        __pyx_v_self->unique = __pyx_t_9;

        /* "/home/wesm/code/pandas/pandas/src/engines.pyx":205
 *             if unique is not None:
 *                 self.unique = unique
 *                 self.unique_check = 1             # <<<<<<<<<<<<<<
 * 
 *         except TypeError:
 */
        __pyx_v_self->unique_check = 1;
        goto __pyx_L13;
      }
      __pyx_L13:;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":207
 *                 self.unique_check = 1
 * 
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             self.monotonic = 0
 *         self.monotonic_check = 1
 */
    __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("pandas.lib.IndexEngine._do_monotonic_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":208
 * 
 *         except TypeError:
 *             self.monotonic = 0             # <<<<<<<<<<<<<<
 *         self.monotonic_check = 1
 * 
 */
      __pyx_v_self->monotonic = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":209
 *         except TypeError:
 *             self.monotonic = 0
 *         self.monotonic_check = 1             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_index_values(self):
 */
  __pyx_v_self->monotonic_check = 1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pandas.lib.IndexEngine._do_monotonic_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_unique);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":211
 *         self.monotonic_check = 1
 * 
 *     cdef _get_index_values(self):             # <<<<<<<<<<<<<<
 *         return self.vgetter()
 * 
 */

static PyObject *__pyx_f_6pandas_3lib_11IndexEngine__get_index_values(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_index_values");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":212
 * 
 *     cdef _get_index_values(self):
 *         return self.vgetter()             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _do_unique_check(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_Call(__pyx_v_self->vgetter, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexEngine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":214
 *         return self.vgetter()
 * 
 *     cdef inline _do_unique_check(self):             # <<<<<<<<<<<<<<
 *         self._ensure_mapping_populated()
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_11IndexEngine__do_unique_check(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_do_unique_check");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":215
 * 
 *     cdef inline _do_unique_check(self):
 *         self._ensure_mapping_populated()             # <<<<<<<<<<<<<<
 * 
 *     def _call_monotonic(self, values):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_ensure_mapping_populated(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexEngine._do_unique_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":217
 *         self._ensure_mapping_populated()
 * 
 *     def _call_monotonic(self, values):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_5_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_5_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_monotonic");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":218
 * 
 *     def _call_monotonic(self, values):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef _make_hash_table(self, n):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.IndexEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":220
 *         raise NotImplementedError
 * 
 *     cdef _make_hash_table(self, n):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

static PyObject *__pyx_f_6pandas_3lib_11IndexEngine__make_hash_table(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_hash_table");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":221
 * 
 *     cdef _make_hash_table(self, n):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _check_type(self, object val):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.IndexEngine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":223
 *         raise NotImplementedError
 * 
 *     cdef inline _check_type(self, object val):             # <<<<<<<<<<<<<<
 *         hash(val)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_11IndexEngine__check_type(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_hash_t __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_type");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":224
 * 
 *     cdef inline _check_type(self, object val):
 *         hash(val)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _ensure_mapping_populated(self):
 */
  __pyx_t_1 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pandas.lib.IndexEngine._check_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":226
 *         hash(val)
 * 
 *     cdef inline _ensure_mapping_populated(self):             # <<<<<<<<<<<<<<
 *         if not self.initialized:
 *             self.initialize()
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_11IndexEngine__ensure_mapping_populated(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_ensure_mapping_populated");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":227
 * 
 *     cdef inline _ensure_mapping_populated(self):
 *         if not self.initialized:             # <<<<<<<<<<<<<<
 *             self.initialize()
 * 
 */
  __pyx_t_1 = (!__pyx_v_self->initialized);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":228
 *     cdef inline _ensure_mapping_populated(self):
 *         if not self.initialized:
 *             self.initialize()             # <<<<<<<<<<<<<<
 * 
 *     cdef initialize(self):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->initialize(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.IndexEngine._ensure_mapping_populated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":230
 *             self.initialize()
 * 
 *     cdef initialize(self):             # <<<<<<<<<<<<<<
 *         values = self._get_index_values()
 * 
 */

static PyObject *__pyx_f_6pandas_3lib_11IndexEngine_initialize(struct __pyx_obj_6pandas_3lib_IndexEngine *__pyx_v_self) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":231
 * 
 *     cdef initialize(self):
 *         values = self._get_index_values()             # <<<<<<<<<<<<<<
 * 
 *         self.mapping = self._make_hash_table(len(values))
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_get_index_values(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_values = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":233
 *         values = self._get_index_values()
 * 
 *         self.mapping = self._make_hash_table(len(values))             # <<<<<<<<<<<<<<
 *         self.mapping.map_locations(values)
 * 
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)__pyx_v_self->__pyx_vtab)->_make_hash_table(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6pandas_3lib_HashTable))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->mapping);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->mapping));
  __pyx_v_self->mapping = ((struct __pyx_obj_6pandas_3lib_HashTable *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":234
 * 
 *         self.mapping = self._make_hash_table(len(values))
 *         self.mapping.map_locations(values)             # <<<<<<<<<<<<<<
 * 
 *         if len(self.mapping) == len(values):
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self->mapping), __pyx_n_s__map_locations); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":236
 *         self.mapping.map_locations(values)
 * 
 *         if len(self.mapping) == len(values):             # <<<<<<<<<<<<<<
 *             self.unique = 1
 *             self.unique_check = 1
 */
  __pyx_t_4 = ((PyObject *)__pyx_v_self->mapping);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = (__pyx_t_2 == __pyx_t_5);
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":237
 * 
 *         if len(self.mapping) == len(values):
 *             self.unique = 1             # <<<<<<<<<<<<<<
 *             self.unique_check = 1
 * 
 */
    __pyx_v_self->unique = 1;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":238
 *         if len(self.mapping) == len(values):
 *             self.unique = 1
 *             self.unique_check = 1             # <<<<<<<<<<<<<<
 * 
 *         self.initialized = 1
 */
    __pyx_v_self->unique_check = 1;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":240
 *             self.unique_check = 1
 * 
 *         self.initialized = 1             # <<<<<<<<<<<<<<
 * 
 *     def clear_mapping(self):
 */
  __pyx_v_self->initialized = 1;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":242
 *         self.initialized = 1
 * 
 *     def clear_mapping(self):             # <<<<<<<<<<<<<<
 *         self.mapping = None
 *         self.initialized = 0
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_6clear_mapping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_6clear_mapping(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_mapping");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":243
 * 
 *     def clear_mapping(self):
 *         self.mapping = None             # <<<<<<<<<<<<<<
 *         self.initialized = 0
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->mapping);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->mapping));
  ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->mapping = ((struct __pyx_obj_6pandas_3lib_HashTable *)Py_None);

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":244
 *     def clear_mapping(self):
 *         self.mapping = None
 *         self.initialized = 0             # <<<<<<<<<<<<<<
 * 
 *     def get_indexer(self, values):
 */
  ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->initialized = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":246
 *         self.initialized = 0
 * 
 *     def get_indexer(self, values):             # <<<<<<<<<<<<<<
 *         self._ensure_mapping_populated()
 *         return self.mapping.lookup(values)
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_7get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_7get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_indexer");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":247
 * 
 *     def get_indexer(self, values):
 *         self._ensure_mapping_populated()             # <<<<<<<<<<<<<<
 *         return self.mapping.lookup(values)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_IndexEngine *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->__pyx_vtab)->_ensure_mapping_populated(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":248
 *     def get_indexer(self, values):
 *         self._ensure_mapping_populated()
 *         return self.mapping.lookup(values)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->mapping), __pyx_n_s__lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":55
 * 
 *     cdef readonly:
 *         object vgetter             # <<<<<<<<<<<<<<
 *         HashTable mapping
 *         bint over_size_threshold
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_7vgetter___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_7vgetter___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->vgetter);
  __pyx_r = ((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->vgetter;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":56
 *     cdef readonly:
 *         object vgetter
 *         HashTable mapping             # <<<<<<<<<<<<<<
 *         bint over_size_threshold
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_7mapping___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_7mapping___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->mapping));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->mapping);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":57
 *         object vgetter
 *         HashTable mapping
 *         bint over_size_threshold             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_19over_size_threshold___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11IndexEngine_19over_size_threshold___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)->over_size_threshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.IndexEngine.over_size_threshold.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":267
 *     # cdef Int64HashTable mapping
 * 
 *     cdef _make_hash_table(self, n):             # <<<<<<<<<<<<<<
 *         return Int64HashTable(n)
 * 
 */

static PyObject *__pyx_f_6pandas_3lib_11Int64Engine__make_hash_table(struct __pyx_obj_6pandas_3lib_Int64Engine *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_hash_table");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":268
 * 
 *     cdef _make_hash_table(self, n):
 *         return Int64HashTable(n)             # <<<<<<<<<<<<<<
 * 
 *     def _call_monotonic(self, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_n);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n);
  __Pyx_GIVEREF(__pyx_v_n);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Int64HashTable)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.Int64Engine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":270
 *         return Int64HashTable(n)
 * 
 *     def _call_monotonic(self, values):             # <<<<<<<<<<<<<<
 *         return _algos.is_monotonic_int64(values)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_11Int64Engine__call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11Int64Engine__call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_monotonic");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":271
 * 
 *     def _call_monotonic(self, values):
 *         return _algos.is_monotonic_int64(values)             # <<<<<<<<<<<<<<
 * 
 *     def get_pad_indexer(self, other, limit=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__is_monotonic_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.Int64Engine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":273
 *         return _algos.is_monotonic_int64(values)
 * 
 *     def get_pad_indexer(self, other, limit=None):             # <<<<<<<<<<<<<<
 *         return _algos.pad_int64(self._get_index_values(), other,
 *                                   limit=limit)
 */

static PyObject *__pyx_pf_6pandas_3lib_11Int64Engine_1get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11Int64Engine_1get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__other,&__pyx_n_s__limit,0};
  __Pyx_RefNannySetupContext("get_pad_indexer");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":274
 * 
 *     def get_pad_indexer(self, other, limit=None):
 *         return _algos.pad_int64(self._get_index_values(), other,             # <<<<<<<<<<<<<<
 *                                   limit=limit)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__pad_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Int64Engine *)((struct __pyx_obj_6pandas_3lib_Int64Engine *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":275
 *     def get_pad_indexer(self, other, limit=None):
 *         return _algos.pad_int64(self._get_index_values(), other,
 *                                   limit=limit)             # <<<<<<<<<<<<<<
 * 
 *     def get_backfill_indexer(self, other, limit=None):
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__limit), __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Int64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":277
 *                                   limit=limit)
 * 
 *     def get_backfill_indexer(self, other, limit=None):             # <<<<<<<<<<<<<<
 *         return _algos.backfill_int64(self._get_index_values(), other,
 *                                        limit=limit)
 */

static PyObject *__pyx_pf_6pandas_3lib_11Int64Engine_2get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_11Int64Engine_2get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__other,&__pyx_n_s__limit,0};
  __Pyx_RefNannySetupContext("get_backfill_indexer");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Int64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":278
 * 
 *     def get_backfill_indexer(self, other, limit=None):
 *         return _algos.backfill_int64(self._get_index_values(), other,             # <<<<<<<<<<<<<<
 *                                        limit=limit)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__backfill_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Int64Engine *)((struct __pyx_obj_6pandas_3lib_Int64Engine *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":279
 *     def get_backfill_indexer(self, other, limit=None):
 *         return _algos.backfill_int64(self._get_index_values(), other,
 *                                        limit=limit)             # <<<<<<<<<<<<<<
 * 
 *     cdef _maybe_get_bool_indexer(self, object val):
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__limit), __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Int64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":281
 *                                        limit=limit)
 * 
 *     cdef _maybe_get_bool_indexer(self, object val):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ndarray[uint8_t, cast=True] indexer
 */

static PyObject *__pyx_f_6pandas_3lib_11Int64Engine__maybe_get_bool_indexer(struct __pyx_obj_6pandas_3lib_Int64Engine *__pyx_v_self, PyObject *__pyx_v_val) {
  PyArrayObject *__pyx_v_indexer = 0;
  PyArrayObject *__pyx_v_values = 0;
  int __pyx_v_count;
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_n;
  __pyx_t_5numpy_int64_t __pyx_v_ival;
  int __pyx_v_last_true;
  PyObject *__pyx_v_result = NULL;
  Py_buffer __pyx_bstruct_indexer;
  Py_ssize_t __pyx_bstride_0_indexer = 0;
  Py_ssize_t __pyx_bshape_0_indexer = 0;
  Py_buffer __pyx_bstruct_values;
  Py_ssize_t __pyx_bstride_0_values = 0;
  Py_ssize_t __pyx_bshape_0_values = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_int64_t __pyx_t_4;
  PyArrayObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyArrayObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_maybe_get_bool_indexer");
  __pyx_bstruct_indexer.buf = NULL;
  __pyx_bstruct_values.buf = NULL;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":285
 *             ndarray[uint8_t, cast=True] indexer
 *             ndarray[int64_t] values
 *             int count = 0             # <<<<<<<<<<<<<<
 *             Py_ssize_t i, n
 *             int64_t ival
 */
  __pyx_v_count = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":290
 *             int last_true
 * 
 *         if not util.is_integer_object(val):             # <<<<<<<<<<<<<<
 *             raise KeyError(val)
 * 
 */
  __pyx_t_1 = (!is_integer_object(__pyx_v_val));
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":291
 * 
 *         if not util.is_integer_object(val):
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 * 
 *         ival = val
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":293
 *             raise KeyError(val)
 * 
 *         ival = val             # <<<<<<<<<<<<<<
 * 
 *         values = self._get_index_values()
 */
  __pyx_t_4 = __Pyx_PyInt_from_py_npy_int64(__pyx_v_val); if (unlikely((__pyx_t_4 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_ival = __pyx_t_4;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":295
 *         ival = val
 * 
 *         values = self._get_index_values()             # <<<<<<<<<<<<<<
 *         n = len(values)
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_Int64Engine *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_5 = ((PyArrayObject *)__pyx_t_3);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_values, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    __pyx_bstride_0_values = __pyx_bstruct_values.strides[0];
    __pyx_bshape_0_values = __pyx_bstruct_values.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = 0;
  __pyx_v_values = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":296
 * 
 *         values = self._get_index_values()
 *         n = len(values)             # <<<<<<<<<<<<<<
 * 
 *         result = np.empty(n, dtype=bool)
 */
  __pyx_t_10 = PyObject_Length(((PyObject *)__pyx_v_values)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_n = __pyx_t_10;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":298
 *         n = len(values)
 * 
 *         result = np.empty(n, dtype=bool)             # <<<<<<<<<<<<<<
 *         indexer = result.view(np.uint8)
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_11));
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)__pyx_ptype_7cpython_4bool_bool))) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_result = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":299
 * 
 *         result = np.empty(n, dtype=bool)
 *         indexer = result.view(np.uint8)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_t_12 = PyObject_GetAttr(__pyx_v_result, __pyx_n_s__view); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;
  __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((PyArrayObject *)__pyx_t_11);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack);
    if (unlikely(__pyx_t_6 < 0)) {
      PyErr_Fetch(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_indexer, (PyObject*)__pyx_v_indexer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 1, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_9, __pyx_t_8, __pyx_t_7);
      }
    }
    __pyx_bstride_0_indexer = __pyx_bstruct_indexer.strides[0];
    __pyx_bshape_0_indexer = __pyx_bstruct_indexer.shape[0];
    if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_13 = 0;
  __pyx_v_indexer = ((PyArrayObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":301
 *         indexer = result.view(np.uint8)
 * 
 *         for i in range(n):             # <<<<<<<<<<<<<<
 *             if values[i] == val:
 *                 count += 1
 */
  __pyx_t_10 = __pyx_v_n;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
    __pyx_v_i = __pyx_t_14;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":302
 * 
 *         for i in range(n):
 *             if values[i] == val:             # <<<<<<<<<<<<<<
 *                 count += 1
 *                 indexer[i] = 1
 */
    __pyx_t_15 = __pyx_v_i;
    __pyx_t_6 = -1;
    if (__pyx_t_15 < 0) {
      __pyx_t_15 += __pyx_bshape_0_values;
      if (unlikely(__pyx_t_15 < 0)) __pyx_t_6 = 0;
    } else if (unlikely(__pyx_t_15 >= __pyx_bshape_0_values)) __pyx_t_6 = 0;
    if (unlikely(__pyx_t_6 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_6);
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyInt_to_py_npy_int64((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_bstruct_values.buf, __pyx_t_15, __pyx_bstride_0_values))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_11, __pyx_v_val, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":303
 *         for i in range(n):
 *             if values[i] == val:
 *                 count += 1             # <<<<<<<<<<<<<<
 *                 indexer[i] = 1
 *                 last_true = i
 */
      __pyx_v_count = (__pyx_v_count + 1);

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":304
 *             if values[i] == val:
 *                 count += 1
 *                 indexer[i] = 1             # <<<<<<<<<<<<<<
 *                 last_true = i
 *             else:
 */
      __pyx_t_16 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_16 < 0) {
        __pyx_t_16 += __pyx_bshape_0_indexer;
        if (unlikely(__pyx_t_16 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_16 >= __pyx_bshape_0_indexer)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[12]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_indexer.buf, __pyx_t_16, __pyx_bstride_0_indexer) = 1;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":305
 *                 count += 1
 *                 indexer[i] = 1
 *                 last_true = i             # <<<<<<<<<<<<<<
 *             else:
 *                 indexer[i] = 0
 */
      __pyx_v_last_true = __pyx_v_i;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":307
 *                 last_true = i
 *             else:
 *                 indexer[i] = 0             # <<<<<<<<<<<<<<
 * 
 *         if count == 0:
 */
      __pyx_t_17 = __pyx_v_i;
      __pyx_t_6 = -1;
      if (__pyx_t_17 < 0) {
        __pyx_t_17 += __pyx_bshape_0_indexer;
        if (unlikely(__pyx_t_17 < 0)) __pyx_t_6 = 0;
      } else if (unlikely(__pyx_t_17 >= __pyx_bshape_0_indexer)) __pyx_t_6 = 0;
      if (unlikely(__pyx_t_6 != -1)) {
        __Pyx_RaiseBufferIndexError(__pyx_t_6);
        {__pyx_filename = __pyx_f[12]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_bstruct_indexer.buf, __pyx_t_17, __pyx_bstride_0_indexer) = 0;
    }
    __pyx_L6:;
  }

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":309
 *                 indexer[i] = 0
 * 
 *         if count == 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(val)
 *         if count == 1:
 */
  __pyx_t_1 = (__pyx_v_count == 0);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":310
 * 
 *         if count == 0:
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 *         if count == 1:
 *             return last_true
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_11 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_11, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    {__pyx_filename = __pyx_f[12]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":311
 *         if count == 0:
 *             raise KeyError(val)
 *         if count == 1:             # <<<<<<<<<<<<<<
 *             return last_true
 * 
 */
  __pyx_t_1 = (__pyx_v_count == 1);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":312
 *             raise KeyError(val)
 *         if count == 1:
 *             return last_true             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_11 = PyInt_FromLong(__pyx_v_last_true); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":314
 *             return last_true
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * cdef class Float64Engine(IndexEngine):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("pandas.lib.Int64Engine._maybe_get_bool_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_indexer);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_values);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_indexer);
  __Pyx_XDECREF((PyObject *)__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":320
 *     # cdef Float64HashTable mapping
 * 
 *     cdef _make_hash_table(self, n):             # <<<<<<<<<<<<<<
 *         return Float64HashTable(n)
 * 
 */

static PyObject *__pyx_f_6pandas_3lib_13Float64Engine__make_hash_table(struct __pyx_obj_6pandas_3lib_Float64Engine *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_hash_table");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":321
 * 
 *     cdef _make_hash_table(self, n):
 *         return Float64HashTable(n)             # <<<<<<<<<<<<<<
 * 
 *     def _call_monotonic(self, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_n);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n);
  __Pyx_GIVEREF(__pyx_v_n);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Float64HashTable)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.Float64Engine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":323
 *         return Float64HashTable(n)
 * 
 *     def _call_monotonic(self, values):             # <<<<<<<<<<<<<<
 *         return _algos.is_monotonic_float64(values)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_13Float64Engine__call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13Float64Engine__call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_monotonic");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":324
 * 
 *     def _call_monotonic(self, values):
 *         return _algos.is_monotonic_float64(values)             # <<<<<<<<<<<<<<
 * 
 *     def get_pad_indexer(self, other, limit=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s_179); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.Float64Engine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":326
 *         return _algos.is_monotonic_float64(values)
 * 
 *     def get_pad_indexer(self, other, limit=None):             # <<<<<<<<<<<<<<
 *         return _algos.pad_float64(self._get_index_values(), other,
 *                                     limit=limit)
 */

static PyObject *__pyx_pf_6pandas_3lib_13Float64Engine_1get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13Float64Engine_1get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__other,&__pyx_n_s__limit,0};
  __Pyx_RefNannySetupContext("get_pad_indexer");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Float64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":327
 * 
 *     def get_pad_indexer(self, other, limit=None):
 *         return _algos.pad_float64(self._get_index_values(), other,             # <<<<<<<<<<<<<<
 *                                     limit=limit)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__pad_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Float64Engine *)((struct __pyx_obj_6pandas_3lib_Float64Engine *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":328
 *     def get_pad_indexer(self, other, limit=None):
 *         return _algos.pad_float64(self._get_index_values(), other,
 *                                     limit=limit)             # <<<<<<<<<<<<<<
 * 
 *     def get_backfill_indexer(self, other, limit=None):
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__limit), __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Float64Engine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":330
 *                                     limit=limit)
 * 
 *     def get_backfill_indexer(self, other, limit=None):             # <<<<<<<<<<<<<<
 *         return _algos.backfill_float64(self._get_index_values(), other,
 *                                          limit=limit)
 */

static PyObject *__pyx_pf_6pandas_3lib_13Float64Engine_2get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_13Float64Engine_2get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__other,&__pyx_n_s__limit,0};
  __Pyx_RefNannySetupContext("get_backfill_indexer");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.Float64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":331
 * 
 *     def get_backfill_indexer(self, other, limit=None):
 *         return _algos.backfill_float64(self._get_index_values(), other,             # <<<<<<<<<<<<<<
 *                                          limit=limit)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__backfill_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_Float64Engine *)((struct __pyx_obj_6pandas_3lib_Float64Engine *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":332
 *     def get_backfill_indexer(self, other, limit=None):
 *         return _algos.backfill_float64(self._get_index_values(), other,
 *                                          limit=limit)             # <<<<<<<<<<<<<<
 * 
 * _pad_functions = {
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__limit), __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.Float64Engine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":350
 *     # cdef PyObjectHashTable mapping
 * 
 *     cdef _make_hash_table(self, n):             # <<<<<<<<<<<<<<
 *         return PyObjectHashTable(n)
 * 
 */

static PyObject *__pyx_f_6pandas_3lib_12ObjectEngine__make_hash_table(struct __pyx_obj_6pandas_3lib_ObjectEngine *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_hash_table");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":351
 * 
 *     cdef _make_hash_table(self, n):
 *         return PyObjectHashTable(n)             # <<<<<<<<<<<<<<
 * 
 *     def _call_monotonic(self, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_n);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n);
  __Pyx_GIVEREF(__pyx_v_n);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_PyObjectHashTable)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.ObjectEngine._make_hash_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":353
 *         return PyObjectHashTable(n)
 * 
 *     def _call_monotonic(self, values):             # <<<<<<<<<<<<<<
 *         return _algos.is_monotonic_object(values)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_12ObjectEngine__call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_12ObjectEngine__call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_monotonic");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":354
 * 
 *     def _call_monotonic(self, values):
 *         return _algos.is_monotonic_object(values)             # <<<<<<<<<<<<<<
 * 
 *     def get_pad_indexer(self, other, limit=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__is_monotonic_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.ObjectEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":356
 *         return _algos.is_monotonic_object(values)
 * 
 *     def get_pad_indexer(self, other, limit=None):             # <<<<<<<<<<<<<<
 *         return _algos.pad_object(self._get_index_values(), other,
 *                                    limit=limit)
 */

static PyObject *__pyx_pf_6pandas_3lib_12ObjectEngine_1get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_12ObjectEngine_1get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__other,&__pyx_n_s__limit,0};
  __Pyx_RefNannySetupContext("get_pad_indexer");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.ObjectEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":357
 * 
 *     def get_pad_indexer(self, other, limit=None):
 *         return _algos.pad_object(self._get_index_values(), other,             # <<<<<<<<<<<<<<
 *                                    limit=limit)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__pad_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_ObjectEngine *)((struct __pyx_obj_6pandas_3lib_ObjectEngine *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":358
 *     def get_pad_indexer(self, other, limit=None):
 *         return _algos.pad_object(self._get_index_values(), other,
 *                                    limit=limit)             # <<<<<<<<<<<<<<
 * 
 *     def get_backfill_indexer(self, other, limit=None):
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__limit), __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.ObjectEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":360
 *                                    limit=limit)
 * 
 *     def get_backfill_indexer(self, other, limit=None):             # <<<<<<<<<<<<<<
 *         return _algos.backfill_object(self._get_index_values(), other,
 *                                         limit=limit)
 */

static PyObject *__pyx_pf_6pandas_3lib_12ObjectEngine_2get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_12ObjectEngine_2get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__other,&__pyx_n_s__limit,0};
  __Pyx_RefNannySetupContext("get_backfill_indexer");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.ObjectEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":361
 * 
 *     def get_backfill_indexer(self, other, limit=None):
 *         return _algos.backfill_object(self._get_index_values(), other,             # <<<<<<<<<<<<<<
 *                                         limit=limit)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__backfill_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_ObjectEngine *)((struct __pyx_obj_6pandas_3lib_ObjectEngine *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":362
 *     def get_backfill_indexer(self, other, limit=None):
 *         return _algos.backfill_object(self._get_index_values(), other,
 *                                         limit=limit)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__limit), __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.ObjectEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":367
 * cdef class DatetimeEngine(Int64Engine):
 * 
 *     def __contains__(self, object val):             # <<<<<<<<<<<<<<
 *         if self.over_size_threshold and self.is_monotonic:
 *             if not self.is_unique:
 */

static int __pyx_pf_6pandas_3lib_14DatetimeEngine___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static int __pyx_pf_6pandas_3lib_14DatetimeEngine___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_conv = NULL;
  PyObject *__pyx_v_loc = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__contains__");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":368
 * 
 *     def __contains__(self, object val):
 *         if self.over_size_threshold and self.is_monotonic:             # <<<<<<<<<<<<<<
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)
 */
  __pyx_t_1 = ((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.over_size_threshold;
  if (__pyx_t_1) {
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_monotonic); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_1;
  }
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":369
 *     def __contains__(self, object val):
 *         if self.over_size_threshold and self.is_monotonic:
 *             if not self.is_unique:             # <<<<<<<<<<<<<<
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__is_unique); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = (!__pyx_t_4);
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":370
 *         if self.over_size_threshold and self.is_monotonic:
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)             # <<<<<<<<<<<<<<
 *             values = self._get_index_values()
 *             conv = _to_i8(val)
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_loc_duplicates(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":371
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()             # <<<<<<<<<<<<<<
 *             conv = _to_i8(val)
 *             loc = values.searchsorted(conv, side='left')
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_values = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":372
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()
 *             conv = _to_i8(val)             # <<<<<<<<<<<<<<
 *             loc = values.searchsorted(conv, side='left')
 *             return util.get_value_at(values, loc) == conv
 */
    __pyx_t_2 = __pyx_f_6pandas_3lib__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_conv = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":373
 *             values = self._get_index_values()
 *             conv = _to_i8(val)
 *             loc = values.searchsorted(conv, side='left')             # <<<<<<<<<<<<<<
 *             return util.get_value_at(values, loc) == conv
 * 
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_INCREF(__pyx_v_conv);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_conv);
    __Pyx_GIVEREF(__pyx_v_conv);
    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__left)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_v_loc = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":374
 *             conv = _to_i8(val)
 *             loc = values.searchsorted(conv, side='left')
 *             return util.get_value_at(values, loc) == conv             # <<<<<<<<<<<<<<
 * 
 *         self._ensure_mapping_populated()
 */
    if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __pyx_v_values;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_7 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_8), __pyx_v_loc); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_conv, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":376
 *             return util.get_value_at(values, loc) == conv
 * 
 *         self._ensure_mapping_populated()             # <<<<<<<<<<<<<<
 *         return _to_i8(val) in self.mapping
 * 
 */
  __pyx_t_8 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._ensure_mapping_populated(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":377
 * 
 *         self._ensure_mapping_populated()
 *         return _to_i8(val) in self.mapping             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_index_values(self):
 */
  __pyx_t_8 = __pyx_f_6pandas_3lib__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = ((PySequence_Contains(((PyObject *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.mapping), __pyx_t_8))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_conv);
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":379
 *         return _to_i8(val) in self.mapping
 * 
 *     cdef _get_index_values(self):             # <<<<<<<<<<<<<<
 *         return self.vgetter().view('i8')
 * 
 */

static PyObject *__pyx_f_6pandas_3lib_14DatetimeEngine__get_index_values(struct __pyx_obj_6pandas_3lib_DatetimeEngine *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_index_values");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":380
 * 
 *     cdef _get_index_values(self):
 *         return self.vgetter().view('i8')             # <<<<<<<<<<<<<<
 * 
 *     def _call_monotonic(self, values):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_Call(__pyx_v_self->__pyx_base.__pyx_base.vgetter, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__view); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_180), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine._get_index_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":382
 *         return self.vgetter().view('i8')
 * 
 *     def _call_monotonic(self, values):             # <<<<<<<<<<<<<<
 *         return _algos.is_monotonic_int64(values)
 * 
 */

static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_1_call_monotonic(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_call_monotonic");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":383
 * 
 *     def _call_monotonic(self, values):
 *         return _algos.is_monotonic_int64(values)             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_loc(self, object val):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__is_monotonic_int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine._call_monotonic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":385
 *         return _algos.is_monotonic_int64(values)
 * 
 *     cpdef get_loc(self, object val):             # <<<<<<<<<<<<<<
 *         if is_definitely_invalid_key(val):
 *             raise TypeError
 */

static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_2get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_14DatetimeEngine_get_loc(struct __pyx_obj_6pandas_3lib_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_conv = NULL;
  PyObject *__pyx_v_loc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_loc");
  __Pyx_INCREF(__pyx_v_val);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__get_loc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6pandas_3lib_14DatetimeEngine_2get_loc)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":386
 * 
 *     cpdef get_loc(self, object val):
 *         if is_definitely_invalid_key(val):             # <<<<<<<<<<<<<<
 *             raise TypeError
 * 
 */
  __pyx_t_1 = __pyx_f_6pandas_3lib_is_definitely_invalid_key(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":387
 *     cpdef get_loc(self, object val):
 *         if is_definitely_invalid_key(val):
 *             raise TypeError             # <<<<<<<<<<<<<<
 * 
 *         # Welcome to the spaghetti factory
 */
    __Pyx_Raise(__pyx_builtin_TypeError, 0, 0, 0);
    {__pyx_filename = __pyx_f[12]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":391
 *         # Welcome to the spaghetti factory
 * 
 *         if self.over_size_threshold and self.is_monotonic:             # <<<<<<<<<<<<<<
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.over_size_threshold;
  if (__pyx_t_4) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_monotonic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (__pyx_t_6) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":392
 * 
 *         if self.over_size_threshold and self.is_monotonic:
 *             if not self.is_unique:             # <<<<<<<<<<<<<<
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()
 */
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__is_unique); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (!__pyx_t_6);
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":393
 *         if self.over_size_threshold and self.is_monotonic:
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)             # <<<<<<<<<<<<<<
 *             values = self._get_index_values()
 *             conv = _to_i8(val)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_loc_duplicates(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":394
 *             if not self.is_unique:
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()             # <<<<<<<<<<<<<<
 *             conv = _to_i8(val)
 *             loc = values.searchsorted(conv, side='left')
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_values = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":395
 *                 return self._get_loc_duplicates(val)
 *             values = self._get_index_values()
 *             conv = _to_i8(val)             # <<<<<<<<<<<<<<
 *             loc = values.searchsorted(conv, side='left')
 *             if loc == len(values) or util.get_value_at(values, loc) != conv:
 */
    __pyx_t_1 = __pyx_f_6pandas_3lib__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_conv = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":396
 *             values = self._get_index_values()
 *             conv = _to_i8(val)
 *             loc = values.searchsorted(conv, side='left')             # <<<<<<<<<<<<<<
 *             if loc == len(values) or util.get_value_at(values, loc) != conv:
 *                 raise KeyError(val)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_conv);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_conv);
    __Pyx_GIVEREF(__pyx_v_conv);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__left)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_loc = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":397
 *             conv = _to_i8(val)
 *             loc = values.searchsorted(conv, side='left')
 *             if loc == len(values) or util.get_value_at(values, loc) != conv:             # <<<<<<<<<<<<<<
 *                 raise KeyError(val)
 *             return loc
 */
    __pyx_t_8 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_loc, __pyx_t_7, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_4) {
      if (!(likely(((__pyx_v_values) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_values, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __pyx_v_values;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = __pyx_f_4util_get_value_at(((PyArrayObject *)__pyx_t_2), __pyx_v_loc); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_v_conv, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __pyx_t_6;
    } else {
      __pyx_t_5 = __pyx_t_4;
    }
    if (__pyx_t_5) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":398
 *             loc = values.searchsorted(conv, side='left')
 *             if loc == len(values) or util.get_value_at(values, loc) != conv:
 *                 raise KeyError(val)             # <<<<<<<<<<<<<<
 *             return loc
 * 
 */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_7 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":399
 *             if loc == len(values) or util.get_value_at(values, loc) != conv:
 *                 raise KeyError(val)
 *             return loc             # <<<<<<<<<<<<<<
 * 
 *         self._ensure_mapping_populated()
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_loc);
    __pyx_r = __pyx_v_loc;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":401
 *             return loc
 * 
 *         self._ensure_mapping_populated()             # <<<<<<<<<<<<<<
 *         if not self.unique:
 *             val = _to_i8(val)
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._ensure_mapping_populated(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":402
 * 
 *         self._ensure_mapping_populated()
 *         if not self.unique:             # <<<<<<<<<<<<<<
 *             val = _to_i8(val)
 *             return self._get_loc_duplicates(val)
 */
  __pyx_t_5 = (!__pyx_v_self->__pyx_base.__pyx_base.unique);
  if (__pyx_t_5) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":403
 *         self._ensure_mapping_populated()
 *         if not self.unique:
 *             val = _to_i8(val)             # <<<<<<<<<<<<<<
 *             return self._get_loc_duplicates(val)
 * 
 */
    __pyx_t_7 = __pyx_f_6pandas_3lib__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_v_val);
    __pyx_v_val = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":404
 *         if not self.unique:
 *             val = _to_i8(val)
 *             return self._get_loc_duplicates(val)             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_loc_duplicates(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self), __pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":406
 *             return self._get_loc_duplicates(val)
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             return self.mapping.get_item(val.value)
 *         except KeyError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":407
 * 
 *         try:
 *             return self.mapping.get_item(val.value)             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             raise KeyError(val)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), __pyx_n_s__get_item); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L12_try_return;
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L15_try_end;
    __pyx_L12_try_return:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L0;
    __pyx_L8_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":408
 *         try:
 *             return self.mapping.get_item(val.value)
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             raise KeyError(val)
 *         except AttributeError:
 */
    __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_7);

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":409
 *             return self.mapping.get_item(val.value)
 *         except KeyError:
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             pass
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_13 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_13, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L9_exception_handled;
    }

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":410
 *         except KeyError:
 *             raise KeyError(val)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_12) {
      PyErr_Restore(0,0,0);
      goto __pyx_L9_exception_handled;
    }
    __pyx_L10_except_error:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L9_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    __pyx_L15_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":413
 *             pass
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             val = _to_i8(val)
 *             return self.mapping.get_item(val)
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":414
 * 
 *         try:
 *             val = _to_i8(val)             # <<<<<<<<<<<<<<
 *             return self.mapping.get_item(val)
 *         except TypeError:
 */
      __pyx_t_7 = __pyx_f_6pandas_3lib__to_i8(__pyx_v_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_v_val);
      __pyx_v_val = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":415
 *         try:
 *             val = _to_i8(val)
 *             return self.mapping.get_item(val)             # <<<<<<<<<<<<<<
 *         except TypeError:
 *             self._date_check_type(val)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.mapping), __pyx_n_s__get_item); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_2 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L18_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L22_try_return;
    }
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L25_try_end;
    __pyx_L22_try_return:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    goto __pyx_L0;
    __pyx_L18_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":416
 *             val = _to_i8(val)
 *             return self.mapping.get_item(val)
 *         except TypeError:             # <<<<<<<<<<<<<<
 *             self._date_check_type(val)
 *             raise KeyError(val)
 */
    __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_7);

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":417
 *             return self.mapping.get_item(val)
 *         except TypeError:
 *             self._date_check_type(val)             # <<<<<<<<<<<<<<
 *             raise KeyError(val)
 * 
 */
      __pyx_t_13 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_date_check_type(__pyx_v_self, __pyx_v_val); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":418
 *         except TypeError:
 *             self._date_check_type(val)
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _date_check_type(self, object val):
 */
      __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_13));
      __Pyx_INCREF(__pyx_v_val);
      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_val);
      __Pyx_GIVEREF(__pyx_v_val);
      __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L19_exception_handled;
    }
    __pyx_L20_except_error:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L19_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    __pyx_L25_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_conv);
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":385
 *         return _algos.is_monotonic_int64(values)
 * 
 *     cpdef get_loc(self, object val):             # <<<<<<<<<<<<<<
 *         if is_definitely_invalid_key(val):
 *             raise TypeError
 */

static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_2get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_2get_loc(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_loc");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.get_loc(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self), __pyx_v_val, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_loc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":420
 *             raise KeyError(val)
 * 
 *     cdef inline _date_check_type(self, object val):             # <<<<<<<<<<<<<<
 *         hash(val)
 *         if not util.is_integer_object(val):
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib_14DatetimeEngine__date_check_type(struct __pyx_obj_6pandas_3lib_DatetimeEngine *__pyx_v_self, PyObject *__pyx_v_val) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_hash_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_date_check_type");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":421
 * 
 *     cdef inline _date_check_type(self, object val):
 *         hash(val)             # <<<<<<<<<<<<<<
 *         if not util.is_integer_object(val):
 *             raise KeyError(val)
 */
  __pyx_t_1 = PyObject_Hash(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":422
 *     cdef inline _date_check_type(self, object val):
 *         hash(val)
 *         if not util.is_integer_object(val):             # <<<<<<<<<<<<<<
 *             raise KeyError(val)
 * 
 */
  __pyx_t_2 = (!is_integer_object(__pyx_v_val));
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":423
 *         hash(val)
 *         if not util.is_integer_object(val):
 *             raise KeyError(val)             # <<<<<<<<<<<<<<
 * 
 *     def get_indexer(self, values):
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_v_val);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val);
    __Pyx_GIVEREF(__pyx_v_val);
    __pyx_t_4 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[12]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine._date_check_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":425
 *             raise KeyError(val)
 * 
 *     def get_indexer(self, values):             # <<<<<<<<<<<<<<
 *         self._ensure_mapping_populated()
 *         if values.dtype != 'M8[ns]':
 */

static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_3get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_3get_indexer(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_indexer");
  __Pyx_INCREF(__pyx_v_values);

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":426
 * 
 *     def get_indexer(self, values):
 *         self._ensure_mapping_populated()             # <<<<<<<<<<<<<<
 *         if values.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(values)).astype('i4')
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._ensure_mapping_populated(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":427
 *     def get_indexer(self, values):
 *         self._ensure_mapping_populated()
 *         if values.dtype != 'M8[ns]':             # <<<<<<<<<<<<<<
 *             return np.repeat(-1, len(values)).astype('i4')
 *         values = np.asarray(values).view('i8')
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_values, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_26), Py_NE); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":428
 *         self._ensure_mapping_populated()
 *         if values.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(values)).astype('i4')             # <<<<<<<<<<<<<<
 *         values = np.asarray(values).view('i8')
 *         return self.mapping.lookup(values)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_181), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":429
 *         if values.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(values)).astype('i4')
 *         values = np.asarray(values).view('i8')             # <<<<<<<<<<<<<<
 *         return self.mapping.lookup(values)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_182), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_values);
  __pyx_v_values = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":430
 *             return np.repeat(-1, len(values)).astype('i4')
 *         values = np.asarray(values).view('i8')
 *         return self.mapping.lookup(values)             # <<<<<<<<<<<<<<
 * 
 *     def get_pad_indexer(self, other, limit=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.mapping), __pyx_n_s__lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":432
 *         return self.mapping.lookup(values)
 * 
 *     def get_pad_indexer(self, other, limit=None):             # <<<<<<<<<<<<<<
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')
 */

static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_4get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_4get_pad_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__other,&__pyx_n_s__limit,0};
  __Pyx_RefNannySetupContext("get_pad_indexer");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_pad_indexer") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_pad_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_other);

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":433
 * 
 *     def get_pad_indexer(self, other, limit=None):
 *         if other.dtype != 'M8[ns]':             # <<<<<<<<<<<<<<
 *             return np.repeat(-1, len(other)).astype('i4')
 *         other = np.asarray(other).view('i8')
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_26), Py_NE); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":434
 *     def get_pad_indexer(self, other, limit=None):
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')             # <<<<<<<<<<<<<<
 *         other = np.asarray(other).view('i8')
 *         return _algos.pad_int64(self._get_index_values(), other,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_v_other); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_183), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":435
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')
 *         other = np.asarray(other).view('i8')             # <<<<<<<<<<<<<<
 *         return _algos.pad_int64(self._get_index_values(), other,
 *                                 limit=limit)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_184), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_other);
  __pyx_v_other = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":436
 *             return np.repeat(-1, len(other)).astype('i4')
 *         other = np.asarray(other).view('i8')
 *         return _algos.pad_int64(self._get_index_values(), other,             # <<<<<<<<<<<<<<
 *                                 limit=limit)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__pad_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":437
 *         other = np.asarray(other).view('i8')
 *         return _algos.pad_int64(self._get_index_values(), other,
 *                                 limit=limit)             # <<<<<<<<<<<<<<
 * 
 *     def get_backfill_indexer(self, other, limit=None):
 */
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__limit), __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_pad_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":439
 *                                 limit=limit)
 * 
 *     def get_backfill_indexer(self, other, limit=None):             # <<<<<<<<<<<<<<
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')
 */

static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_14DatetimeEngine_5get_backfill_indexer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__other,&__pyx_n_s__limit,0};
  __Pyx_RefNannySetupContext("get_backfill_indexer");
  {
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__other);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get_backfill_indexer") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_backfill_indexer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_other);

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":440
 * 
 *     def get_backfill_indexer(self, other, limit=None):
 *         if other.dtype != 'M8[ns]':             # <<<<<<<<<<<<<<
 *             return np.repeat(-1, len(other)).astype('i4')
 *         other = np.asarray(other).view('i8')
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_other, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Equals(__pyx_t_1, ((PyObject *)__pyx_kp_s_26), Py_NE); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":441
 *     def get_backfill_indexer(self, other, limit=None):
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')             # <<<<<<<<<<<<<<
 *         other = np.asarray(other).view('i8')
 *         return _algos.backfill_int64(self._get_index_values(), other,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__repeat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_v_other); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_neg_1);
    __Pyx_GIVEREF(__pyx_int_neg_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_185), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":442
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')
 *         other = np.asarray(other).view('i8')             # <<<<<<<<<<<<<<
 *         return _algos.backfill_int64(self._get_index_values(), other,
 *                                      limit=limit)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__view); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_186), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_other);
  __pyx_v_other = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":443
 *             return np.repeat(-1, len(other)).astype('i4')
 *         other = np.asarray(other).view('i8')
 *         return _algos.backfill_int64(self._get_index_values(), other,             # <<<<<<<<<<<<<<
 *                                      limit=limit)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__backfill_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine *)((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._get_index_values(((struct __pyx_obj_6pandas_3lib_IndexEngine *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":444
 *         other = np.asarray(other).view('i8')
 *         return _algos.backfill_int64(self._get_index_values(), other,
 *                                      limit=limit)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__limit), __pyx_v_limit) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pandas.lib.DatetimeEngine.get_backfill_indexer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":447
 * 
 * 
 * cpdef convert_scalar(ndarray arr, object value):             # <<<<<<<<<<<<<<
 *     if arr.descr.type_num == NPY_DATETIME:
 *         if isinstance(value, _Timestamp):
 */

static PyObject *__pyx_pf_6pandas_3lib_163convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6pandas_3lib_convert_scalar(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_value, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_scalar");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":448
 * 
 * cpdef convert_scalar(ndarray arr, object value):
 *     if arr.descr.type_num == NPY_DATETIME:             # <<<<<<<<<<<<<<
 *         if isinstance(value, _Timestamp):
 *             return (<_Timestamp> value).value
 */
  __pyx_t_1 = (__pyx_v_arr->descr->type_num == NPY_DATETIME);
  if (__pyx_t_1) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":449
 * cpdef convert_scalar(ndarray arr, object value):
 *     if arr.descr.type_num == NPY_DATETIME:
 *         if isinstance(value, _Timestamp):             # <<<<<<<<<<<<<<
 *             return (<_Timestamp> value).value
 *         elif value is None or value != value:
 */
    __pyx_t_2 = ((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__Timestamp));
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_t_2); 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":450
 *     if arr.descr.type_num == NPY_DATETIME:
 *         if isinstance(value, _Timestamp):
 *             return (<_Timestamp> value).value             # <<<<<<<<<<<<<<
 *         elif value is None or value != value:
 *             return iNaT
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyInt_to_py_npy_int64(((struct __pyx_obj_6pandas_3lib__Timestamp *)__pyx_v_value)->value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L4;
    }

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":451
 *         if isinstance(value, _Timestamp):
 *             return (<_Timestamp> value).value
 *         elif value is None or value != value:             # <<<<<<<<<<<<<<
 *             return iNaT
 *         else:
 */
    __pyx_t_1 = (__pyx_v_value == Py_None);
    if (!__pyx_t_1) {
      __pyx_t_2 = PyObject_RichCompare(__pyx_v_value, __pyx_v_value, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __pyx_t_3;
    } else {
      __pyx_t_4 = __pyx_t_1;
    }
    if (__pyx_t_4) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":452
 *             return (<_Timestamp> value).value
 *         elif value is None or value != value:
 *             return iNaT             # <<<<<<<<<<<<<<
 *         else:
 *             return Timestamp(value).value
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__iNaT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":454
 *             return iNaT
 *         else:
 *             return Timestamp(value).value             # <<<<<<<<<<<<<<
 * 
 *     if issubclass(arr.dtype.type, (np.integer, np.bool_)):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__Timestamp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":456
 *             return Timestamp(value).value
 * 
 *     if issubclass(arr.dtype.type, (np.integer, np.bool_)):             # <<<<<<<<<<<<<<
 *         if util.is_float_object(value) and value != value:
 *             raise ValueError('Cannot assign nan to integer series')
 */
  __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_arr), __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__type); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__integer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__bool_); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_2 = 0;
  __pyx_t_7 = 0;
  __pyx_t_4 = PyObject_IsSubclass(__pyx_t_6, ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  if (__pyx_t_4) {

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":457
 * 
 *     if issubclass(arr.dtype.type, (np.integer, np.bool_)):
 *         if util.is_float_object(value) and value != value:             # <<<<<<<<<<<<<<
 *             raise ValueError('Cannot assign nan to integer series')
 * 
 */
    if (is_float_object(__pyx_v_value)) {
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_value, __pyx_v_value, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_1 = __pyx_t_4;
    } else {
      __pyx_t_1 = is_float_object(__pyx_v_value);
    }
    if (__pyx_t_1) {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":458
 *     if issubclass(arr.dtype.type, (np.integer, np.bool_)):
 *         if util.is_float_object(value) and value != value:
 *             raise ValueError('Cannot assign nan to integer series')             # <<<<<<<<<<<<<<
 * 
 *     return value
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_188), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":460
 *             raise ValueError('Cannot assign nan to integer series')
 * 
 *     return value             # <<<<<<<<<<<<<<
 * 
 * cdef inline _to_i8(object val):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pandas.lib.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":447
 * 
 * 
 * cpdef convert_scalar(ndarray arr, object value):             # <<<<<<<<<<<<<<
 *     if arr.descr.type_num == NPY_DATETIME:
 *         if isinstance(value, _Timestamp):
 */

static PyObject *__pyx_pf_6pandas_3lib_163convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_6pandas_3lib_163convert_scalar(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_arr = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,&__pyx_n_s__value,0};
  __Pyx_RefNannySetupContext("convert_scalar");
  __pyx_self = __pyx_self;
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("convert_scalar", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "convert_scalar") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_arr = ((PyArrayObject *)values[0]);
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convert_scalar", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pandas.lib.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pandas_3lib_convert_scalar(__pyx_v_arr, __pyx_v_value, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pandas.lib.convert_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/wesm/code/pandas/pandas/src/engines.pyx":462
 *     return value
 * 
 * cdef inline _to_i8(object val):             # <<<<<<<<<<<<<<
 *     cdef pandas_datetimestruct dts
 *     try:
 */

static CYTHON_INLINE PyObject *__pyx_f_6pandas_3lib__to_i8(PyObject *__pyx_v_val) {
  pandas_datetimestruct __pyx_v_dts;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_i8");

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":464
 * cdef inline _to_i8(object val):
 *     cdef pandas_datetimestruct dts
 *     try:             # <<<<<<<<<<<<<<
 *         return val.value
 *     except AttributeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":465
 *     cdef pandas_datetimestruct dts
 *     try:
 *         return val.value             # <<<<<<<<<<<<<<
 *     except AttributeError:
 *         if util.is_datetime64_object(val):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_val, __pyx_n_s__value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "/home/wesm/code/pandas/pandas/src/engines.pyx":466
 *     try:
 *         return val.value
 *     except AttributeError:             # <<<<<<<<<<<<<<
 *         if util.is_datetime64_object(val):
 *             return get_datetime64_value(val)
 */
    __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("pandas.lib._to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":467
 *         return val.value
 *     except AttributeError:
 *         if util.is_datetime64_object(val):             # <<<<<<<<<<<<<<
 *             return get_datetime64_value(val)
 *         elif PyDateTime_Check(val):
 */
      __pyx_t_5 = is_datetime64_object(__pyx_v_val);
      if (__pyx_t_5) {

        /* "/home/wesm/code/pandas/pandas/src/engines.pyx":468
 *     except AttributeError:
 *         if util.is_datetime64_object(val):
 *             return get_datetime64_value(val)             # <<<<<<<<<<<<<<
 *         elif PyDateTime_Check(val):
 *             return _pydatetime_to_dts(val, &dts)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_8 = __Pyx_PyInt_to_py_npy_int64(get_datetime64_value(__pyx_v_val)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L6_except_return;
        goto __pyx_L13;
      }

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":469
 *         if util.is_datetime64_object(val):
 *             return get_datetime64_value(val)
 *         elif PyDateTime_Check(val):             # <<<<<<<<<<<<<<
 *             return _pydatetime_to_dts(val, &dts)
 *         return val
 */
      __pyx_t_9 = PyDateTime_Check(__pyx_v_val);
      if (__pyx_t_9) {

        /* "/home/wesm/code/pandas/pandas/src/engines.pyx":470
 *             return get_datetime64_value(val)
 *         elif PyDateTime_Check(val):
 *             return _pydatetime_to_dts(val, &dts)             # <<<<<<<<<<<<<<
 *         return val
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_8 = __Pyx_PyInt_to_py_npy_int64(__pyx_f_6pandas_3lib__pydatetime_to_dts(__pyx_v_val, (&__pyx_v_dts))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L6_except_return;
        goto __pyx_L13;
      }
      __pyx_L13:;

      /* "/home/wesm/code/pandas/pandas/src/engines.pyx":471
 *         elif PyDateTime_Check(val):
 *             return _pydatetime_to_dts(val, &dts)
 *         return val             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_val);
      __pyx_r = __pyx_v_val;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pandas.lib._to_i8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":195
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__");
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "numpy.pxd":201
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = (__pyx_v_info == NULL);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "numpy.pxd":204
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":205
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":207
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));

  /* "numpy.pxd":209
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":210
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "numpy.pxd":212
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L6:;

  /* "numpy.pxd":214
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
  if (__pyx_t_1) {

    /* "numpy.pxd":215
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
    __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "numpy.pxd":216
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_190), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[13]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "numpy.pxd":218
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
  if (__pyx_t_3) {

    /* "numpy.pxd":219
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
    __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "numpy.pxd":220
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_192), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[13]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "numpy.pxd":222
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));

  /* "numpy.pxd":223
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "numpy.pxd":224
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  if (__pyx_v_copy_shape) {

    /* "numpy.pxd":227
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "numpy.pxd":228
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "numpy.pxd":229
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_5 = __pyx_v_ndim;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "numpy.pxd":230
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);

      /* "numpy.pxd":231
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
    }
    goto __pyx_L9;
  }
  /*else*/ {

    /* "numpy.pxd":233
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));

    /* "numpy.pxd":234
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self)));
  }
  __pyx_L9:;

  /* "numpy.pxd":235
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "numpy.pxd":236
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));

  /* "numpy.pxd":237
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));

  /* "numpy.pxd":240
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "numpy.pxd":241
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
  __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;

  /* "numpy.pxd":245
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "numpy.pxd":247
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = (!__pyx_v_hasfields);
  if (__pyx_t_2) {
    __pyx_t_3 = (!__pyx_v_copy_shape);
    __pyx_t_1 = __pyx_t_3;
  } else {
    __pyx_t_1 = __pyx_t_2;
  }
  if (__pyx_t_1) {

    /* "numpy.pxd":249
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L12;
  }
  /*else*/ {

    /* "numpy.pxd":252
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = __pyx_v_self;
  }
  __pyx_L12:;

  /* "numpy.pxd":254
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {

    /* "numpy.pxd":255
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 */
    __pyx_v_t = __pyx_v_descr->type_num;

    /* "numpy.pxd":256
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
    if (__pyx_t_1) {
      __pyx_t_2 = __pyx_v_little_endian;
    } else {
      __pyx_t_2 = __pyx_t_1;
    }
    if (!__pyx_t_2) {

      /* "numpy.pxd":257
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
      __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
      if (__pyx_t_1) {
        __pyx_t_3 = (!__pyx_v_little_endian);
        __pyx_t_7 = __pyx_t_3;
      } else {
        __pyx_t_7 = __pyx_t_1;
      }
      __pyx_t_1 = __pyx_t_7;
    } else {
      __pyx_t_1 = __pyx_t_2;
    }
    if (__pyx_t_1) {

      /* "numpy.pxd":258
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_194), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[13]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "numpy.pxd":259
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_BYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__b;
      goto __pyx_L15;
    }

    /* "numpy.pxd":260
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UBYTE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__B;
      goto __pyx_L15;
    }

    /* "numpy.pxd":261
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_SHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__h;
      goto __pyx_L15;
    }

    /* "numpy.pxd":262
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_USHORT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__H;
      goto __pyx_L15;
    }

    /* "numpy.pxd":263
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_INT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__i;
      goto __pyx_L15;
    }

    /* "numpy.pxd":264
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_UINT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__I;
      goto __pyx_L15;
    }

    /* "numpy.pxd":265
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__l;
      goto __pyx_L15;
    }

    /* "numpy.pxd":266
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__L;
      goto __pyx_L15;
    }

    /* "numpy.pxd":267
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__q;
      goto __pyx_L15;
    }

    /* "numpy.pxd":268
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_ULONGLONG);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Q;
      goto __pyx_L15;
    }

    /* "numpy.pxd":269
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_FLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__f;
      goto __pyx_L15;
    }

    /* "numpy.pxd":270
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_DOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__d;
      goto __pyx_L15;
    }

    /* "numpy.pxd":271
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_LONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__g;
      goto __pyx_L15;
    }

    /* "numpy.pxd":272
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CFLOAT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zf;
      goto __pyx_L15;
    }

    /* "numpy.pxd":273
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zd;
      goto __pyx_L15;
    }

    /* "numpy.pxd":274
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
    __pyx_t_1 = (__pyx_v_t == NPY_CLONGDOUBLE);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__Zg;
      goto __pyx_L15;
    }

    /* "numpy.pxd":275
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
    __pyx_t_1 = (__pyx_v_t == NPY_OBJECT);
    if (__pyx_t_1) {
      __pyx_v_f = __pyx_k__O;
      goto __pyx_L15;
    }
    /*else*/ {

      /* "numpy.pxd":277
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_195), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
      __pyx_t_8 = 0;
      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      {__pyx_filename = __pyx_f[13]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L15:;

    /* "numpy.pxd":278
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "numpy.pxd":279
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L13;
  }
  /*else*/ {

    /* "numpy.pxd":281
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "numpy.pxd":282
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "numpy.pxd":283
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "numpy.pxd":286
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)             # <<<<<<<<<<<<<<
 *                 f[0] = 0 # Terminate format string
 * 
 */
    __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_9;

    /* "numpy.pxd":287
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = 0;
  }
  __pyx_L13:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":289
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pf_5numpy_7ndarray_1__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__");

  /* "numpy.pxd":290
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
  if (__pyx_t_1) {

    /* "numpy.pxd":291
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "numpy.pxd":292
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "numpy.pxd":293
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":769
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1");

  /* "numpy.pxd":770
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":772
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2");

  /* "numpy.pxd":773
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":775
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3");

  /* "numpy.pxd":776
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":778
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4");

  /* "numpy.pxd":779
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":781
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5");

  /* "numpy.pxd":782
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":784
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  long __pyx_t_10;
  char *__pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring");

  /* "numpy.pxd":791
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "numpy.pxd":792
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "numpy.pxd":795
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
    __Pyx_XDECREF(__pyx_v_childname);
    __pyx_v_childname = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "numpy.pxd":796
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
    __pyx_v_fields = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "numpy.pxd":797
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
      PyObject* sequence = ((PyObject *)__pyx_v_fields);
      if (unlikely(PyTuple_GET_SIZE(sequence) != 2)) {
        if (PyTuple_GET_SIZE(sequence) > 2) __Pyx_RaiseTooManyValuesError(2);
        else __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(sequence));
        {__pyx_filename = __pyx_f[13]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
      {__pyx_filename = __pyx_f[13]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_child));
    __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_v_new_offset);
    __pyx_v_new_offset = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "numpy.pxd":799
 *         child, new_offset = fields
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "numpy.pxd":800
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_197), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[13]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "numpy.pxd":802
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_6 = (__pyx_v_child->byteorder == '>');
    if (__pyx_t_6) {
      __pyx_t_7 = __pyx_v_little_endian;
    } else {
      __pyx_t_7 = __pyx_t_6;
    }
    if (!__pyx_t_7) {

      /* "numpy.pxd":803
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
      __pyx_t_6 = (__pyx_v_child->byteorder == '<');
      if (__pyx_t_6) {
        __pyx_t_8 = (!__pyx_v_little_endian);
        __pyx_t_9 = __pyx_t_8;
      } else {
        __pyx_t_9 = __pyx_t_6;
      }
      __pyx_t_6 = __pyx_t_9;
    } else {
      __pyx_t_6 = __pyx_t_7;
    }
    if (__pyx_t_6) {

      /* "numpy.pxd":804
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_198), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[13]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "numpy.pxd":814
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!__pyx_t_6) break;

      /* "numpy.pxd":815
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "numpy.pxd":816
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "numpy.pxd":817
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_10 = 0;
      (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
    }

    /* "numpy.pxd":819
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_10 = 0;
    (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);

    /* "numpy.pxd":821
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child));
    if (__pyx_t_6) {

      /* "numpy.pxd":822
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_v_t);
      __pyx_v_t = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "numpy.pxd":823
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5);
      if (__pyx_t_6) {

        /* "numpy.pxd":824
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_200), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[13]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "numpy.pxd":827
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L11;
      }

      /* "numpy.pxd":828
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L11;
      }

      /* "numpy.pxd":829
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L11;
      }

      /* "numpy.pxd":830
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L11;
      }

      /* "numpy.pxd":831
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L11;
      }

      /* "numpy.pxd":832
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L11;
      }

      /* "numpy.pxd":833
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L11;
      }

      /* "numpy.pxd":834
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L11;
      }

      /* "numpy.pxd":835
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L11;
      }

      /* "numpy.pxd":836
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L11;
      }

      /* "numpy.pxd":837
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L11;
      }

      /* "numpy.pxd":838
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L11;
      }

      /* "numpy.pxd":839
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L11;
      }

      /* "numpy.pxd":840
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":841
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":842
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L11;
      }

      /* "numpy.pxd":843
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "numpy.pxd":845
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_195), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[13]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L11:;

      /* "numpy.pxd":846
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "numpy.pxd":850
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_11;
    }
    __pyx_L9:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "numpy.pxd":851
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "numpy.pxd":966
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("set_array_base");

  /* "numpy.pxd":968
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  if (__pyx_t_1) {

    /* "numpy.pxd":969
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":971
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
    Py_INCREF(__pyx_v_base);

    /* "numpy.pxd":972
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "numpy.pxd":973
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "numpy.pxd":974
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  __Pyx_RefNannyFinishContext();
}

/* "numpy.pxd":976
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base");

  /* "numpy.pxd":977
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = (__pyx_v_arr->base == NULL);
  if (__pyx_t_1) {

    /* "numpy.pxd":978
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "numpy.pxd":980
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":18
 *     inline object char_to_string(char*)
 * 
 * cdef inline object get_value_at(ndarray arr, object loc):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, sz
 */

static CYTHON_INLINE PyObject *__pyx_f_4util_get_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_sz;
  PyObject *__pyx_v_casted = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_at");
  __Pyx_INCREF(__pyx_v_loc);

  /* "util.pxd":22
 *         Py_ssize_t i, sz
 *         void* data_ptr
 *     if is_float_object(loc):             # <<<<<<<<<<<<<<
 *         casted = int(loc)
 *         if casted == loc:
 */
  __pyx_t_1 = is_float_object(__pyx_v_loc);
  if (__pyx_t_1) {

    /* "util.pxd":23
 *         void* data_ptr
 *     if is_float_object(loc):
 *         casted = int(loc)             # <<<<<<<<<<<<<<
 *         if casted == loc:
 *             loc = casted
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_loc);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_loc);
    __Pyx_GIVEREF(__pyx_v_loc);
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_casted = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "util.pxd":24
 *     if is_float_object(loc):
 *         casted = int(loc)
 *         if casted == loc:             # <<<<<<<<<<<<<<
 *             loc = casted
 *     i = <Py_ssize_t> loc
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "util.pxd":25
 *         casted = int(loc)
 *         if casted == loc:
 *             loc = casted             # <<<<<<<<<<<<<<
 *     i = <Py_ssize_t> loc
 *     sz = cnp.PyArray_SIZE(arr)
 */
      __Pyx_INCREF(__pyx_v_casted);
      __Pyx_DECREF(__pyx_v_loc);
      __pyx_v_loc = __pyx_v_casted;
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "util.pxd":26
 *         if casted == loc:
 *             loc = casted
 *     i = <Py_ssize_t> loc             # <<<<<<<<<<<<<<
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_i = ((Py_ssize_t)__pyx_t_5);

  /* "util.pxd":27
 *             loc = casted
 *     i = <Py_ssize_t> loc
 *     sz = cnp.PyArray_SIZE(arr)             # <<<<<<<<<<<<<<
 * 
 *     if i < 0 and sz > 0:
 */
  __pyx_v_sz = PyArray_SIZE(__pyx_v_arr);

  /* "util.pxd":29
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 *     if i < 0 and sz > 0:             # <<<<<<<<<<<<<<
 *         i += sz
 *     elif i >= sz or sz == 0:
 */
  __pyx_t_4 = (__pyx_v_i < 0);
  if (__pyx_t_4) {
    __pyx_t_6 = (__pyx_v_sz > 0);
    __pyx_t_7 = __pyx_t_6;
  } else {
    __pyx_t_7 = __pyx_t_4;
  }
  if (__pyx_t_7) {

    /* "util.pxd":30
 * 
 *     if i < 0 and sz > 0:
 *         i += sz             # <<<<<<<<<<<<<<
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')
 */
    __pyx_v_i = (__pyx_v_i + __pyx_v_sz);
    goto __pyx_L5;
  }

  /* "util.pxd":31
 *     if i < 0 and sz > 0:
 *         i += sz
 *     elif i >= sz or sz == 0:             # <<<<<<<<<<<<<<
 *         raise IndexError('index out of bounds')
 * 
 */
  __pyx_t_7 = (__pyx_v_i >= __pyx_v_sz);
  if (!__pyx_t_7) {
    __pyx_t_4 = (__pyx_v_sz == 0);
    __pyx_t_6 = __pyx_t_4;
  } else {
    __pyx_t_6 = __pyx_t_7;
  }
  if (__pyx_t_6) {

    /* "util.pxd":32
 *         i += sz
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     return get_value_1d(arr, i)
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_201), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[14]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "util.pxd":34
 *         raise IndexError('index out of bounds')
 * 
 *     return get_value_1d(arr, i)             # <<<<<<<<<<<<<<
 * 
 * cdef inline set_value_at(ndarray arr, object loc, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = get_value_1d(__pyx_v_arr, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("util.get_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_casted);
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":36
 *     return get_value_1d(arr, i)
 * 
 * cdef inline set_value_at(ndarray arr, object loc, object value):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, sz
 */

static CYTHON_INLINE PyObject *__pyx_f_4util_set_value_at(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_loc, PyObject *__pyx_v_value) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_sz;
  PyObject *__pyx_v_casted = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_value_at");
  __Pyx_INCREF(__pyx_v_loc);

  /* "util.pxd":39
 *     cdef:
 *         Py_ssize_t i, sz
 *     if is_float_object(loc):             # <<<<<<<<<<<<<<
 *         casted = int(loc)
 *         if casted == loc:
 */
  __pyx_t_1 = is_float_object(__pyx_v_loc);
  if (__pyx_t_1) {

    /* "util.pxd":40
 *         Py_ssize_t i, sz
 *     if is_float_object(loc):
 *         casted = int(loc)             # <<<<<<<<<<<<<<
 *         if casted == loc:
 *             loc = casted
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_loc);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_loc);
    __Pyx_GIVEREF(__pyx_v_loc);
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_v_casted = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "util.pxd":41
 *     if is_float_object(loc):
 *         casted = int(loc)
 *         if casted == loc:             # <<<<<<<<<<<<<<
 *             loc = casted
 *     i = <Py_ssize_t> loc
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_casted, __pyx_v_loc, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "util.pxd":42
 *         casted = int(loc)
 *         if casted == loc:
 *             loc = casted             # <<<<<<<<<<<<<<
 *     i = <Py_ssize_t> loc
 *     sz = cnp.PyArray_SIZE(arr)
 */
      __Pyx_INCREF(__pyx_v_casted);
      __Pyx_DECREF(__pyx_v_loc);
      __pyx_v_loc = __pyx_v_casted;
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "util.pxd":43
 *         if casted == loc:
 *             loc = casted
 *     i = <Py_ssize_t> loc             # <<<<<<<<<<<<<<
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_i = ((Py_ssize_t)__pyx_t_5);

  /* "util.pxd":44
 *             loc = casted
 *     i = <Py_ssize_t> loc
 *     sz = cnp.PyArray_SIZE(arr)             # <<<<<<<<<<<<<<
 * 
 *     if i < 0:
 */
  __pyx_v_sz = PyArray_SIZE(__pyx_v_arr);

  /* "util.pxd":46
 *     sz = cnp.PyArray_SIZE(arr)
 * 
 *     if i < 0:             # <<<<<<<<<<<<<<
 *         i += sz
 *     elif i >= sz:
 */
  __pyx_t_4 = (__pyx_v_i < 0);
  if (__pyx_t_4) {

    /* "util.pxd":47
 * 
 *     if i < 0:
 *         i += sz             # <<<<<<<<<<<<<<
 *     elif i >= sz:
 *         raise IndexError('index out of bounds')
 */
    __pyx_v_i = (__pyx_v_i + __pyx_v_sz);
    goto __pyx_L5;
  }

  /* "util.pxd":48
 *     if i < 0:
 *         i += sz
 *     elif i >= sz:             # <<<<<<<<<<<<<<
 *         raise IndexError('index out of bounds')
 * 
 */
  __pyx_t_4 = (__pyx_v_i >= __pyx_v_sz);
  if (__pyx_t_4) {

    /* "util.pxd":49
 *         i += sz
 *     elif i >= sz:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     assign_value_1d(arr, i, value)
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_202), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[14]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "util.pxd":51
 *         raise IndexError('index out of bounds')
 * 
 *     assign_value_1d(arr, i, value)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int is_contiguous(ndarray arr):
 */
  __pyx_t_1 = assign_value_1d(__pyx_v_arr, __pyx_v_i, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("util.set_value_at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_casted);
  __Pyx_XDECREF(__pyx_v_loc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":53
 *     assign_value_1d(arr, i, value)
 * 
 * cdef inline int is_contiguous(ndarray arr):             # <<<<<<<<<<<<<<
 *     return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS)
 * 
 */

static CYTHON_INLINE int __pyx_f_4util_is_contiguous(PyArrayObject *__pyx_v_arr) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_contiguous");

  /* "util.pxd":54
 * 
 * cdef inline int is_contiguous(ndarray arr):
 *     return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 * 
 * cdef inline is_array(object o):
 */
  __pyx_r = PyArray_CHKFLAGS(__pyx_v_arr, NPY_C_CONTIGUOUS);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":56
 *     return cnp.PyArray_CHKFLAGS(arr, cnp.NPY_C_CONTIGUOUS)
 * 
 * cdef inline is_array(object o):             # <<<<<<<<<<<<<<
 *     return cnp.PyArray_Check(o)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_4util_is_array(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_array");

  /* "util.pxd":57
 * 
 * cdef inline is_array(object o):
 *     return cnp.PyArray_Check(o)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(PyArray_Check(__pyx_v_o)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("util.is_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":60
 * 
 * 
 * cdef inline bint _checknull(object val):             # <<<<<<<<<<<<<<
 *     return not cnp.PyArray_Check(val) and (val is None or val != val)
 * 
 */

static CYTHON_INLINE int __pyx_f_4util__checknull(PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_checknull");

  /* "util.pxd":61
 * 
 * cdef inline bint _checknull(object val):
 *     return not cnp.PyArray_Check(val) and (val is None or val != val)             # <<<<<<<<<<<<<<
 * 
 * cdef inline bint _checknan(object val):
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((!PyArray_Check(__pyx_v_val))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = (__pyx_v_val == Py_None);
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_t_4;
      __pyx_t_4 = 0;
    } else {
      __pyx_t_5 = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __pyx_t_3 = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("util._checknull", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "util.pxd":63
 *     return not cnp.PyArray_Check(val) and (val is None or val != val)
 * 
 * cdef inline bint _checknan(object val):             # <<<<<<<<<<<<<<
 *     return not cnp.PyArray_Check(val) and val != val
 */

static CYTHON_INLINE int __pyx_f_4util__checknan(PyObject *__pyx_v_val) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_checknan");

  /* "util.pxd":64
 * 
 * cdef inline bint _checknan(object val):
 *     return not cnp.PyArray_Check(val) and val != val             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((!PyArray_Check(__pyx_v_val))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_val, __pyx_v_val, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_4 = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("util._checknan", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_6pandas_3lib_ObjectVector __pyx_vtable_6pandas_3lib_ObjectVector;

static PyObject *__pyx_tp_new_6pandas_3lib_ObjectVector(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_ObjectVector *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_ObjectVector *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_ObjectVector;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_ObjectVector(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pandas_3lib_12ObjectVector_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_ObjectVector[] = {
  {__Pyx_NAMESTR("__array__"), (PyCFunction)__pyx_pf_6pandas_3lib_12ObjectVector___array__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_12ObjectVector___array__)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ObjectVector = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_ObjectVector = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ObjectVector = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ObjectVector = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_ObjectVector = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.ObjectVector"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_ObjectVector), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_ObjectVector, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_ObjectVector, /*tp_as_number*/
  &__pyx_tp_as_sequence_ObjectVector, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ObjectVector, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ObjectVector, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_ObjectVector, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_ObjectVector, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_Int64Vector __pyx_vtable_6pandas_3lib_Int64Vector;

static PyObject *__pyx_tp_new_6pandas_3lib_Int64Vector(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Int64Vector *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Int64Vector *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_Int64Vector;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Int64Vector(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pandas_3lib_11Int64Vector_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_Int64Vector[] = {
  {__Pyx_NAMESTR("__array__"), (PyCFunction)__pyx_pf_6pandas_3lib_11Int64Vector___array__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_11Int64Vector___array__)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Int64Vector = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Int64Vector = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Int64Vector = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Int64Vector = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Int64Vector = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Int64Vector"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Int64Vector), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Int64Vector, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Int64Vector, /*tp_as_number*/
  &__pyx_tp_as_sequence_Int64Vector, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Int64Vector, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Int64Vector, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Int64Vector, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Int64Vector, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_HashTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_HashTable(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_HashTable[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_HashTable = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_HashTable = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_HashTable = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_HashTable = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_HashTable = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.HashTable"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_HashTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_HashTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_HashTable, /*tp_as_number*/
  &__pyx_tp_as_sequence_HashTable, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_HashTable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_HashTable, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_HashTable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_HashTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_StringHashTable __pyx_vtable_6pandas_3lib_StringHashTable;

static PyObject *__pyx_tp_new_6pandas_3lib_StringHashTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_StringHashTable *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_HashTable(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_StringHashTable *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_StringHashTable;
  if (__pyx_pf_6pandas_3lib_15StringHashTable___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_StringHashTable(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pandas_3lib_15StringHashTable_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_6pandas_3lib_HashTable(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_StringHashTable[] = {
  {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pf_6pandas_3lib_15StringHashTable_2get_item, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pf_6pandas_3lib_15StringHashTable_3get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pf_6pandas_3lib_15StringHashTable_4set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_15StringHashTable_5get_indexer, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pf_6pandas_3lib_15StringHashTable_6unique, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pf_6pandas_3lib_15StringHashTable_7factorize, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_StringHashTable = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_StringHashTable = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StringHashTable = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_StringHashTable = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_StringHashTable = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.StringHashTable"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_StringHashTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_StringHashTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_StringHashTable, /*tp_as_number*/
  &__pyx_tp_as_sequence_StringHashTable, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StringHashTable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_StringHashTable, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_StringHashTable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_StringHashTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_Int32HashTable __pyx_vtable_6pandas_3lib_Int32HashTable;

static PyObject *__pyx_tp_new_6pandas_3lib_Int32HashTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Int32HashTable *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_HashTable(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Int32HashTable *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_Int32HashTable;
  if (__pyx_pf_6pandas_3lib_14Int32HashTable_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Int32HashTable(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pandas_3lib_14Int32HashTable_2__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_6pandas_3lib_HashTable(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_Int32HashTable[] = {
  {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int32HashTable_3get_item, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int32HashTable_4get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int32HashTable_5set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int32HashTable_6map_locations, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int32HashTable_7lookup, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int32HashTable_8factorize, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Int32HashTable = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Int32HashTable = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Int32HashTable = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Int32HashTable = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Int32HashTable = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Int32HashTable"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Int32HashTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Int32HashTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Int32HashTable, /*tp_as_number*/
  &__pyx_tp_as_sequence_Int32HashTable, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Int32HashTable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Int32HashTable, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Int32HashTable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_14Int32HashTable___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Int32HashTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_Int64HashTable __pyx_vtable_6pandas_3lib_Int64HashTable;

static PyObject *__pyx_tp_new_6pandas_3lib_Int64HashTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Int64HashTable *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_HashTable(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_Int64HashTable;
  if (__pyx_pf_6pandas_3lib_14Int64HashTable_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Int64HashTable(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pandas_3lib_14Int64HashTable_2__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_6pandas_3lib_HashTable(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_Int64HashTable[] = {
  {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_5get_item, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_6get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_7set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("map"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_8map, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_9map_locations, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_10lookup, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("lookup_i4"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_11lookup_i4, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_12factorize, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_13get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_labels_groupby"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_14get_labels_groupby, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pf_6pandas_3lib_14Int64HashTable_15unique, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Int64HashTable = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Int64HashTable = {
  __pyx_pf_6pandas_3lib_14Int64HashTable_4__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pf_6pandas_3lib_14Int64HashTable_3__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Int64HashTable = {
  __pyx_pf_6pandas_3lib_14Int64HashTable_4__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Int64HashTable = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Int64HashTable = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Int64HashTable"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Int64HashTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Int64HashTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Int64HashTable, /*tp_as_number*/
  &__pyx_tp_as_sequence_Int64HashTable, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Int64HashTable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Int64HashTable, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Int64HashTable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_14Int64HashTable___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Int64HashTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_Float64HashTable __pyx_vtable_6pandas_3lib_Float64HashTable;

static PyObject *__pyx_tp_new_6pandas_3lib_Float64HashTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Float64HashTable *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_HashTable(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Float64HashTable *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_Float64HashTable;
  if (__pyx_pf_6pandas_3lib_16Float64HashTable_1__cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Float64HashTable(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pandas_3lib_16Float64HashTable_3__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_6pandas_3lib_HashTable(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_Float64HashTable[] = {
  {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pf_6pandas_3lib_16Float64HashTable_4factorize, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pf_6pandas_3lib_16Float64HashTable_5get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pf_6pandas_3lib_16Float64HashTable_6map_locations, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pf_6pandas_3lib_16Float64HashTable_7lookup, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pf_6pandas_3lib_16Float64HashTable_8unique, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Float64HashTable = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Float64HashTable = {
  __pyx_pf_6pandas_3lib_16Float64HashTable_2__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Float64HashTable = {
  __pyx_pf_6pandas_3lib_16Float64HashTable_2__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Float64HashTable = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Float64HashTable = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Float64HashTable"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Float64HashTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Float64HashTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Float64HashTable, /*tp_as_number*/
  &__pyx_tp_as_sequence_Float64HashTable, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Float64HashTable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Float64HashTable, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Float64HashTable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_16Float64HashTable___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Float64HashTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_PyObjectHashTable __pyx_vtable_6pandas_3lib_PyObjectHashTable;

static PyObject *__pyx_tp_new_6pandas_3lib_PyObjectHashTable(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_PyObjectHashTable *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_HashTable(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_PyObjectHashTable;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_PyObjectHashTable(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pandas_3lib_17PyObjectHashTable_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_6pandas_3lib_HashTable(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_PyObjectHashTable[] = {
  {__Pyx_NAMESTR("destroy"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_4destroy, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_item"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_5get_item, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_iter_test"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_6get_iter_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_item"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_7set_item, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("map_locations"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_8map_locations, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_9lookup, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("lookup2"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_10lookup2, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_11unique, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pf_6pandas_3lib_17PyObjectHashTable_12get_labels, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_PyObjectHashTable = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_PyObjectHashTable = {
  __pyx_pf_6pandas_3lib_17PyObjectHashTable_2__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pf_6pandas_3lib_17PyObjectHashTable_3__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_PyObjectHashTable = {
  __pyx_pf_6pandas_3lib_17PyObjectHashTable_2__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_PyObjectHashTable = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_PyObjectHashTable = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.PyObjectHashTable"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_PyObjectHashTable), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_PyObjectHashTable, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_PyObjectHashTable, /*tp_as_number*/
  &__pyx_tp_as_sequence_PyObjectHashTable, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_PyObjectHashTable, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_PyObjectHashTable, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_PyObjectHashTable, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_17PyObjectHashTable___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_PyObjectHashTable, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_Factorizer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Factorizer *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Factorizer *)o);
  p->table = ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)Py_None); Py_INCREF(Py_None);
  p->uniques = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Factorizer(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Factorizer *p = (struct __pyx_obj_6pandas_3lib_Factorizer *)o;
  Py_XDECREF(((PyObject *)p->table));
  Py_XDECREF(p->uniques);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_Factorizer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_Factorizer *p = (struct __pyx_obj_6pandas_3lib_Factorizer *)o;
  if (p->table) {
    e = (*v)(((PyObject*)p->table), a); if (e) return e;
  }
  if (p->uniques) {
    e = (*v)(p->uniques, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_Factorizer(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Factorizer *p = (struct __pyx_obj_6pandas_3lib_Factorizer *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->table);
  p->table = ((struct __pyx_obj_6pandas_3lib_PyObjectHashTable *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->uniques);
  p->uniques = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_10Factorizer_table(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_10Factorizer_5table___get__(o);
}

static int __pyx_setprop_6pandas_3lib_10Factorizer_table(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_10Factorizer_5table_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_10Factorizer_5table_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_10Factorizer_uniques(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_10Factorizer_7uniques___get__(o);
}

static int __pyx_setprop_6pandas_3lib_10Factorizer_uniques(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_10Factorizer_7uniques_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_10Factorizer_7uniques_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_10Factorizer_count(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_10Factorizer_5count___get__(o);
}

static int __pyx_setprop_6pandas_3lib_10Factorizer_count(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_10Factorizer_5count_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_6pandas_3lib_Factorizer[] = {
  {__Pyx_NAMESTR("get_count"), (PyCFunction)__pyx_pf_6pandas_3lib_10Factorizer_1get_count, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pf_6pandas_3lib_10Factorizer_2factorize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pf_6pandas_3lib_10Factorizer_3unique, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib_Factorizer[] = {
  {(char *)"table", __pyx_getprop_6pandas_3lib_10Factorizer_table, __pyx_setprop_6pandas_3lib_10Factorizer_table, 0, 0},
  {(char *)"uniques", __pyx_getprop_6pandas_3lib_10Factorizer_uniques, __pyx_setprop_6pandas_3lib_10Factorizer_uniques, 0, 0},
  {(char *)"count", __pyx_getprop_6pandas_3lib_10Factorizer_count, __pyx_setprop_6pandas_3lib_10Factorizer_count, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Factorizer = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Factorizer = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Factorizer = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Factorizer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Factorizer = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Factorizer"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Factorizer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Factorizer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Factorizer, /*tp_as_number*/
  &__pyx_tp_as_sequence_Factorizer, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Factorizer, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Factorizer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_Factorizer, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_Factorizer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Factorizer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib_Factorizer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_10Factorizer___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Factorizer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_Int64Factorizer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Int64Factorizer *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Int64Factorizer *)o);
  p->table = ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)Py_None); Py_INCREF(Py_None);
  p->uniques = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Int64Factorizer(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Int64Factorizer *p = (struct __pyx_obj_6pandas_3lib_Int64Factorizer *)o;
  Py_XDECREF(((PyObject *)p->table));
  Py_XDECREF(((PyObject *)p->uniques));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_Int64Factorizer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_Int64Factorizer *p = (struct __pyx_obj_6pandas_3lib_Int64Factorizer *)o;
  if (p->table) {
    e = (*v)(((PyObject*)p->table), a); if (e) return e;
  }
  if (p->uniques) {
    e = (*v)(p->uniques, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_Int64Factorizer(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Int64Factorizer *p = (struct __pyx_obj_6pandas_3lib_Int64Factorizer *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->table);
  p->table = ((struct __pyx_obj_6pandas_3lib_Int64HashTable *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->uniques);
  p->uniques = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_15Int64Factorizer_table(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_15Int64Factorizer_5table___get__(o);
}

static int __pyx_setprop_6pandas_3lib_15Int64Factorizer_table(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_15Int64Factorizer_5table_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_15Int64Factorizer_5table_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_15Int64Factorizer_uniques(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques___get__(o);
}

static int __pyx_setprop_6pandas_3lib_15Int64Factorizer_uniques(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_15Int64Factorizer_7uniques_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_15Int64Factorizer_count(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_15Int64Factorizer_5count___get__(o);
}

static int __pyx_setprop_6pandas_3lib_15Int64Factorizer_count(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_15Int64Factorizer_5count_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_6pandas_3lib_Int64Factorizer[] = {
  {__Pyx_NAMESTR("get_count"), (PyCFunction)__pyx_pf_6pandas_3lib_15Int64Factorizer_1get_count, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pf_6pandas_3lib_15Int64Factorizer_2factorize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib_Int64Factorizer[] = {
  {(char *)"table", __pyx_getprop_6pandas_3lib_15Int64Factorizer_table, __pyx_setprop_6pandas_3lib_15Int64Factorizer_table, 0, 0},
  {(char *)"uniques", __pyx_getprop_6pandas_3lib_15Int64Factorizer_uniques, __pyx_setprop_6pandas_3lib_15Int64Factorizer_uniques, 0, 0},
  {(char *)"count", __pyx_getprop_6pandas_3lib_15Int64Factorizer_count, __pyx_setprop_6pandas_3lib_15Int64Factorizer_count, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Int64Factorizer = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Int64Factorizer = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Int64Factorizer = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Int64Factorizer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Int64Factorizer = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Int64Factorizer"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Int64Factorizer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Int64Factorizer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Int64Factorizer, /*tp_as_number*/
  &__pyx_tp_as_sequence_Int64Factorizer, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Int64Factorizer, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Int64Factorizer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_Int64Factorizer, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_Int64Factorizer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Int64Factorizer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib_Int64Factorizer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_15Int64Factorizer___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Int64Factorizer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_DictFactorizer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_DictFactorizer *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_DictFactorizer *)o);
  p->table = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->uniques = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_DictFactorizer(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_DictFactorizer *p = (struct __pyx_obj_6pandas_3lib_DictFactorizer *)o;
  Py_XDECREF(((PyObject *)p->table));
  Py_XDECREF(((PyObject *)p->uniques));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_DictFactorizer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_DictFactorizer *p = (struct __pyx_obj_6pandas_3lib_DictFactorizer *)o;
  if (p->table) {
    e = (*v)(p->table, a); if (e) return e;
  }
  if (p->uniques) {
    e = (*v)(p->uniques, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_DictFactorizer(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_DictFactorizer *p = (struct __pyx_obj_6pandas_3lib_DictFactorizer *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->table);
  p->table = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->uniques);
  p->uniques = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_14DictFactorizer_table(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_14DictFactorizer_5table___get__(o);
}

static int __pyx_setprop_6pandas_3lib_14DictFactorizer_table(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_14DictFactorizer_5table_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_14DictFactorizer_5table_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_14DictFactorizer_uniques(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_14DictFactorizer_7uniques___get__(o);
}

static int __pyx_setprop_6pandas_3lib_14DictFactorizer_uniques(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_14DictFactorizer_7uniques_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_14DictFactorizer_7uniques_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_14DictFactorizer_count(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_14DictFactorizer_5count___get__(o);
}

static int __pyx_setprop_6pandas_3lib_14DictFactorizer_count(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_14DictFactorizer_5count_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_6pandas_3lib_DictFactorizer[] = {
  {__Pyx_NAMESTR("get_count"), (PyCFunction)__pyx_pf_6pandas_3lib_14DictFactorizer_1get_count, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_labels"), (PyCFunction)__pyx_pf_6pandas_3lib_14DictFactorizer_2get_labels, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("factorize"), (PyCFunction)__pyx_pf_6pandas_3lib_14DictFactorizer_3factorize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("unique"), (PyCFunction)__pyx_pf_6pandas_3lib_14DictFactorizer_4unique, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("unique_int64"), (PyCFunction)__pyx_pf_6pandas_3lib_14DictFactorizer_5unique_int64, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib_DictFactorizer[] = {
  {(char *)"table", __pyx_getprop_6pandas_3lib_14DictFactorizer_table, __pyx_setprop_6pandas_3lib_14DictFactorizer_table, 0, 0},
  {(char *)"uniques", __pyx_getprop_6pandas_3lib_14DictFactorizer_uniques, __pyx_setprop_6pandas_3lib_14DictFactorizer_uniques, 0, 0},
  {(char *)"count", __pyx_getprop_6pandas_3lib_14DictFactorizer_count, __pyx_setprop_6pandas_3lib_14DictFactorizer_count, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_DictFactorizer = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_DictFactorizer = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_DictFactorizer = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_DictFactorizer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_DictFactorizer = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.DictFactorizer"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_DictFactorizer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_DictFactorizer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_DictFactorizer, /*tp_as_number*/
  &__pyx_tp_as_sequence_DictFactorizer, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_DictFactorizer, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_DictFactorizer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_DictFactorizer, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_DictFactorizer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_DictFactorizer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib_DictFactorizer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_14DictFactorizer___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_DictFactorizer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib__Timestamp __pyx_vtable_6pandas_3lib__Timestamp;

static PyObject *__pyx_tp_new_6pandas_3lib__Timestamp(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib__Timestamp *p;
  PyObject *o = __pyx_ptype_8datetime_datetime->tp_new(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib__Timestamp *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib__Timestamp;
  p->offset = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib__Timestamp(PyObject *o) {
  struct __pyx_obj_6pandas_3lib__Timestamp *p = (struct __pyx_obj_6pandas_3lib__Timestamp *)o;
  Py_XDECREF(p->offset);
  __pyx_ptype_8datetime_datetime->tp_dealloc(o);
}

static int __pyx_tp_traverse_6pandas_3lib__Timestamp(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib__Timestamp *p = (struct __pyx_obj_6pandas_3lib__Timestamp *)o;
  if (__pyx_ptype_8datetime_datetime->tp_traverse) {
    e = __pyx_ptype_8datetime_datetime->tp_traverse(o, v, a); if (e) return e;
  }
  if (p->offset) {
    e = (*v)(p->offset, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib__Timestamp(PyObject *o) {
  struct __pyx_obj_6pandas_3lib__Timestamp *p = (struct __pyx_obj_6pandas_3lib__Timestamp *)o;
  PyObject* tmp;
  if (__pyx_ptype_8datetime_datetime->tp_clear) {
    __pyx_ptype_8datetime_datetime->tp_clear(o);
  }
  tmp = ((PyObject*)p->offset);
  p->offset = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_10_Timestamp_value(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_10_Timestamp_5value___get__(o);
}

static PyObject *__pyx_getprop_6pandas_3lib_10_Timestamp_nanosecond(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_10_Timestamp_10nanosecond___get__(o);
}

static PyObject *__pyx_getprop_6pandas_3lib_10_Timestamp_offset(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_10_Timestamp_6offset___get__(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib__Timestamp[] = {
  {__Pyx_NAMESTR("_get_field"), (PyCFunction)__pyx_pf_6pandas_3lib_10_Timestamp_4_get_field, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib__Timestamp[] = {
  {(char *)"value", __pyx_getprop_6pandas_3lib_10_Timestamp_value, 0, 0, 0},
  {(char *)"nanosecond", __pyx_getprop_6pandas_3lib_10_Timestamp_nanosecond, 0, 0, 0},
  {(char *)"offset", __pyx_getprop_6pandas_3lib_10_Timestamp_offset, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Timestamp = {
  __pyx_pf_6pandas_3lib_10_Timestamp_2__add__, /*nb_add*/
  __pyx_pf_6pandas_3lib_10_Timestamp_3__sub__, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__Timestamp = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Timestamp = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Timestamp = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib__Timestamp = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib._Timestamp"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib__Timestamp), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib__Timestamp, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__Timestamp, /*tp_as_number*/
  &__pyx_tp_as_sequence__Timestamp, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__Timestamp, /*tp_as_mapping*/
  __pyx_pf_6pandas_3lib_10_Timestamp___hash__, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__Timestamp, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib__Timestamp, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib__Timestamp, /*tp_clear*/
  __pyx_pf_6pandas_3lib_10_Timestamp_1__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib__Timestamp, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib__Timestamp, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib__Timestamp, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib__NaT __pyx_vtable_6pandas_3lib__NaT;

static PyObject *__pyx_tp_new_6pandas_3lib__NaT(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib__NaT *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib__Timestamp(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib__NaT *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_3lib__Timestamp*)__pyx_vtabptr_6pandas_3lib__NaT;
  return o;
}

static PyMethodDef __pyx_methods_6pandas_3lib__NaT[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__NaT = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__NaT = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__NaT = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__NaT = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib__NaT = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib._NaT"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib__NaT), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib__Timestamp, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__NaT, /*tp_as_number*/
  &__pyx_tp_as_sequence__NaT, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__NaT, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__NaT, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib__Timestamp, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib__Timestamp, /*tp_clear*/
  __pyx_pf_6pandas_3lib_4_NaT___richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib__NaT, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib__NaT, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib__TSObject(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib__TSObject *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib__TSObject *)o);
  p->tzinfo = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib__TSObject(PyObject *o) {
  struct __pyx_obj_6pandas_3lib__TSObject *p = (struct __pyx_obj_6pandas_3lib__TSObject *)o;
  Py_XDECREF(p->tzinfo);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib__TSObject(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib__TSObject *p = (struct __pyx_obj_6pandas_3lib__TSObject *)o;
  if (p->tzinfo) {
    e = (*v)(p->tzinfo, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib__TSObject(PyObject *o) {
  struct __pyx_obj_6pandas_3lib__TSObject *p = (struct __pyx_obj_6pandas_3lib__TSObject *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->tzinfo);
  p->tzinfo = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_9_TSObject_value(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_9_TSObject_5value___get__(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib__TSObject[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib__TSObject[] = {
  {(char *)"value", __pyx_getprop_6pandas_3lib_9_TSObject_value, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__TSObject = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__TSObject = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__TSObject = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__TSObject = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib__TSObject = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib._TSObject"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib__TSObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib__TSObject, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__TSObject, /*tp_as_number*/
  &__pyx_tp_as_sequence__TSObject, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__TSObject, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__TSObject, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib__TSObject, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib__TSObject, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib__TSObject, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib__TSObject, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib__TSObject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_Node(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Node *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Node *)o);
  p->next = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->width = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Node(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Node *p = (struct __pyx_obj_6pandas_3lib_Node *)o;
  Py_XDECREF(((PyObject *)p->next));
  Py_XDECREF(((PyObject *)p->width));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_Node(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_Node *p = (struct __pyx_obj_6pandas_3lib_Node *)o;
  if (p->next) {
    e = (*v)(p->next, a); if (e) return e;
  }
  if (p->width) {
    e = (*v)(p->width, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_Node(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Node *p = (struct __pyx_obj_6pandas_3lib_Node *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->next);
  p->next = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->width);
  p->width = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_4Node_value(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_4Node_5value___get__(o);
}

static int __pyx_setprop_6pandas_3lib_4Node_value(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_4Node_5value_1__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_4Node_next(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_4Node_4next___get__(o);
}

static int __pyx_setprop_6pandas_3lib_4Node_next(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_4Node_4next_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_4Node_4next_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_4Node_width(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_4Node_5width___get__(o);
}

static int __pyx_setprop_6pandas_3lib_4Node_width(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_4Node_5width_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_4Node_5width_2__del__(o);
  }
}

static PyMethodDef __pyx_methods_6pandas_3lib_Node[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib_Node[] = {
  {(char *)"value", __pyx_getprop_6pandas_3lib_4Node_value, __pyx_setprop_6pandas_3lib_4Node_value, 0, 0},
  {(char *)"next", __pyx_getprop_6pandas_3lib_4Node_next, __pyx_setprop_6pandas_3lib_4Node_next, 0, 0},
  {(char *)"width", __pyx_getprop_6pandas_3lib_4Node_width, __pyx_setprop_6pandas_3lib_4Node_width, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Node = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Node = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Node = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Node = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Node = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Node"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Node), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Node, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Node, /*tp_as_number*/
  &__pyx_tp_as_sequence_Node, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Node, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Node, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_Node, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_Node, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Node, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib_Node, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_4Node___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Node, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_IndexableSkiplist __pyx_vtable_6pandas_3lib_IndexableSkiplist;

static PyObject *__pyx_tp_new_6pandas_3lib_IndexableSkiplist(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_IndexableSkiplist *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_IndexableSkiplist;
  p->head = ((struct __pyx_obj_6pandas_3lib_Node *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_IndexableSkiplist(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_IndexableSkiplist *p = (struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)o;
  Py_XDECREF(((PyObject *)p->head));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_IndexableSkiplist(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_IndexableSkiplist *p = (struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)o;
  if (p->head) {
    e = (*v)(((PyObject*)p->head), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_IndexableSkiplist(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_IndexableSkiplist *p = (struct __pyx_obj_6pandas_3lib_IndexableSkiplist *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->head);
  p->head = ((struct __pyx_obj_6pandas_3lib_Node *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_6pandas_3lib_IndexableSkiplist(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_6pandas_3lib_IndexableSkiplist[] = {
  {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pf_6pandas_3lib_17IndexableSkiplist_3get, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pf_6pandas_3lib_17IndexableSkiplist_4insert, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("remove"), (PyCFunction)__pyx_pf_6pandas_3lib_17IndexableSkiplist_5remove, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_IndexableSkiplist = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_IndexableSkiplist = {
  __pyx_pf_6pandas_3lib_17IndexableSkiplist_1__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_6pandas_3lib_IndexableSkiplist, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_IndexableSkiplist = {
  __pyx_pf_6pandas_3lib_17IndexableSkiplist_1__len__, /*mp_length*/
  __pyx_pf_6pandas_3lib_17IndexableSkiplist_2__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_IndexableSkiplist = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_IndexableSkiplist = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.IndexableSkiplist"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_IndexableSkiplist), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_IndexableSkiplist, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_IndexableSkiplist, /*tp_as_number*/
  &__pyx_tp_as_sequence_IndexableSkiplist, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_IndexableSkiplist, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_IndexableSkiplist, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Sorted collection supporting O(lg n) insertion, removal, and\n    lookup by rank.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_IndexableSkiplist, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_IndexableSkiplist, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_IndexableSkiplist, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_17IndexableSkiplist___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_IndexableSkiplist, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib__PandasNull(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib__PandasNull(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib__PandasNull[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__PandasNull = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__PandasNull = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__PandasNull = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__PandasNull = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib__PandasNull = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib._PandasNull"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib__PandasNull), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib__PandasNull, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number__PandasNull, /*tp_as_number*/
  &__pyx_tp_as_sequence__PandasNull, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__PandasNull, /*tp_as_mapping*/
  __pyx_pf_6pandas_3lib_11_PandasNull_1__hash__, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__PandasNull, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_pf_6pandas_3lib_11_PandasNull___richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib__PandasNull, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib__PandasNull, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_Reducer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Reducer *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Reducer *)o);
  p->arr = Py_None; Py_INCREF(Py_None);
  p->dummy = Py_None; Py_INCREF(Py_None);
  p->f = Py_None; Py_INCREF(Py_None);
  p->labels = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Reducer(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o;
  Py_XDECREF(p->arr);
  Py_XDECREF(p->dummy);
  Py_XDECREF(p->f);
  Py_XDECREF(p->labels);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_Reducer(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o;
  if (p->arr) {
    e = (*v)(p->arr, a); if (e) return e;
  }
  if (p->dummy) {
    e = (*v)(p->dummy, a); if (e) return e;
  }
  if (p->f) {
    e = (*v)(p->f, a); if (e) return e;
  }
  if (p->labels) {
    e = (*v)(p->labels, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_Reducer(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Reducer *p = (struct __pyx_obj_6pandas_3lib_Reducer *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->arr);
  p->arr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dummy);
  p->dummy = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->f);
  p->f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->labels);
  p->labels = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6pandas_3lib_Reducer[] = {
  {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pf_6pandas_3lib_7Reducer_1_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pf_6pandas_3lib_7Reducer_2get_result, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pf_6pandas_3lib_7Reducer_3_get_result_array, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Reducer = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Reducer = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Reducer = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Reducer = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Reducer = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Reducer"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Reducer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Reducer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Reducer, /*tp_as_number*/
  &__pyx_tp_as_sequence_Reducer, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Reducer, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Reducer, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Performs generic reduction operation on a C or Fortran-contiguous ndarray\n    while avoiding ndarray construction overhead\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_Reducer, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_Reducer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Reducer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_7Reducer___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Reducer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_SeriesBinGrouper(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o);
  p->arr = Py_None; Py_INCREF(Py_None);
  p->index = Py_None; Py_INCREF(Py_None);
  p->dummy = Py_None; Py_INCREF(Py_None);
  p->f = Py_None; Py_INCREF(Py_None);
  p->bins = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_SeriesBinGrouper(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o;
  Py_XDECREF(p->arr);
  Py_XDECREF(p->index);
  Py_XDECREF(p->dummy);
  Py_XDECREF(p->f);
  Py_XDECREF(p->bins);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_SeriesBinGrouper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o;
  if (p->arr) {
    e = (*v)(p->arr, a); if (e) return e;
  }
  if (p->index) {
    e = (*v)(p->index, a); if (e) return e;
  }
  if (p->dummy) {
    e = (*v)(p->dummy, a); if (e) return e;
  }
  if (p->f) {
    e = (*v)(p->f, a); if (e) return e;
  }
  if (p->bins) {
    e = (*v)(p->bins, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_SeriesBinGrouper(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesBinGrouper *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->arr);
  p->arr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->index);
  p->index = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dummy);
  p->dummy = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->f);
  p->f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->bins);
  p->bins = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_arr(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr___get__(o);
}

static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_arr(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_3arr_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_index(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index___get__(o);
}

static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_index(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5index_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy___get__(o);
}

static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_5dummy_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_f(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f___get__(o);
}

static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_f(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_1f_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_16SeriesBinGrouper_bins(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins___get__(o);
}

static int __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_bins(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_16SeriesBinGrouper_4bins_2__del__(o);
  }
}

static PyMethodDef __pyx_methods_6pandas_3lib_SeriesBinGrouper[] = {
  {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pf_6pandas_3lib_16SeriesBinGrouper_1_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pf_6pandas_3lib_16SeriesBinGrouper_2get_result, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pf_6pandas_3lib_16SeriesBinGrouper_3_get_result_array, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib_SeriesBinGrouper[] = {
  {(char *)"arr", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_arr, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_arr, 0, 0},
  {(char *)"index", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_index, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_index, 0, 0},
  {(char *)"dummy", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_dummy, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_dummy, 0, 0},
  {(char *)"f", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_f, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_f, 0, 0},
  {(char *)"bins", __pyx_getprop_6pandas_3lib_16SeriesBinGrouper_bins, __pyx_setprop_6pandas_3lib_16SeriesBinGrouper_bins, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SeriesBinGrouper = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_SeriesBinGrouper = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SeriesBinGrouper = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SeriesBinGrouper = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_SeriesBinGrouper = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.SeriesBinGrouper"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_SeriesBinGrouper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_SeriesBinGrouper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_SeriesBinGrouper, /*tp_as_number*/
  &__pyx_tp_as_sequence_SeriesBinGrouper, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SeriesBinGrouper, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SeriesBinGrouper, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Performs grouping operation according to bin edges, rather than labels\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_SeriesBinGrouper, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_SeriesBinGrouper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_SeriesBinGrouper, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib_SeriesBinGrouper, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_16SeriesBinGrouper___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_SeriesBinGrouper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_SeriesGrouper(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_SeriesGrouper *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o);
  p->arr = Py_None; Py_INCREF(Py_None);
  p->index = Py_None; Py_INCREF(Py_None);
  p->dummy = Py_None; Py_INCREF(Py_None);
  p->f = Py_None; Py_INCREF(Py_None);
  p->labels = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_SeriesGrouper(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o;
  Py_XDECREF(p->arr);
  Py_XDECREF(p->index);
  Py_XDECREF(p->dummy);
  Py_XDECREF(p->f);
  Py_XDECREF(p->labels);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_SeriesGrouper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o;
  if (p->arr) {
    e = (*v)(p->arr, a); if (e) return e;
  }
  if (p->index) {
    e = (*v)(p->index, a); if (e) return e;
  }
  if (p->dummy) {
    e = (*v)(p->dummy, a); if (e) return e;
  }
  if (p->f) {
    e = (*v)(p->f, a); if (e) return e;
  }
  if (p->labels) {
    e = (*v)(p->labels, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_SeriesGrouper(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_SeriesGrouper *p = (struct __pyx_obj_6pandas_3lib_SeriesGrouper *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->arr);
  p->arr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->index);
  p->index = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dummy);
  p->dummy = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->f);
  p->f = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->labels);
  p->labels = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_arr(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr___get__(o);
}

static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_arr(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_3arr_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_index(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_13SeriesGrouper_5index___get__(o);
}

static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_index(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_5index_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy___get__(o);
}

static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_5dummy_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_f(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_13SeriesGrouper_1f___get__(o);
}

static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_f(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_1f_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6pandas_3lib_13SeriesGrouper_labels(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels___get__(o);
}

static int __pyx_setprop_6pandas_3lib_13SeriesGrouper_labels(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_1__set__(o, v);
  }
  else {
    return __pyx_pf_6pandas_3lib_13SeriesGrouper_6labels_2__del__(o);
  }
}

static PyMethodDef __pyx_methods_6pandas_3lib_SeriesGrouper[] = {
  {__Pyx_NAMESTR("_check_dummy"), (PyCFunction)__pyx_pf_6pandas_3lib_13SeriesGrouper_1_check_dummy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_result"), (PyCFunction)__pyx_pf_6pandas_3lib_13SeriesGrouper_2get_result, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_get_result_array"), (PyCFunction)__pyx_pf_6pandas_3lib_13SeriesGrouper_3_get_result_array, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib_SeriesGrouper[] = {
  {(char *)"arr", __pyx_getprop_6pandas_3lib_13SeriesGrouper_arr, __pyx_setprop_6pandas_3lib_13SeriesGrouper_arr, 0, 0},
  {(char *)"index", __pyx_getprop_6pandas_3lib_13SeriesGrouper_index, __pyx_setprop_6pandas_3lib_13SeriesGrouper_index, 0, 0},
  {(char *)"dummy", __pyx_getprop_6pandas_3lib_13SeriesGrouper_dummy, __pyx_setprop_6pandas_3lib_13SeriesGrouper_dummy, 0, 0},
  {(char *)"f", __pyx_getprop_6pandas_3lib_13SeriesGrouper_f, __pyx_setprop_6pandas_3lib_13SeriesGrouper_f, 0, 0},
  {(char *)"labels", __pyx_getprop_6pandas_3lib_13SeriesGrouper_labels, __pyx_setprop_6pandas_3lib_13SeriesGrouper_labels, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SeriesGrouper = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_SeriesGrouper = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SeriesGrouper = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SeriesGrouper = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_SeriesGrouper = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.SeriesGrouper"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_SeriesGrouper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_SeriesGrouper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_SeriesGrouper, /*tp_as_number*/
  &__pyx_tp_as_sequence_SeriesGrouper, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SeriesGrouper, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SeriesGrouper, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Performs generic grouping operation while avoiding ndarray construction\n    overhead\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_SeriesGrouper, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_SeriesGrouper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_SeriesGrouper, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib_SeriesGrouper, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_13SeriesGrouper___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_SeriesGrouper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_Slider __pyx_vtable_6pandas_3lib_Slider;

static PyObject *__pyx_tp_new_6pandas_3lib_Slider(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Slider *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Slider *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_Slider;
  p->values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  p->buf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_Slider(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o;
  Py_XDECREF(((PyObject *)p->values));
  Py_XDECREF(((PyObject *)p->buf));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_Slider(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o;
  if (p->values) {
    e = (*v)(((PyObject*)p->values), a); if (e) return e;
  }
  if (p->buf) {
    e = (*v)(((PyObject*)p->buf), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_Slider(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_Slider *p = (struct __pyx_obj_6pandas_3lib_Slider *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->values);
  p->values = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->buf);
  p->buf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6pandas_3lib_Slider[] = {
  {__Pyx_NAMESTR("advance"), (PyCFunction)__pyx_pf_6pandas_3lib_6Slider_1advance, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_length"), (PyCFunction)__pyx_pf_6pandas_3lib_6Slider_2set_length, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("cleanup"), (PyCFunction)__pyx_pf_6pandas_3lib_6Slider_3cleanup, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Slider = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Slider = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Slider = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Slider = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Slider = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Slider"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Slider), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_Slider, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Slider, /*tp_as_number*/
  &__pyx_tp_as_sequence_Slider, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Slider, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Slider, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Only handles contiguous data for now\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_Slider, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_Slider, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Slider, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_6Slider___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Slider, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_cache_readonly(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_cache_readonly *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_cache_readonly *)o);
  p->fget = Py_None; Py_INCREF(Py_None);
  p->name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_cache_readonly(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o;
  Py_XDECREF(p->fget);
  Py_XDECREF(p->name);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_cache_readonly(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o;
  if (p->fget) {
    e = (*v)(p->fget, a); if (e) return e;
  }
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_cache_readonly(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_cache_readonly *p = (struct __pyx_obj_6pandas_3lib_cache_readonly *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->fget);
  p->fget = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_descr_get_6pandas_3lib_cache_readonly(PyObject *o, PyObject *i, PyObject *c) {
  PyObject *r = 0;
  if (!i) i = Py_None;
  if (!c) c = Py_None;
  r = __pyx_pf_6pandas_3lib_14cache_readonly_1__get__(o, i, c);
  return r;
}

static PyObject *__pyx_getprop_6pandas_3lib_14cache_readonly_fget(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_14cache_readonly_4fget___get__(o);
}

static PyObject *__pyx_getprop_6pandas_3lib_14cache_readonly_name(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_14cache_readonly_4name___get__(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_cache_readonly[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib_cache_readonly[] = {
  {(char *)"fget", __pyx_getprop_6pandas_3lib_14cache_readonly_fget, 0, 0, 0},
  {(char *)"name", __pyx_getprop_6pandas_3lib_14cache_readonly_name, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_cache_readonly = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_cache_readonly = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_cache_readonly = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_cache_readonly = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_cache_readonly = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.cache_readonly"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_cache_readonly), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_cache_readonly, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_cache_readonly, /*tp_as_number*/
  &__pyx_tp_as_sequence_cache_readonly, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_cache_readonly, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_cache_readonly, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_cache_readonly, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_cache_readonly, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_cache_readonly, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib_cache_readonly, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  __pyx_tp_descr_get_6pandas_3lib_cache_readonly, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_14cache_readonly___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_cache_readonly, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_AxisProperty(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_AxisProperty(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_tp_descr_get_6pandas_3lib_AxisProperty(PyObject *o, PyObject *i, PyObject *c) {
  PyObject *r = 0;
  if (!i) i = Py_None;
  if (!c) c = Py_None;
  r = __pyx_pf_6pandas_3lib_12AxisProperty_1__get__(o, i, c);
  return r;
}

static int __pyx_tp_descr_set_6pandas_3lib_AxisProperty(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pf_6pandas_3lib_12AxisProperty_2__set__(o, i, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__delete__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_6pandas_3lib_AxisProperty[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_AxisProperty = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_AxisProperty = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_AxisProperty = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_AxisProperty = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_AxisProperty = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.AxisProperty"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_AxisProperty), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_AxisProperty, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_AxisProperty, /*tp_as_number*/
  &__pyx_tp_as_sequence_AxisProperty, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_AxisProperty, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_AxisProperty, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_AxisProperty, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  __pyx_tp_descr_get_6pandas_3lib_AxisProperty, /*tp_descr_get*/
  __pyx_tp_descr_set_6pandas_3lib_AxisProperty, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_12AxisProperty___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_AxisProperty, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_SeriesIndex(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_SeriesIndex *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_SeriesIndex *)o);
  p->_check_type = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_SeriesIndex(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_SeriesIndex *p = (struct __pyx_obj_6pandas_3lib_SeriesIndex *)o;
  Py_XDECREF(p->_check_type);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_SeriesIndex(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_SeriesIndex *p = (struct __pyx_obj_6pandas_3lib_SeriesIndex *)o;
  if (p->_check_type) {
    e = (*v)(p->_check_type, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_SeriesIndex(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_SeriesIndex *p = (struct __pyx_obj_6pandas_3lib_SeriesIndex *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_check_type);
  p->_check_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_descr_get_6pandas_3lib_SeriesIndex(PyObject *o, PyObject *i, PyObject *c) {
  PyObject *r = 0;
  if (!i) i = Py_None;
  if (!c) c = Py_None;
  r = __pyx_pf_6pandas_3lib_11SeriesIndex_1__get__(o, i, c);
  return r;
}

static int __pyx_tp_descr_set_6pandas_3lib_SeriesIndex(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pf_6pandas_3lib_11SeriesIndex_2__set__(o, i, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__delete__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_6pandas_3lib_SeriesIndex[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SeriesIndex = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_SeriesIndex = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SeriesIndex = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SeriesIndex = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_SeriesIndex = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.SeriesIndex"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_SeriesIndex), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_SeriesIndex, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_SeriesIndex, /*tp_as_number*/
  &__pyx_tp_as_sequence_SeriesIndex, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SeriesIndex, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SeriesIndex, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_SeriesIndex, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_SeriesIndex, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_SeriesIndex, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  __pyx_tp_descr_get_6pandas_3lib_SeriesIndex, /*tp_descr_get*/
  __pyx_tp_descr_set_6pandas_3lib_SeriesIndex, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_11SeriesIndex___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_SeriesIndex, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib_ValuesProperty(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_ValuesProperty(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_tp_descr_get_6pandas_3lib_ValuesProperty(PyObject *o, PyObject *i, PyObject *c) {
  PyObject *r = 0;
  if (!i) i = Py_None;
  if (!c) c = Py_None;
  r = __pyx_pf_6pandas_3lib_14ValuesProperty___get__(o, i, c);
  return r;
}

static PyMethodDef __pyx_methods_6pandas_3lib_ValuesProperty[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ValuesProperty = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_ValuesProperty = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ValuesProperty = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ValuesProperty = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_ValuesProperty = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.ValuesProperty"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_ValuesProperty), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_ValuesProperty, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_ValuesProperty, /*tp_as_number*/
  &__pyx_tp_as_sequence_ValuesProperty, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ValuesProperty, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ValuesProperty, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_ValuesProperty, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  __pyx_tp_descr_get_6pandas_3lib_ValuesProperty, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_ValuesProperty, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_IndexEngine __pyx_vtable_6pandas_3lib_IndexEngine;

static PyObject *__pyx_tp_new_6pandas_3lib_IndexEngine(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_IndexEngine *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_IndexEngine *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pandas_3lib_IndexEngine;
  p->vgetter = Py_None; Py_INCREF(Py_None);
  p->mapping = ((struct __pyx_obj_6pandas_3lib_HashTable *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib_IndexEngine(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_IndexEngine *p = (struct __pyx_obj_6pandas_3lib_IndexEngine *)o;
  Py_XDECREF(p->vgetter);
  Py_XDECREF(((PyObject *)p->mapping));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib_IndexEngine(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib_IndexEngine *p = (struct __pyx_obj_6pandas_3lib_IndexEngine *)o;
  if (p->vgetter) {
    e = (*v)(p->vgetter, a); if (e) return e;
  }
  if (p->mapping) {
    e = (*v)(((PyObject*)p->mapping), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib_IndexEngine(PyObject *o) {
  struct __pyx_obj_6pandas_3lib_IndexEngine *p = (struct __pyx_obj_6pandas_3lib_IndexEngine *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->vgetter);
  p->vgetter = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mapping);
  p->mapping = ((struct __pyx_obj_6pandas_3lib_HashTable *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pandas_3lib_11IndexEngine_is_unique(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_11IndexEngine_9is_unique___get__(o);
}

static PyObject *__pyx_getprop_6pandas_3lib_11IndexEngine_is_monotonic(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_11IndexEngine_12is_monotonic___get__(o);
}

static PyObject *__pyx_getprop_6pandas_3lib_11IndexEngine_vgetter(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_11IndexEngine_7vgetter___get__(o);
}

static PyObject *__pyx_getprop_6pandas_3lib_11IndexEngine_mapping(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_11IndexEngine_7mapping___get__(o);
}

static PyObject *__pyx_getprop_6pandas_3lib_11IndexEngine_over_size_threshold(PyObject *o, void *x) {
  return __pyx_pf_6pandas_3lib_11IndexEngine_19over_size_threshold___get__(o);
}

static PyMethodDef __pyx_methods_6pandas_3lib_IndexEngine[] = {
  {__Pyx_NAMESTR("get_value"), (PyCFunction)__pyx_pf_6pandas_3lib_11IndexEngine_2get_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_11IndexEngine_2get_value)},
  {__Pyx_NAMESTR("set_value"), (PyCFunction)__pyx_pf_6pandas_3lib_11IndexEngine_3set_value, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_11IndexEngine_3set_value)},
  {__Pyx_NAMESTR("get_loc"), (PyCFunction)__pyx_pf_6pandas_3lib_11IndexEngine_4get_loc, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pf_6pandas_3lib_11IndexEngine_5_call_monotonic, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("clear_mapping"), (PyCFunction)__pyx_pf_6pandas_3lib_11IndexEngine_6clear_mapping, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_11IndexEngine_7get_indexer, METH_O, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pandas_3lib_IndexEngine[] = {
  {(char *)"is_unique", __pyx_getprop_6pandas_3lib_11IndexEngine_is_unique, 0, 0, 0},
  {(char *)"is_monotonic", __pyx_getprop_6pandas_3lib_11IndexEngine_is_monotonic, 0, 0, 0},
  {(char *)"vgetter", __pyx_getprop_6pandas_3lib_11IndexEngine_vgetter, 0, 0, 0},
  {(char *)"mapping", __pyx_getprop_6pandas_3lib_11IndexEngine_mapping, 0, 0, 0},
  {(char *)"over_size_threshold", __pyx_getprop_6pandas_3lib_11IndexEngine_over_size_threshold, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_IndexEngine = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_IndexEngine = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pf_6pandas_3lib_11IndexEngine_1__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_IndexEngine = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_IndexEngine = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_IndexEngine = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.IndexEngine"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_IndexEngine), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_IndexEngine, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_IndexEngine, /*tp_as_number*/
  &__pyx_tp_as_sequence_IndexEngine, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_IndexEngine, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_IndexEngine, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_IndexEngine, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_IndexEngine, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_IndexEngine, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pandas_3lib_IndexEngine, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pandas_3lib_11IndexEngine___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_IndexEngine, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_Int64Engine __pyx_vtable_6pandas_3lib_Int64Engine;

static PyObject *__pyx_tp_new_6pandas_3lib_Int64Engine(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Int64Engine *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_IndexEngine(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Int64Engine *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_3lib_IndexEngine*)__pyx_vtabptr_6pandas_3lib_Int64Engine;
  return o;
}

static PyMethodDef __pyx_methods_6pandas_3lib_Int64Engine[] = {
  {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pf_6pandas_3lib_11Int64Engine__call_monotonic, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_11Int64Engine_1get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_11Int64Engine_2get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Int64Engine = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Int64Engine = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Int64Engine = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Int64Engine = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Int64Engine = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Int64Engine"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Int64Engine), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_IndexEngine, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Int64Engine, /*tp_as_number*/
  &__pyx_tp_as_sequence_Int64Engine, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Int64Engine, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Int64Engine, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_IndexEngine, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_IndexEngine, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Int64Engine, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Int64Engine, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_Float64Engine __pyx_vtable_6pandas_3lib_Float64Engine;

static PyObject *__pyx_tp_new_6pandas_3lib_Float64Engine(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_Float64Engine *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_IndexEngine(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_Float64Engine *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_3lib_IndexEngine*)__pyx_vtabptr_6pandas_3lib_Float64Engine;
  return o;
}

static PyMethodDef __pyx_methods_6pandas_3lib_Float64Engine[] = {
  {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pf_6pandas_3lib_13Float64Engine__call_monotonic, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_13Float64Engine_1get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_13Float64Engine_2get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Float64Engine = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Float64Engine = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Float64Engine = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Float64Engine = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_Float64Engine = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.Float64Engine"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_Float64Engine), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_IndexEngine, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Float64Engine, /*tp_as_number*/
  &__pyx_tp_as_sequence_Float64Engine, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Float64Engine, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Float64Engine, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_IndexEngine, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_IndexEngine, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_Float64Engine, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_Float64Engine, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_ObjectEngine __pyx_vtable_6pandas_3lib_ObjectEngine;

static PyObject *__pyx_tp_new_6pandas_3lib_ObjectEngine(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_ObjectEngine *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_IndexEngine(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_ObjectEngine *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_3lib_IndexEngine*)__pyx_vtabptr_6pandas_3lib_ObjectEngine;
  return o;
}

static PyMethodDef __pyx_methods_6pandas_3lib_ObjectEngine[] = {
  {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pf_6pandas_3lib_12ObjectEngine__call_monotonic, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_12ObjectEngine_1get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_12ObjectEngine_2get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ObjectEngine = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_ObjectEngine = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ObjectEngine = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ObjectEngine = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_ObjectEngine = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.ObjectEngine"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_ObjectEngine), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_IndexEngine, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_ObjectEngine, /*tp_as_number*/
  &__pyx_tp_as_sequence_ObjectEngine, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ObjectEngine, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_ObjectEngine, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_IndexEngine, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_IndexEngine, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_ObjectEngine, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_ObjectEngine, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6pandas_3lib_DatetimeEngine __pyx_vtable_6pandas_3lib_DatetimeEngine;

static PyObject *__pyx_tp_new_6pandas_3lib_DatetimeEngine(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib_DatetimeEngine *p;
  PyObject *o = __pyx_tp_new_6pandas_3lib_IndexEngine(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib_DatetimeEngine *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6pandas_3lib_IndexEngine*)__pyx_vtabptr_6pandas_3lib_DatetimeEngine;
  return o;
}

static PyMethodDef __pyx_methods_6pandas_3lib_DatetimeEngine[] = {
  {__Pyx_NAMESTR("_call_monotonic"), (PyCFunction)__pyx_pf_6pandas_3lib_14DatetimeEngine_1_call_monotonic, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_loc"), (PyCFunction)__pyx_pf_6pandas_3lib_14DatetimeEngine_2get_loc, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_14DatetimeEngine_3get_indexer, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_pad_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_14DatetimeEngine_4get_pad_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_backfill_indexer"), (PyCFunction)__pyx_pf_6pandas_3lib_14DatetimeEngine_5get_backfill_indexer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_DatetimeEngine = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_DatetimeEngine = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pf_6pandas_3lib_14DatetimeEngine___contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_DatetimeEngine = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_DatetimeEngine = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib_DatetimeEngine = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.DatetimeEngine"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib_DatetimeEngine), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib_IndexEngine, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_DatetimeEngine, /*tp_as_number*/
  &__pyx_tp_as_sequence_DatetimeEngine, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_DatetimeEngine, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_DatetimeEngine, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib_IndexEngine, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib_IndexEngine, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib_DatetimeEngine, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib_DatetimeEngine, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct__try_parse_dates(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *)o);
  p->__pyx_v_datetime = 0;
  p->__pyx_v_dayfirst = 0;
  p->__pyx_v_parse = 0;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct__try_parse_dates(PyObject *o) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *)o;
  Py_XDECREF(p->__pyx_v_datetime);
  Py_XDECREF(p->__pyx_v_dayfirst);
  Py_XDECREF(p->__pyx_v_parse);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct__try_parse_dates(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *)o;
  if (p->__pyx_v_datetime) {
    e = (*v)(p->__pyx_v_datetime, a); if (e) return e;
  }
  if (p->__pyx_v_dayfirst) {
    e = (*v)(p->__pyx_v_dayfirst, a); if (e) return e;
  }
  if (p->__pyx_v_parse) {
    e = (*v)(p->__pyx_v_parse, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct__try_parse_dates(PyObject *o) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_datetime);
  p->__pyx_v_datetime = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_dayfirst);
  p->__pyx_v_dayfirst = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_parse);
  p->__pyx_v_parse = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6pandas_3lib___pyx_scope_struct__try_parse_dates[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct__try_parse_dates = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct__try_parse_dates = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct__try_parse_dates = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct__try_parse_dates = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct__try_parse_dates = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct__try_parse_dates"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct__try_parse_dates), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct__try_parse_dates, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct__try_parse_dates, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct__try_parse_dates, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct__try_parse_dates, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct__try_parse_dates, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct__try_parse_dates, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib___pyx_scope_struct__try_parse_dates, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib___pyx_scope_struct__try_parse_dates, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib___pyx_scope_struct__try_parse_dates, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyObject *__pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)o);
  p->__pyx_v_date = 0;
  p->__pyx_v_dayfirst = 0;
  p->__pyx_v_parse = 0;
  p->__pyx_v_time = 0;
  return o;
}

static void __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time(PyObject *o) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)o;
  Py_XDECREF(p->__pyx_v_date);
  Py_XDECREF(p->__pyx_v_dayfirst);
  Py_XDECREF(p->__pyx_v_parse);
  Py_XDECREF(p->__pyx_v_time);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)o;
  if (p->__pyx_v_date) {
    e = (*v)(p->__pyx_v_date, a); if (e) return e;
  }
  if (p->__pyx_v_dayfirst) {
    e = (*v)(p->__pyx_v_dayfirst, a); if (e) return e;
  }
  if (p->__pyx_v_parse) {
    e = (*v)(p->__pyx_v_parse, a); if (e) return e;
  }
  if (p->__pyx_v_time) {
    e = (*v)(p->__pyx_v_time, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time(PyObject *o) {
  struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *p = (struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_date);
  p->__pyx_v_date = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_dayfirst);
  p->__pyx_v_dayfirst = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_parse);
  p->__pyx_v_parse = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_time);
  p->__pyx_v_time = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1_try_parse_date_and_time = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_1_try_parse_date_and_time = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_1_try_parse_date_and_time = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1_try_parse_date_and_time = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pandas.lib.__pyx_scope_struct_1_try_parse_date_and_time"), /*tp_name*/
  sizeof(struct __pyx_obj_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number___pyx_scope_struct_1_try_parse_date_and_time, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_1_try_parse_date_and_time, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_1_try_parse_date_and_time, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_1_try_parse_date_and_time, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time, /*tp_traverse*/
  __pyx_tp_clear_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("map_indices_list"), (PyCFunction)__pyx_pf_6pandas_3lib_map_indices_list, METH_O, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_map_indices_list)},
  {__Pyx_NAMESTR("to_datetime"), (PyCFunction)__pyx_pf_6pandas_3lib_2to_datetime, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("to_timestamp"), (PyCFunction)__pyx_pf_6pandas_3lib_3to_timestamp, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("checknull"), (PyCFunction)__pyx_pf_6pandas_3lib_6checknull, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_value_box"), (PyCFunction)__pyx_pf_6pandas_3lib_33get_value_box, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("convert_to_tsobject"), (PyCFunction)__pyx_pf_6pandas_3lib_37convert_to_tsobject, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pandas_3lib_37convert_to_tsobject)},
  {__Pyx_NAMESTR("_unbox_utcoffsets"), (PyCFunction)__pyx_pf_6pandas_3lib_46_unbox_utcoffsets, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("groupby_indices_naive"), (PyCFunction)__pyx_pf_6pandas_3lib_59groupby_indices_naive, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("convert_scalar"), (PyCFunction)__pyx_pf_6pandas_3lib_163convert_scalar, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("lib"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_n_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 1},
  {&__pyx_kp_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 0},
  {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0},
  {&__pyx_kp_s_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 1, 0},
  {&__pyx_n_s_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 1, 1},
  {&__pyx_kp_s_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 0},
  {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
  {&__pyx_n_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 1},
  {&__pyx_kp_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 0},
  {&__pyx_kp_s_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 1, 0},
  {&__pyx_kp_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 0},
  {&__pyx_kp_s_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 0, 1, 0},
  {&__pyx_kp_s_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 1, 0},
  {&__pyx_kp_s_161, __pyx_k_161, sizeof(__pyx_k_161), 0, 0, 1, 0},
  {&__pyx_n_s_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 0, 1, 1},
  {&__pyx_kp_s_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 1, 0},
  {&__pyx_kp_s_166, __pyx_k_166, sizeof(__pyx_k_166), 0, 0, 1, 0},
  {&__pyx_kp_s_168, __pyx_k_168, sizeof(__pyx_k_168), 0, 0, 1, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_170, __pyx_k_170, sizeof(__pyx_k_170), 0, 0, 1, 0},
  {&__pyx_kp_s_173, __pyx_k_173, sizeof(__pyx_k_173), 0, 0, 1, 0},
  {&__pyx_n_s_179, __pyx_k_179, sizeof(__pyx_k_179), 0, 0, 1, 1},
  {&__pyx_kp_s_187, __pyx_k_187, sizeof(__pyx_k_187), 0, 0, 1, 0},
  {&__pyx_kp_u_189, __pyx_k_189, sizeof(__pyx_k_189), 0, 1, 0, 0},
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
  {&__pyx_kp_u_191, __pyx_k_191, sizeof(__pyx_k_191), 0, 1, 0, 0},
  {&__pyx_kp_u_193, __pyx_k_193, sizeof(__pyx_k_193), 0, 1, 0, 0},
  {&__pyx_kp_u_195, __pyx_k_195, sizeof(__pyx_k_195), 0, 1, 0, 0},
  {&__pyx_kp_u_196, __pyx_k_196, sizeof(__pyx_k_196), 0, 1, 0, 0},
  {&__pyx_kp_u_199, __pyx_k_199, sizeof(__pyx_k_199), 0, 1, 0, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_n_s_203, __pyx_k_203, sizeof(__pyx_k_203), 0, 0, 1, 1},
  {&__pyx_n_s_204, __pyx_k_204, sizeof(__pyx_k_204), 0, 0, 1, 1},
  {&__pyx_n_s_205, __pyx_k_205, sizeof(__pyx_k_205), 0, 0, 1, 1},
  {&__pyx_n_s_206, __pyx_k_206, sizeof(__pyx_k_206), 0, 0, 1, 1},
  {&__pyx_n_s_207, __pyx_k_207, sizeof(__pyx_k_207), 0, 0, 1, 1},
  {&__pyx_n_s_208, __pyx_k_208, sizeof(__pyx_k_208), 0, 0, 1, 1},
  {&__pyx_n_s_209, __pyx_k_209, sizeof(__pyx_k_209), 0, 0, 1, 1},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_n_s_210, __pyx_k_210, sizeof(__pyx_k_210), 0, 0, 1, 1},
  {&__pyx_n_s_211, __pyx_k_211, sizeof(__pyx_k_211), 0, 0, 1, 1},
  {&__pyx_n_s_212, __pyx_k_212, sizeof(__pyx_k_212), 0, 0, 1, 1},
  {&__pyx_n_s_213, __pyx_k_213, sizeof(__pyx_k_213), 0, 0, 1, 1},
  {&__pyx_n_s_214, __pyx_k_214, sizeof(__pyx_k_214), 0, 0, 1, 1},
  {&__pyx_n_s_215, __pyx_k_215, sizeof(__pyx_k_215), 0, 0, 1, 1},
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
  {&__pyx_n_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 1},
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
  {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
  {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
  {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
  {&__pyx_n_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 1},
  {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
  {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
  {&__pyx_n_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 1},
  {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0},
  {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
  {&__pyx_n_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 1},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 0},
  {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
  {&__pyx_n_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 1},
  {&__pyx_n_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 1},
  {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
  {&__pyx_kp_s_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 1, 0},
  {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
  {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
  {&__pyx_n_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 1},
  {&__pyx_kp_s_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 1, 0},
  {&__pyx_kp_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 0},
  {&__pyx_n_s__AmbiguousTimeError, __pyx_k__AmbiguousTimeError, sizeof(__pyx_k__AmbiguousTimeError), 0, 0, 1, 1},
  {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1},
  {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1},
  {&__pyx_n_s__D, __pyx_k__D, sizeof(__pyx_k__D), 0, 0, 1, 1},
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
  {&__pyx_n_s__F, __pyx_k__F, sizeof(__pyx_k__F), 0, 0, 1, 1},
  {&__pyx_n_s__False, __pyx_k__False, sizeof(__pyx_k__False), 0, 0, 1, 1},
  {&__pyx_n_s__ImportError, __pyx_k__ImportError, sizeof(__pyx_k__ImportError), 0, 0, 1, 1},
  {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
  {&__pyx_n_s__Infinity, __pyx_k__Infinity, sizeof(__pyx_k__Infinity), 0, 0, 1, 1},
  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
  {&__pyx_n_s__M, __pyx_k__M, sizeof(__pyx_k__M), 0, 0, 1, 1},
  {&__pyx_n_s__N, __pyx_k__N, sizeof(__pyx_k__N), 0, 0, 1, 1},
  {&__pyx_n_s__NIL, __pyx_k__NIL, sizeof(__pyx_k__NIL), 0, 0, 1, 1},
  {&__pyx_n_s__NINF, __pyx_k__NINF, sizeof(__pyx_k__NINF), 0, 0, 1, 1},
  {&__pyx_n_s__NaN, __pyx_k__NaN, sizeof(__pyx_k__NaN), 0, 0, 1, 1},
  {&__pyx_n_s__NaT, __pyx_k__NaT, sizeof(__pyx_k__NaT), 0, 0, 1, 1},
  {&__pyx_n_s__NaTType, __pyx_k__NaTType, sizeof(__pyx_k__NaTType), 0, 0, 1, 1},
  {&__pyx_n_s__NameError, __pyx_k__NameError, sizeof(__pyx_k__NameError), 0, 0, 1, 1},
  {&__pyx_n_s__NegInfinity, __pyx_k__NegInfinity, sizeof(__pyx_k__NegInfinity), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s__O, __pyx_k__O, sizeof(__pyx_k__O), 0, 0, 1, 1},
  {&__pyx_n_s__ONAN, __pyx_k__ONAN, sizeof(__pyx_k__ONAN), 0, 0, 1, 1},
  {&__pyx_n_s__Period, __pyx_k__Period, sizeof(__pyx_k__Period), 0, 0, 1, 1},
  {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s__T, __pyx_k__T, sizeof(__pyx_k__T), 0, 0, 1, 1},
  {&__pyx_n_s__Timestamp, __pyx_k__Timestamp, sizeof(__pyx_k__Timestamp), 0, 0, 1, 1},
  {&__pyx_n_s__True, __pyx_k__True, sizeof(__pyx_k__True), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__UTC, __pyx_k__UTC, sizeof(__pyx_k__UTC), 0, 0, 1, 1},
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
  {&__pyx_n_s__Y, __pyx_k__Y, sizeof(__pyx_k__Y), 0, 0, 1, 1},
  {&__pyx_n_s___TYPE_MAP, __pyx_k___TYPE_MAP, sizeof(__pyx_k___TYPE_MAP), 0, 0, 1, 1},
  {&__pyx_n_s____add__, __pyx_k____add__, sizeof(__pyx_k____add__), 0, 0, 1, 1},
  {&__pyx_n_s____cmp__, __pyx_k____cmp__, sizeof(__pyx_k____cmp__), 0, 0, 1, 1},
  {&__pyx_n_s____eq__, __pyx_k____eq__, sizeof(__pyx_k____eq__), 0, 0, 1, 1},
  {&__pyx_n_s____ge__, __pyx_k____ge__, sizeof(__pyx_k____ge__), 0, 0, 1, 1},
  {&__pyx_n_s____gt__, __pyx_k____gt__, sizeof(__pyx_k____gt__), 0, 0, 1, 1},
  {&__pyx_n_s____hash__, __pyx_k____hash__, sizeof(__pyx_k____hash__), 0, 0, 1, 1},
  {&__pyx_n_s____le__, __pyx_k____le__, sizeof(__pyx_k____le__), 0, 0, 1, 1},
  {&__pyx_n_s____lt__, __pyx_k____lt__, sizeof(__pyx_k____lt__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____mul__, __pyx_k____mul__, sizeof(__pyx_k____mul__), 0, 0, 1, 1},
  {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
  {&__pyx_n_s____ne__, __pyx_k____ne__, sizeof(__pyx_k____ne__), 0, 0, 1, 1},
  {&__pyx_n_s____new__, __pyx_k____new__, sizeof(__pyx_k____new__), 0, 0, 1, 1},
  {&__pyx_n_s____reduce__, __pyx_k____reduce__, sizeof(__pyx_k____reduce__), 0, 0, 1, 1},
  {&__pyx_n_s____repr__, __pyx_k____repr__, sizeof(__pyx_k____repr__), 0, 0, 1, 1},
  {&__pyx_n_s____setstate__, __pyx_k____setstate__, sizeof(__pyx_k____setstate__), 0, 0, 1, 1},
  {&__pyx_n_s____sub__, __pyx_k____sub__, sizeof(__pyx_k____sub__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___algos, __pyx_k___algos, sizeof(__pyx_k___algos), 0, 0, 1, 1},
  {&__pyx_n_s___backfill_functions, __pyx_k___backfill_functions, sizeof(__pyx_k___backfill_functions), 0, 0, 1, 1},
  {&__pyx_n_s___big_join_sorter, __pyx_k___big_join_sorter, sizeof(__pyx_k___big_join_sorter), 0, 0, 1, 1},
  {&__pyx_n_s___cache, __pyx_k___cache, sizeof(__pyx_k___cache), 0, 0, 1, 1},
  {&__pyx_n_s___call_monotonic, __pyx_k___call_monotonic, sizeof(__pyx_k___call_monotonic), 0, 0, 1, 1},
  {&__pyx_n_s___check_dummy, __pyx_k___check_dummy, sizeof(__pyx_k___check_dummy), 0, 0, 1, 1},
  {&__pyx_n_s___check_minp, __pyx_k___check_minp, sizeof(__pyx_k___check_minp), 0, 0, 1, 1},
  {&__pyx_n_s___data, __pyx_k___data, sizeof(__pyx_k___data), 0, 0, 1, 1},
  {&__pyx_n_s___engine, __pyx_k___engine, sizeof(__pyx_k___engine), 0, 0, 1, 1},
  {&__pyx_n_s___ensure_index, __pyx_k___ensure_index, sizeof(__pyx_k___ensure_index), 0, 0, 1, 1},
  {&__pyx_n_s___get_deltas, __pyx_k___get_deltas, sizeof(__pyx_k___get_deltas), 0, 0, 1, 1},
  {&__pyx_n_s___get_field, __pyx_k___get_field, sizeof(__pyx_k___get_field), 0, 0, 1, 1},
  {&__pyx_n_s___get_result_array, __pyx_k___get_result_array, sizeof(__pyx_k___get_result_array), 0, 0, 1, 1},
  {&__pyx_n_s___get_result_indexer, __pyx_k___get_result_indexer, sizeof(__pyx_k___get_result_indexer), 0, 0, 1, 1},
  {&__pyx_n_s___get_transitions, __pyx_k___get_transitions, sizeof(__pyx_k___get_transitions), 0, 0, 1, 1},
  {&__pyx_n_s___index, __pyx_k___index, sizeof(__pyx_k___index), 0, 0, 1, 1},
  {&__pyx_n_s___pad_functions, __pyx_k___pad_functions, sizeof(__pyx_k___pad_functions), 0, 0, 1, 1},
  {&__pyx_n_s___repr_base, __pyx_k___repr_base, sizeof(__pyx_k___repr_base), 0, 0, 1, 1},
  {&__pyx_n_s___return_false, __pyx_k___return_false, sizeof(__pyx_k___return_false), 0, 0, 1, 1},
  {&__pyx_n_s___return_true, __pyx_k___return_true, sizeof(__pyx_k___return_true), 0, 0, 1, 1},
  {&__pyx_n_s___set_axis, __pyx_k___set_axis, sizeof(__pyx_k___set_axis), 0, 0, 1, 1},
  {&__pyx_n_s___transition_info, __pyx_k___transition_info, sizeof(__pyx_k___transition_info), 0, 0, 1, 1},
  {&__pyx_n_s___tzinfos, __pyx_k___tzinfos, sizeof(__pyx_k___tzinfos), 0, 0, 1, 1},
  {&__pyx_n_s___utcoffset, __pyx_k___utcoffset, sizeof(__pyx_k___utcoffset), 0, 0, 1, 1},
  {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
  {&__pyx_n_s__adjust, __pyx_k__adjust, sizeof(__pyx_k__adjust), 0, 0, 1, 1},
  {&__pyx_n_s__advance, __pyx_k__advance, sizeof(__pyx_k__advance), 0, 0, 1, 1},
  {&__pyx_n_s__apply, __pyx_k__apply, sizeof(__pyx_k__apply), 0, 0, 1, 1},
  {&__pyx_n_s__apply_offset, __pyx_k__apply_offset, sizeof(__pyx_k__apply_offset), 0, 0, 1, 1},
  {&__pyx_n_s__arange, __pyx_k__arange, sizeof(__pyx_k__arange), 0, 0, 1, 1},
  {&__pyx_n_s__arg, __pyx_k__arg, sizeof(__pyx_k__arg), 0, 0, 1, 1},
  {&__pyx_n_s__args, __pyx_k__args, sizeof(__pyx_k__args), 0, 0, 1, 1},
  {&__pyx_n_s__argsort, __pyx_k__argsort, sizeof(__pyx_k__argsort), 0, 0, 1, 1},
  {&__pyx_n_s__arr, __pyx_k__arr, sizeof(__pyx_k__arr), 0, 0, 1, 1},
  {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
  {&__pyx_n_s__array_to_datetime, __pyx_k__array_to_datetime, sizeof(__pyx_k__array_to_datetime), 0, 0, 1, 1},
  {&__pyx_n_s__array_to_timestamp, __pyx_k__array_to_timestamp, sizeof(__pyx_k__array_to_timestamp), 0, 0, 1, 1},
  {&__pyx_n_s__arrmap, __pyx_k__arrmap, sizeof(__pyx_k__arrmap), 0, 0, 1, 1},
  {&__pyx_n_s__asarray, __pyx_k__asarray, sizeof(__pyx_k__asarray), 0, 0, 1, 1},
  {&__pyx_n_s__ascending, __pyx_k__ascending, sizeof(__pyx_k__ascending), 0, 0, 1, 1},
  {&__pyx_n_s__asm8, __pyx_k__asm8, sizeof(__pyx_k__asm8), 0, 0, 1, 1},
  {&__pyx_n_s__astype, __pyx_k__astype, sizeof(__pyx_k__astype), 0, 0, 1, 1},
  {&__pyx_n_s__average, __pyx_k__average, sizeof(__pyx_k__average), 0, 0, 1, 1},
  {&__pyx_n_s__axes, __pyx_k__axes, sizeof(__pyx_k__axes), 0, 0, 1, 1},
  {&__pyx_n_s__axis, __pyx_k__axis, sizeof(__pyx_k__axis), 0, 0, 1, 1},
  {&__pyx_n_s__backfill_float64, __pyx_k__backfill_float64, sizeof(__pyx_k__backfill_float64), 0, 0, 1, 1},
  {&__pyx_n_s__backfill_int64, __pyx_k__backfill_int64, sizeof(__pyx_k__backfill_int64), 0, 0, 1, 1},
  {&__pyx_n_s__backfill_object, __pyx_k__backfill_object, sizeof(__pyx_k__backfill_object), 0, 0, 1, 1},
  {&__pyx_n_s__basestring, __pyx_k__basestring, sizeof(__pyx_k__basestring), 0, 0, 1, 1},
  {&__pyx_n_s__binner, __pyx_k__binner, sizeof(__pyx_k__binner), 0, 0, 1, 1},
  {&__pyx_n_s__bins, __pyx_k__bins, sizeof(__pyx_k__bins), 0, 0, 1, 1},
  {&__pyx_n_s__bool_, __pyx_k__bool_, sizeof(__pyx_k__bool_), 0, 0, 1, 1},
  {&__pyx_n_s__boolean, __pyx_k__boolean, sizeof(__pyx_k__boolean), 0, 0, 1, 1},
  {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1},
  {&__pyx_n_s__build_field_sarray, __pyx_k__build_field_sarray, sizeof(__pyx_k__build_field_sarray), 0, 0, 1, 1},
  {&__pyx_n_s__c16, __pyx_k__c16, sizeof(__pyx_k__c16), 0, 0, 1, 1},
  {&__pyx_n_s__c_contiguous, __pyx_k__c_contiguous, sizeof(__pyx_k__c_contiguous), 0, 0, 1, 1},
  {&__pyx_n_s__cast_to_nanoseconds, __pyx_k__cast_to_nanoseconds, sizeof(__pyx_k__cast_to_nanoseconds), 0, 0, 1, 1},
  {&__pyx_n_s__cleanup, __pyx_k__cleanup, sizeof(__pyx_k__cleanup), 0, 0, 1, 1},
  {&__pyx_n_s__clear_mapping, __pyx_k__clear_mapping, sizeof(__pyx_k__clear_mapping), 0, 0, 1, 1},
  {&__pyx_n_s__closed, __pyx_k__closed, sizeof(__pyx_k__closed), 0, 0, 1, 1},
  {&__pyx_n_s__cls, __pyx_k__cls, sizeof(__pyx_k__cls), 0, 0, 1, 1},
  {&__pyx_n_s__columns, __pyx_k__columns, sizeof(__pyx_k__columns), 0, 0, 1, 1},
  {&__pyx_n_s__com, __pyx_k__com, sizeof(__pyx_k__com), 0, 0, 1, 1},
  {&__pyx_n_s__complex, __pyx_k__complex, sizeof(__pyx_k__complex), 0, 0, 1, 1},
  {&__pyx_n_s__complex128, __pyx_k__complex128, sizeof(__pyx_k__complex128), 0, 0, 1, 1},
  {&__pyx_n_s__complex256, __pyx_k__complex256, sizeof(__pyx_k__complex256), 0, 0, 1, 1},
  {&__pyx_n_s__contiguous, __pyx_k__contiguous, sizeof(__pyx_k__contiguous), 0, 0, 1, 1},
  {&__pyx_n_s__convert, __pyx_k__convert, sizeof(__pyx_k__convert), 0, 0, 1, 1},
  {&__pyx_n_s__convert_datetime, __pyx_k__convert_datetime, sizeof(__pyx_k__convert_datetime), 0, 0, 1, 1},
  {&__pyx_n_s__convert_empty, __pyx_k__convert_empty, sizeof(__pyx_k__convert_empty), 0, 0, 1, 1},
  {&__pyx_n_s__convert_sql_column, __pyx_k__convert_sql_column, sizeof(__pyx_k__convert_sql_column), 0, 0, 1, 1},
  {&__pyx_n_s__convert_timestamps, __pyx_k__convert_timestamps, sizeof(__pyx_k__convert_timestamps), 0, 0, 1, 1},
  {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
  {&__pyx_n_s__count_level_1d, __pyx_k__count_level_1d, sizeof(__pyx_k__count_level_1d), 0, 0, 1, 1},
  {&__pyx_n_s__count_level_2d, __pyx_k__count_level_2d, sizeof(__pyx_k__count_level_2d), 0, 0, 1, 1},
  {&__pyx_n_s__count_prior, __pyx_k__count_prior, sizeof(__pyx_k__count_prior), 0, 0, 1, 1},
  {&__pyx_n_s__counts, __pyx_k__counts, sizeof(__pyx_k__counts), 0, 0, 1, 1},
  {&__pyx_n_s__cov, __pyx_k__cov, sizeof(__pyx_k__cov), 0, 0, 1, 1},
  {&__pyx_n_s__date, __pyx_k__date, sizeof(__pyx_k__date), 0, 0, 1, 1},
  {&__pyx_n_s__date_normalize, __pyx_k__date_normalize, sizeof(__pyx_k__date_normalize), 0, 0, 1, 1},
  {&__pyx_n_s__date_parser, __pyx_k__date_parser, sizeof(__pyx_k__date_parser), 0, 0, 1, 1},
  {&__pyx_n_s__dates, __pyx_k__dates, sizeof(__pyx_k__dates), 0, 0, 1, 1},
  {&__pyx_n_s__dates_normalized, __pyx_k__dates_normalized, sizeof(__pyx_k__dates_normalized), 0, 0, 1, 1},
  {&__pyx_n_s__datetime, __pyx_k__datetime, sizeof(__pyx_k__datetime), 0, 0, 1, 1},
  {&__pyx_n_s__datetime64, __pyx_k__datetime64, sizeof(__pyx_k__datetime64), 0, 0, 1, 1},
  {&__pyx_n_s__day, __pyx_k__day, sizeof(__pyx_k__day), 0, 0, 1, 1},
  {&__pyx_n_s__dayfirst, __pyx_k__dayfirst, sizeof(__pyx_k__dayfirst), 0, 0, 1, 1},
  {&__pyx_n_s__dayofweek, __pyx_k__dayofweek, sizeof(__pyx_k__dayofweek), 0, 0, 1, 1},
  {&__pyx_n_s__dayofyear, __pyx_k__dayofyear, sizeof(__pyx_k__dayofyear), 0, 0, 1, 1},
  {&__pyx_n_s__days, __pyx_k__days, sizeof(__pyx_k__days), 0, 0, 1, 1},
  {&__pyx_n_s__ddof, __pyx_k__ddof, sizeof(__pyx_k__ddof), 0, 0, 1, 1},
  {&__pyx_n_s__default, __pyx_k__default, sizeof(__pyx_k__default), 0, 0, 1, 1},
  {&__pyx_n_s__delta, __pyx_k__delta, sizeof(__pyx_k__delta), 0, 0, 1, 1},
  {&__pyx_n_s__destroy, __pyx_k__destroy, sizeof(__pyx_k__destroy), 0, 0, 1, 1},
  {&__pyx_n_s__dicts, __pyx_k__dicts, sizeof(__pyx_k__dicts), 0, 0, 1, 1},
  {&__pyx_n_s__dicts_to_array, __pyx_k__dicts_to_array, sizeof(__pyx_k__dicts_to_array), 0, 0, 1, 1},
  {&__pyx_n_s__dow, __pyx_k__dow, sizeof(__pyx_k__dow), 0, 0, 1, 1},
  {&__pyx_n_s__doy, __pyx_k__doy, sizeof(__pyx_k__doy), 0, 0, 1, 1},
  {&__pyx_n_s__dtindex, __pyx_k__dtindex, sizeof(__pyx_k__dtindex), 0, 0, 1, 1},
  {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
  {&__pyx_n_s__dummy, __pyx_k__dummy, sizeof(__pyx_k__dummy), 0, 0, 1, 1},
  {&__pyx_n_s__duplicated, __pyx_k__duplicated, sizeof(__pyx_k__duplicated), 0, 0, 1, 1},
  {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1},
  {&__pyx_n_s__empty_like, __pyx_k__empty_like, sizeof(__pyx_k__empty_like), 0, 0, 1, 1},
  {&__pyx_n_s__eq, __pyx_k__eq, sizeof(__pyx_k__eq), 0, 0, 1, 1},
  {&__pyx_n_s__ewma, __pyx_k__ewma, sizeof(__pyx_k__ewma), 0, 0, 1, 1},
  {&__pyx_n_s__expected_size, __pyx_k__expected_size, sizeof(__pyx_k__expected_size), 0, 0, 1, 1},
  {&__pyx_n_s__extract_ordinals, __pyx_k__extract_ordinals, sizeof(__pyx_k__extract_ordinals), 0, 0, 1, 1},
  {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
  {&__pyx_n_s__f8, __pyx_k__f8, sizeof(__pyx_k__f8), 0, 0, 1, 1},
  {&__pyx_n_s__f_contiguous, __pyx_k__f_contiguous, sizeof(__pyx_k__f_contiguous), 0, 0, 1, 1},
  {&__pyx_n_s__fast_multiget, __pyx_k__fast_multiget, sizeof(__pyx_k__fast_multiget), 0, 0, 1, 1},
  {&__pyx_n_s__fast_unique, __pyx_k__fast_unique, sizeof(__pyx_k__fast_unique), 0, 0, 1, 1},
  {&__pyx_n_s__fast_zip, __pyx_k__fast_zip, sizeof(__pyx_k__fast_zip), 0, 0, 1, 1},
  {&__pyx_n_s__fast_zip_fillna, __pyx_k__fast_zip_fillna, sizeof(__pyx_k__fast_zip_fillna), 0, 0, 1, 1},
  {&__pyx_n_s__ffill_by_group, __pyx_k__ffill_by_group, sizeof(__pyx_k__ffill_by_group), 0, 0, 1, 1},
  {&__pyx_n_s__ffill_indexer, __pyx_k__ffill_indexer, sizeof(__pyx_k__ffill_indexer), 0, 0, 1, 1},
  {&__pyx_n_s__fget, __pyx_k__fget, sizeof(__pyx_k__fget), 0, 0, 1, 1},
  {&__pyx_n_s__field, __pyx_k__field, sizeof(__pyx_k__field), 0, 0, 1, 1},
  {&__pyx_n_s__fields, __pyx_k__fields, sizeof(__pyx_k__fields), 0, 0, 1, 1},
  {&__pyx_n_s__fill, __pyx_k__fill, sizeof(__pyx_k__fill), 0, 0, 1, 1},
  {&__pyx_n_s__fill_value, __pyx_k__fill_value, sizeof(__pyx_k__fill_value), 0, 0, 1, 1},
  {&__pyx_n_s__first, __pyx_k__first, sizeof(__pyx_k__first), 0, 0, 1, 1},
  {&__pyx_n_s__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 0, 0, 1, 1},
  {&__pyx_n_s__flat, __pyx_k__flat, sizeof(__pyx_k__flat), 0, 0, 1, 1},
  {&__pyx_n_s__float128, __pyx_k__float128, sizeof(__pyx_k__float128), 0, 0, 1, 1},
  {&__pyx_n_s__float16, __pyx_k__float16, sizeof(__pyx_k__float16), 0, 0, 1, 1},
  {&__pyx_n_s__float32, __pyx_k__float32, sizeof(__pyx_k__float32), 0, 0, 1, 1},
  {&__pyx_n_s__float64, __pyx_k__float64, sizeof(__pyx_k__float64), 0, 0, 1, 1},
  {&__pyx_n_s__floating, __pyx_k__floating, sizeof(__pyx_k__floating), 0, 0, 1, 1},
  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
  {&__pyx_n_s__freq, __pyx_k__freq, sizeof(__pyx_k__freq), 0, 0, 1, 1},
  {&__pyx_n_s__freqstr, __pyx_k__freqstr, sizeof(__pyx_k__freqstr), 0, 0, 1, 1},
  {&__pyx_n_s__fromtimestamp, __pyx_k__fromtimestamp, sizeof(__pyx_k__fromtimestamp), 0, 0, 1, 1},
  {&__pyx_n_s__full_outer_join, __pyx_k__full_outer_join, sizeof(__pyx_k__full_outer_join), 0, 0, 1, 1},
  {&__pyx_n_s__func, __pyx_k__func, sizeof(__pyx_k__func), 0, 0, 1, 1},
  {&__pyx_n_s__ge, __pyx_k__ge, sizeof(__pyx_k__ge), 0, 0, 1, 1},
  {&__pyx_n_s__generate_bins_dt64, __pyx_k__generate_bins_dt64, sizeof(__pyx_k__generate_bins_dt64), 0, 0, 1, 1},
  {&__pyx_n_s__generate_slices, __pyx_k__generate_slices, sizeof(__pyx_k__generate_slices), 0, 0, 1, 1},
  {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
  {&__pyx_n_s__get_date_field, __pyx_k__get_date_field, sizeof(__pyx_k__get_date_field), 0, 0, 1, 1},
  {&__pyx_n_s__get_item, __pyx_k__get_item, sizeof(__pyx_k__get_item), 0, 0, 1, 1},
  {&__pyx_n_s__get_labels, __pyx_k__get_labels, sizeof(__pyx_k__get_labels), 0, 0, 1, 1},
  {&__pyx_n_s__get_loc, __pyx_k__get_loc, sizeof(__pyx_k__get_loc), 0, 0, 1, 1},
  {&__pyx_n_s__get_result, __pyx_k__get_result, sizeof(__pyx_k__get_result), 0, 0, 1, 1},
  {&__pyx_n_s__get_reverse_indexer, __pyx_k__get_reverse_indexer, sizeof(__pyx_k__get_reverse_indexer), 0, 0, 1, 1},
  {&__pyx_n_s__get_time_micros, __pyx_k__get_time_micros, sizeof(__pyx_k__get_time_micros), 0, 0, 1, 1},
  {&__pyx_n_s__get_unique_labels, __pyx_k__get_unique_labels, sizeof(__pyx_k__get_unique_labels), 0, 0, 1, 1},
  {&__pyx_n_s__get_value, __pyx_k__get_value, sizeof(__pyx_k__get_value), 0, 0, 1, 1},
  {&__pyx_n_s__get_value_at, __pyx_k__get_value_at, sizeof(__pyx_k__get_value_at), 0, 0, 1, 1},
  {&__pyx_n_s__group_add, __pyx_k__group_add, sizeof(__pyx_k__group_add), 0, 0, 1, 1},
  {&__pyx_n_s__group_add_bin, __pyx_k__group_add_bin, sizeof(__pyx_k__group_add_bin), 0, 0, 1, 1},
  {&__pyx_n_s__group_count, __pyx_k__group_count, sizeof(__pyx_k__group_count), 0, 0, 1, 1},
  {&__pyx_n_s__group_ids, __pyx_k__group_ids, sizeof(__pyx_k__group_ids), 0, 0, 1, 1},
  {&__pyx_n_s__group_labels, __pyx_k__group_labels, sizeof(__pyx_k__group_labels), 0, 0, 1, 1},
  {&__pyx_n_s__group_last, __pyx_k__group_last, sizeof(__pyx_k__group_last), 0, 0, 1, 1},
  {&__pyx_n_s__group_last_bin, __pyx_k__group_last_bin, sizeof(__pyx_k__group_last_bin), 0, 0, 1, 1},
  {&__pyx_n_s__group_max, __pyx_k__group_max, sizeof(__pyx_k__group_max), 0, 0, 1, 1},
  {&__pyx_n_s__group_max_bin, __pyx_k__group_max_bin, sizeof(__pyx_k__group_max_bin), 0, 0, 1, 1},
  {&__pyx_n_s__group_mean, __pyx_k__group_mean, sizeof(__pyx_k__group_mean), 0, 0, 1, 1},
  {&__pyx_n_s__group_mean_bin, __pyx_k__group_mean_bin, sizeof(__pyx_k__group_mean_bin), 0, 0, 1, 1},
  {&__pyx_n_s__group_median, __pyx_k__group_median, sizeof(__pyx_k__group_median), 0, 0, 1, 1},
  {&__pyx_n_s__group_min, __pyx_k__group_min, sizeof(__pyx_k__group_min), 0, 0, 1, 1},
  {&__pyx_n_s__group_min_bin, __pyx_k__group_min_bin, sizeof(__pyx_k__group_min_bin), 0, 0, 1, 1},
  {&__pyx_n_s__group_nth, __pyx_k__group_nth, sizeof(__pyx_k__group_nth), 0, 0, 1, 1},
  {&__pyx_n_s__group_nth_bin, __pyx_k__group_nth_bin, sizeof(__pyx_k__group_nth_bin), 0, 0, 1, 1},
  {&__pyx_n_s__group_ohlc, __pyx_k__group_ohlc, sizeof(__pyx_k__group_ohlc), 0, 0, 1, 1},
  {&__pyx_n_s__group_prod, __pyx_k__group_prod, sizeof(__pyx_k__group_prod), 0, 0, 1, 1},
  {&__pyx_n_s__group_prod_bin, __pyx_k__group_prod_bin, sizeof(__pyx_k__group_prod_bin), 0, 0, 1, 1},
  {&__pyx_n_s__group_var, __pyx_k__group_var, sizeof(__pyx_k__group_var), 0, 0, 1, 1},
  {&__pyx_n_s__group_var_bin, __pyx_k__group_var_bin, sizeof(__pyx_k__group_var_bin), 0, 0, 1, 1},
  {&__pyx_n_s__groupby_arrays, __pyx_k__groupby_arrays, sizeof(__pyx_k__groupby_arrays), 0, 0, 1, 1},
  {&__pyx_n_s__groupby_func, __pyx_k__groupby_func, sizeof(__pyx_k__groupby_func), 0, 0, 1, 1},
  {&__pyx_n_s__groupby_indices, __pyx_k__groupby_indices, sizeof(__pyx_k__groupby_indices), 0, 0, 1, 1},
  {&__pyx_n_s__groupsort_indexer, __pyx_k__groupsort_indexer, sizeof(__pyx_k__groupsort_indexer), 0, 0, 1, 1},
  {&__pyx_n_s__gt, __pyx_k__gt, sizeof(__pyx_k__gt), 0, 0, 1, 1},
  {&__pyx_n_s__h, __pyx_k__h, sizeof(__pyx_k__h), 0, 0, 1, 1},
  {&__pyx_n_s__has_infs_f4, __pyx_k__has_infs_f4, sizeof(__pyx_k__has_infs_f4), 0, 0, 1, 1},
  {&__pyx_n_s__has_infs_f8, __pyx_k__has_infs_f8, sizeof(__pyx_k__has_infs_f8), 0, 0, 1, 1},
  {&__pyx_n_s__have_pytz, __pyx_k__have_pytz, sizeof(__pyx_k__have_pytz), 0, 0, 1, 1},
  {&__pyx_n_s__hour, __pyx_k__hour, sizeof(__pyx_k__hour), 0, 0, 1, 1},
  {&__pyx_n_s__hours, __pyx_k__hours, sizeof(__pyx_k__hours), 0, 0, 1, 1},
  {&__pyx_n_s__i4, __pyx_k__i4, sizeof(__pyx_k__i4), 0, 0, 1, 1},
  {&__pyx_n_s__i8, __pyx_k__i8, sizeof(__pyx_k__i8), 0, 0, 1, 1},
  {&__pyx_n_s__i8_to_pydt, __pyx_k__i8_to_pydt, sizeof(__pyx_k__i8_to_pydt), 0, 0, 1, 1},
  {&__pyx_n_s__iNaT, __pyx_k__iNaT, sizeof(__pyx_k__iNaT), 0, 0, 1, 1},
  {&__pyx_n_s__idMap, __pyx_k__idMap, sizeof(__pyx_k__idMap), 0, 0, 1, 1},
  {&__pyx_n_s__iinfo, __pyx_k__iinfo, sizeof(__pyx_k__iinfo), 0, 0, 1, 1},
  {&__pyx_n_s__in_arr, __pyx_k__in_arr, sizeof(__pyx_k__in_arr), 0, 0, 1, 1},
  {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
  {&__pyx_n_s__indexer, __pyx_k__indexer, sizeof(__pyx_k__indexer), 0, 0, 1, 1},
  {&__pyx_n_s__indices_fast, __pyx_k__indices_fast, sizeof(__pyx_k__indices_fast), 0, 0, 1, 1},
  {&__pyx_n_s__inf, __pyx_k__inf, sizeof(__pyx_k__inf), 0, 0, 1, 1},
  {&__pyx_n_s__infer_dtype, __pyx_k__infer_dtype, sizeof(__pyx_k__infer_dtype), 0, 0, 1, 1},
  {&__pyx_n_s__infer_dtype_list, __pyx_k__infer_dtype_list, sizeof(__pyx_k__infer_dtype_list), 0, 0, 1, 1},
  {&__pyx_n_s__inner_join, __pyx_k__inner_join, sizeof(__pyx_k__inner_join), 0, 0, 1, 1},
  {&__pyx_n_s__input, __pyx_k__input, sizeof(__pyx_k__input), 0, 0, 1, 1},
  {&__pyx_n_s__insert, __pyx_k__insert, sizeof(__pyx_k__insert), 0, 0, 1, 1},
  {&__pyx_n_s__int16, __pyx_k__int16, sizeof(__pyx_k__int16), 0, 0, 1, 1},
  {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
  {&__pyx_n_s__int64, __pyx_k__int64, sizeof(__pyx_k__int64), 0, 0, 1, 1},
  {&__pyx_n_s__int8, __pyx_k__int8, sizeof(__pyx_k__int8), 0, 0, 1, 1},
  {&__pyx_n_s__int_, __pyx_k__int_, sizeof(__pyx_k__int_), 0, 0, 1, 1},
  {&__pyx_n_s__integer, __pyx_k__integer, sizeof(__pyx_k__integer), 0, 0, 1, 1},
  {&__pyx_n_s__ints_to_pydatetime, __pyx_k__ints_to_pydatetime, sizeof(__pyx_k__ints_to_pydatetime), 0, 0, 1, 1},
  {&__pyx_n_s__is_bool_array, __pyx_k__is_bool_array, sizeof(__pyx_k__is_bool_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_date_array, __pyx_k__is_date_array, sizeof(__pyx_k__is_date_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_datetime64_array, __pyx_k__is_datetime64_array, sizeof(__pyx_k__is_datetime64_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_datetime_array, __pyx_k__is_datetime_array, sizeof(__pyx_k__is_datetime_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_float_array, __pyx_k__is_float_array, sizeof(__pyx_k__is_float_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_integer, __pyx_k__is_integer, sizeof(__pyx_k__is_integer), 0, 0, 1, 1},
  {&__pyx_n_s__is_integer_array, __pyx_k__is_integer_array, sizeof(__pyx_k__is_integer_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_lexsorted, __pyx_k__is_lexsorted, sizeof(__pyx_k__is_lexsorted), 0, 0, 1, 1},
  {&__pyx_n_s__is_monotonic, __pyx_k__is_monotonic, sizeof(__pyx_k__is_monotonic), 0, 0, 1, 1},
  {&__pyx_n_s__is_monotonic_int64, __pyx_k__is_monotonic_int64, sizeof(__pyx_k__is_monotonic_int64), 0, 0, 1, 1},
  {&__pyx_n_s__is_monotonic_object, __pyx_k__is_monotonic_object, sizeof(__pyx_k__is_monotonic_object), 0, 0, 1, 1},
  {&__pyx_n_s__is_period_array, __pyx_k__is_period_array, sizeof(__pyx_k__is_period_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_string_array, __pyx_k__is_string_array, sizeof(__pyx_k__is_string_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_time_array, __pyx_k__is_time_array, sizeof(__pyx_k__is_time_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_timestamp_array, __pyx_k__is_timestamp_array, sizeof(__pyx_k__is_timestamp_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_unicode_array, __pyx_k__is_unicode_array, sizeof(__pyx_k__is_unicode_array), 0, 0, 1, 1},
  {&__pyx_n_s__is_unique, __pyx_k__is_unique, sizeof(__pyx_k__is_unique), 0, 0, 1, 1},
  {&__pyx_n_s__isfinite, __pyx_k__isfinite, sizeof(__pyx_k__isfinite), 0, 0, 1, 1},
  {&__pyx_n_s__isleapyear, __pyx_k__isleapyear, sizeof(__pyx_k__isleapyear), 0, 0, 1, 1},
  {&__pyx_n_s__ismember, __pyx_k__ismember, sizeof(__pyx_k__ismember), 0, 0, 1, 1},
  {&__pyx_n_s__isnan, __pyx_k__isnan, sizeof(__pyx_k__isnan), 0, 0, 1, 1},
  {&__pyx_n_s__isnullobj, __pyx_k__isnullobj, sizeof(__pyx_k__isnullobj), 0, 0, 1, 1},
  {&__pyx_n_s__isnullobj2d, __pyx_k__isnullobj2d, sizeof(__pyx_k__isnullobj2d), 0, 0, 1, 1},
  {&__pyx_n_s__isscalar, __pyx_k__isscalar, sizeof(__pyx_k__isscalar), 0, 0, 1, 1},
  {&__pyx_n_s__item, __pyx_k__item, sizeof(__pyx_k__item), 0, 0, 1, 1},
  {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1},
  {&__pyx_n_s__iterations, __pyx_k__iterations, sizeof(__pyx_k__iterations), 0, 0, 1, 1},
  {&__pyx_n_s__join_sorter, __pyx_k__join_sorter, sizeof(__pyx_k__join_sorter), 0, 0, 1, 1},
  {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
  {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
  {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
  {&__pyx_n_s__kind, __pyx_k__kind, sizeof(__pyx_k__kind), 0, 0, 1, 1},
  {&__pyx_n_s__kth_smallest, __pyx_k__kth_smallest, sizeof(__pyx_k__kth_smallest), 0, 0, 1, 1},
  {&__pyx_n_s__labels, __pyx_k__labels, sizeof(__pyx_k__labels), 0, 0, 1, 1},
  {&__pyx_n_s__le, __pyx_k__le, sizeof(__pyx_k__le), 0, 0, 1, 1},
  {&__pyx_n_s__left, __pyx_k__left, sizeof(__pyx_k__left), 0, 0, 1, 1},
  {&__pyx_n_s__left_join_1d, __pyx_k__left_join_1d, sizeof(__pyx_k__left_join_1d), 0, 0, 1, 1},
  {&__pyx_n_s__left_join_2d, __pyx_k__left_join_2d, sizeof(__pyx_k__left_join_2d), 0, 0, 1, 1},
  {&__pyx_n_s__left_outer_join, __pyx_k__left_outer_join, sizeof(__pyx_k__left_outer_join), 0, 0, 1, 1},
  {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1},
  {&__pyx_n_s__limit, __pyx_k__limit, sizeof(__pyx_k__limit), 0, 0, 1, 1},
  {&__pyx_n_s__lindexer, __pyx_k__lindexer, sizeof(__pyx_k__lindexer), 0, 0, 1, 1},
  {&__pyx_n_s__loc, __pyx_k__loc, sizeof(__pyx_k__loc), 0, 0, 1, 1},
  {&__pyx_n_s__localize, __pyx_k__localize, sizeof(__pyx_k__localize), 0, 0, 1, 1},
  {&__pyx_n_s__lookup, __pyx_k__lookup, sizeof(__pyx_k__lookup), 0, 0, 1, 1},
  {&__pyx_n_s__lookup2, __pyx_k__lookup2, sizeof(__pyx_k__lookup2), 0, 0, 1, 1},
  {&__pyx_n_s__lookup_values, __pyx_k__lookup_values, sizeof(__pyx_k__lookup_values), 0, 0, 1, 1},
  {&__pyx_n_s__lt, __pyx_k__lt, sizeof(__pyx_k__lt), 0, 0, 1, 1},
  {&__pyx_n_s__lvalues, __pyx_k__lvalues, sizeof(__pyx_k__lvalues), 0, 0, 1, 1},
  {&__pyx_n_s__m, __pyx_k__m, sizeof(__pyx_k__m), 0, 0, 1, 1},
  {&__pyx_n_s__map_infer, __pyx_k__map_infer, sizeof(__pyx_k__map_infer), 0, 0, 1, 1},
  {&__pyx_n_s__map_locations, __pyx_k__map_locations, sizeof(__pyx_k__map_locations), 0, 0, 1, 1},
  {&__pyx_n_s__mapper, __pyx_k__mapper, sizeof(__pyx_k__mapper), 0, 0, 1, 1},
  {&__pyx_n_s__mapping, __pyx_k__mapping, sizeof(__pyx_k__mapping), 0, 0, 1, 1},
  {&__pyx_n_s__mask, __pyx_k__mask, sizeof(__pyx_k__mask), 0, 0, 1, 1},
  {&__pyx_n_s__mat, __pyx_k__mat, sizeof(__pyx_k__mat), 0, 0, 1, 1},
  {&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1},
  {&__pyx_n_s__max_bin, __pyx_k__max_bin, sizeof(__pyx_k__max_bin), 0, 0, 1, 1},
  {&__pyx_n_s__max_group, __pyx_k__max_group, sizeof(__pyx_k__max_group), 0, 0, 1, 1},
  {&__pyx_n_s__max_groups, __pyx_k__max_groups, sizeof(__pyx_k__max_groups), 0, 0, 1, 1},
  {&__pyx_n_s__max_subseq, __pyx_k__max_subseq, sizeof(__pyx_k__max_subseq), 0, 0, 1, 1},
  {&__pyx_n_s__maximum, __pyx_k__maximum, sizeof(__pyx_k__maximum), 0, 0, 1, 1},
  {&__pyx_n_s__maybe_convert_bool, __pyx_k__maybe_convert_bool, sizeof(__pyx_k__maybe_convert_bool), 0, 0, 1, 1},
  {&__pyx_n_s__median, __pyx_k__median, sizeof(__pyx_k__median), 0, 0, 1, 1},
  {&__pyx_n_s__mergesort, __pyx_k__mergesort, sizeof(__pyx_k__mergesort), 0, 0, 1, 1},
  {&__pyx_n_s__microsecond, __pyx_k__microsecond, sizeof(__pyx_k__microsecond), 0, 0, 1, 1},
  {&__pyx_n_s__microseconds, __pyx_k__microseconds, sizeof(__pyx_k__microseconds), 0, 0, 1, 1},
  {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1},
  {&__pyx_n_s__min_subseq, __pyx_k__min_subseq, sizeof(__pyx_k__min_subseq), 0, 0, 1, 1},
  {&__pyx_n_s__minp, __pyx_k__minp, sizeof(__pyx_k__minp), 0, 0, 1, 1},
  {&__pyx_n_s__minute, __pyx_k__minute, sizeof(__pyx_k__minute), 0, 0, 1, 1},
  {&__pyx_n_s__minutes, __pyx_k__minutes, sizeof(__pyx_k__minutes), 0, 0, 1, 1},
  {&__pyx_n_s__mixed, __pyx_k__mixed, sizeof(__pyx_k__mixed), 0, 0, 1, 1},
  {&__pyx_n_s__month, __pyx_k__month, sizeof(__pyx_k__month), 0, 0, 1, 1},
  {&__pyx_n_s__monthrange, __pyx_k__monthrange, sizeof(__pyx_k__monthrange), 0, 0, 1, 1},
  {&__pyx_n_s__months, __pyx_k__months, sizeof(__pyx_k__months), 0, 0, 1, 1},
  {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1},
  {&__pyx_n_s__na_sentinel, __pyx_k__na_sentinel, sizeof(__pyx_k__na_sentinel), 0, 0, 1, 1},
  {&__pyx_n_s__na_values, __pyx_k__na_values, sizeof(__pyx_k__na_values), 0, 0, 1, 1},
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
  {&__pyx_n_s__nan, __pyx_k__nan, sizeof(__pyx_k__nan), 0, 0, 1, 1},
  {&__pyx_n_s__nancorr, __pyx_k__nancorr, sizeof(__pyx_k__nancorr), 0, 0, 1, 1},
  {&__pyx_n_s__nanosecond, __pyx_k__nanosecond, sizeof(__pyx_k__nanosecond), 0, 0, 1, 1},
  {&__pyx_n_s__ndarrays, __pyx_k__ndarrays, sizeof(__pyx_k__ndarrays), 0, 0, 1, 1},
  {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
  {&__pyx_n_s__ne, __pyx_k__ne, sizeof(__pyx_k__ne), 0, 0, 1, 1},
  {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 0, 0, 1, 1},
  {&__pyx_n_s__ngroups, __pyx_k__ngroups, sizeof(__pyx_k__ngroups), 0, 0, 1, 1},
  {&__pyx_n_s__nonzero, __pyx_k__nonzero, sizeof(__pyx_k__nonzero), 0, 0, 1, 1},
  {&__pyx_n_s__normalize, __pyx_k__normalize, sizeof(__pyx_k__normalize), 0, 0, 1, 1},
  {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
  {&__pyx_n_s__ns, __pyx_k__ns, sizeof(__pyx_k__ns), 0, 0, 1, 1},
  {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
  {&__pyx_n_s__object, __pyx_k__object, sizeof(__pyx_k__object), 0, 0, 1, 1},
  {&__pyx_n_s__object_, __pyx_k__object_, sizeof(__pyx_k__object_), 0, 0, 1, 1},
  {&__pyx_n_s__objects, __pyx_k__objects, sizeof(__pyx_k__objects), 0, 0, 1, 1},
  {&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 0, 0, 1, 1},
  {&__pyx_n_s__ones, __pyx_k__ones, sizeof(__pyx_k__ones), 0, 0, 1, 1},
  {&__pyx_n_s__ones_like, __pyx_k__ones_like, sizeof(__pyx_k__ones_like), 0, 0, 1, 1},
  {&__pyx_n_s__op, __pyx_k__op, sizeof(__pyx_k__op), 0, 0, 1, 1},
  {&__pyx_n_s__operator, __pyx_k__operator, sizeof(__pyx_k__operator), 0, 0, 1, 1},
  {&__pyx_n_s__ordered_left_join, __pyx_k__ordered_left_join, sizeof(__pyx_k__ordered_left_join), 0, 0, 1, 1},
  {&__pyx_n_s__ordinal, __pyx_k__ordinal, sizeof(__pyx_k__ordinal), 0, 0, 1, 1},
  {&__pyx_n_s__other, __pyx_k__other, sizeof(__pyx_k__other), 0, 0, 1, 1},
  {&__pyx_n_s__out, __pyx_k__out, sizeof(__pyx_k__out), 0, 0, 1, 1},
  {&__pyx_n_s__pad_float64, __pyx_k__pad_float64, sizeof(__pyx_k__pad_float64), 0, 0, 1, 1},
  {&__pyx_n_s__pad_int64, __pyx_k__pad_int64, sizeof(__pyx_k__pad_int64), 0, 0, 1, 1},
  {&__pyx_n_s__pad_object, __pyx_k__pad_object, sizeof(__pyx_k__pad_object), 0, 0, 1, 1},
  {&__pyx_n_s__pandas, __pyx_k__pandas, sizeof(__pyx_k__pandas), 0, 0, 1, 1},
  {&__pyx_n_s__pandas_null, __pyx_k__pandas_null, sizeof(__pyx_k__pandas_null), 0, 0, 1, 1},
  {&__pyx_n_s__parse, __pyx_k__parse, sizeof(__pyx_k__parse), 0, 0, 1, 1},
  {&__pyx_n_s__parse_date, __pyx_k__parse_date, sizeof(__pyx_k__parse_date), 0, 0, 1, 1},
  {&__pyx_n_s__parser, __pyx_k__parser, sizeof(__pyx_k__parser), 0, 0, 1, 1},
  {&__pyx_n_s__prop, __pyx_k__prop, sizeof(__pyx_k__prop), 0, 0, 1, 1},
  {&__pyx_n_s__property, __pyx_k__property, sizeof(__pyx_k__property), 0, 0, 1, 1},
  {&__pyx_n_s__put, __pyx_k__put, sizeof(__pyx_k__put), 0, 0, 1, 1},
  {&__pyx_n_s__putmask, __pyx_k__putmask, sizeof(__pyx_k__putmask), 0, 0, 1, 1},
  {&__pyx_n_s__pydate, __pyx_k__pydate, sizeof(__pyx_k__pydate), 0, 0, 1, 1},
  {&__pyx_n_s__pydatetime, __pyx_k__pydatetime, sizeof(__pyx_k__pydatetime), 0, 0, 1, 1},
  {&__pyx_n_s__pydt_to_i8, __pyx_k__pydt_to_i8, sizeof(__pyx_k__pydt_to_i8), 0, 0, 1, 1},
  {&__pyx_n_s__pytz, __pyx_k__pytz, sizeof(__pyx_k__pytz), 0, 0, 1, 1},
  {&__pyx_n_s__q, __pyx_k__q, sizeof(__pyx_k__q), 0, 0, 1, 1},
  {&__pyx_n_s__quantile, __pyx_k__quantile, sizeof(__pyx_k__quantile), 0, 0, 1, 1},
  {&__pyx_n_s__quarter, __pyx_k__quarter, sizeof(__pyx_k__quarter), 0, 0, 1, 1},
  {&__pyx_n_s__raise_, __pyx_k__raise_, sizeof(__pyx_k__raise_), 0, 0, 1, 1},
  {&__pyx_n_s__random, __pyx_k__random, sizeof(__pyx_k__random), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__rank, __pyx_k__rank, sizeof(__pyx_k__rank), 0, 0, 1, 1},
  {&__pyx_n_s__rank_1d_float64, __pyx_k__rank_1d_float64, sizeof(__pyx_k__rank_1d_float64), 0, 0, 1, 1},
  {&__pyx_n_s__rank_1d_generic, __pyx_k__rank_1d_generic, sizeof(__pyx_k__rank_1d_generic), 0, 0, 1, 1},
  {&__pyx_n_s__rank_1d_int64, __pyx_k__rank_1d_int64, sizeof(__pyx_k__rank_1d_int64), 0, 0, 1, 1},
  {&__pyx_n_s__rank_2d_float64, __pyx_k__rank_2d_float64, sizeof(__pyx_k__rank_2d_float64), 0, 0, 1, 1},
  {&__pyx_n_s__rank_2d_generic, __pyx_k__rank_2d_generic, sizeof(__pyx_k__rank_2d_generic), 0, 0, 1, 1},
  {&__pyx_n_s__rank_2d_int64, __pyx_k__rank_2d_int64, sizeof(__pyx_k__rank_2d_int64), 0, 0, 1, 1},
  {&__pyx_n_s__ravel, __pyx_k__ravel, sizeof(__pyx_k__ravel), 0, 0, 1, 1},
  {&__pyx_n_s__reduce, __pyx_k__reduce, sizeof(__pyx_k__reduce), 0, 0, 1, 1},
  {&__pyx_n_s__remove, __pyx_k__remove, sizeof(__pyx_k__remove), 0, 0, 1, 1},
  {&__pyx_n_s__repeat, __pyx_k__repeat, sizeof(__pyx_k__repeat), 0, 0, 1, 1},
  {&__pyx_n_s__replace, __pyx_k__replace, sizeof(__pyx_k__replace), 0, 0, 1, 1},
  {&__pyx_n_s__retry, __pyx_k__retry, sizeof(__pyx_k__retry), 0, 0, 1, 1},
  {&__pyx_n_s__right, __pyx_k__right, sizeof(__pyx_k__right), 0, 0, 1, 1},
  {&__pyx_n_s__rindexer, __pyx_k__rindexer, sizeof(__pyx_k__rindexer), 0, 0, 1, 1},
  {&__pyx_n_s__roll_generic, __pyx_k__roll_generic, sizeof(__pyx_k__roll_generic), 0, 0, 1, 1},
  {&__pyx_n_s__roll_kurt, __pyx_k__roll_kurt, sizeof(__pyx_k__roll_kurt), 0, 0, 1, 1},
  {&__pyx_n_s__roll_max, __pyx_k__roll_max, sizeof(__pyx_k__roll_max), 0, 0, 1, 1},
  {&__pyx_n_s__roll_max2, __pyx_k__roll_max2, sizeof(__pyx_k__roll_max2), 0, 0, 1, 1},
  {&__pyx_n_s__roll_mean, __pyx_k__roll_mean, sizeof(__pyx_k__roll_mean), 0, 0, 1, 1},
  {&__pyx_n_s__roll_median_c, __pyx_k__roll_median_c, sizeof(__pyx_k__roll_median_c), 0, 0, 1, 1},
  {&__pyx_n_s__roll_median_cython, __pyx_k__roll_median_cython, sizeof(__pyx_k__roll_median_cython), 0, 0, 1, 1},
  {&__pyx_n_s__roll_min, __pyx_k__roll_min, sizeof(__pyx_k__roll_min), 0, 0, 1, 1},
  {&__pyx_n_s__roll_min2, __pyx_k__roll_min2, sizeof(__pyx_k__roll_min2), 0, 0, 1, 1},
  {&__pyx_n_s__roll_quantile, __pyx_k__roll_quantile, sizeof(__pyx_k__roll_quantile), 0, 0, 1, 1},
  {&__pyx_n_s__roll_skew, __pyx_k__roll_skew, sizeof(__pyx_k__roll_skew), 0, 0, 1, 1},
  {&__pyx_n_s__roll_sum, __pyx_k__roll_sum, sizeof(__pyx_k__roll_sum), 0, 0, 1, 1},
  {&__pyx_n_s__roll_var, __pyx_k__roll_var, sizeof(__pyx_k__roll_var), 0, 0, 1, 1},
  {&__pyx_n_s__row_bool_subset, __pyx_k__row_bool_subset, sizeof(__pyx_k__row_bool_subset), 0, 0, 1, 1},
  {&__pyx_n_s__rvalues, __pyx_k__rvalues, sizeof(__pyx_k__rvalues), 0, 0, 1, 1},
  {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1},
  {&__pyx_n_s__safe, __pyx_k__safe, sizeof(__pyx_k__safe), 0, 0, 1, 1},
  {&__pyx_n_s__sanitize_objects, __pyx_k__sanitize_objects, sizeof(__pyx_k__sanitize_objects), 0, 0, 1, 1},
  {&__pyx_n_s__scalar_binop, __pyx_k__scalar_binop, sizeof(__pyx_k__scalar_binop), 0, 0, 1, 1},
  {&__pyx_n_s__scalar_compare, __pyx_k__scalar_compare, sizeof(__pyx_k__scalar_compare), 0, 0, 1, 1},
  {&__pyx_n_s__searchsorted, __pyx_k__searchsorted, sizeof(__pyx_k__searchsorted), 0, 0, 1, 1},
  {&__pyx_n_s__second, __pyx_k__second, sizeof(__pyx_k__second), 0, 0, 1, 1},
  {&__pyx_n_s__seconds, __pyx_k__seconds, sizeof(__pyx_k__seconds), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__series, __pyx_k__series, sizeof(__pyx_k__series), 0, 0, 1, 1},
  {&__pyx_n_s__set_item, __pyx_k__set_item, sizeof(__pyx_k__set_item), 0, 0, 1, 1},
  {&__pyx_n_s__set_length, __pyx_k__set_length, sizeof(__pyx_k__set_length), 0, 0, 1, 1},
  {&__pyx_n_s__set_value, __pyx_k__set_value, sizeof(__pyx_k__set_value), 0, 0, 1, 1},
  {&__pyx_n_s__set_value_at, __pyx_k__set_value_at, sizeof(__pyx_k__set_value_at), 0, 0, 1, 1},
  {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
  {&__pyx_n_s__side, __pyx_k__side, sizeof(__pyx_k__side), 0, 0, 1, 1},
  {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
  {&__pyx_n_s__size_hint, __pyx_k__size_hint, sizeof(__pyx_k__size_hint), 0, 0, 1, 1},
  {&__pyx_n_s__sort, __pyx_k__sort, sizeof(__pyx_k__sort), 0, 0, 1, 1},
  {&__pyx_n_s__sorted_labels, __pyx_k__sorted_labels, sizeof(__pyx_k__sorted_labels), 0, 0, 1, 1},
  {&__pyx_n_s__sorter, __pyx_k__sorter, sizeof(__pyx_k__sorter), 0, 0, 1, 1},
  {&__pyx_n_s__state, __pyx_k__state, sizeof(__pyx_k__state), 0, 0, 1, 1},
  {&__pyx_n_s__strftime, __pyx_k__strftime, sizeof(__pyx_k__strftime), 0, 0, 1, 1},
  {&__pyx_n_s__string, __pyx_k__string, sizeof(__pyx_k__string), 0, 0, 1, 1},
  {&__pyx_n_s__string_, __pyx_k__string_, sizeof(__pyx_k__string_), 0, 0, 1, 1},
  {&__pyx_n_s__strptime, __pyx_k__strptime, sizeof(__pyx_k__strptime), 0, 0, 1, 1},
  {&__pyx_n_s__sum, __pyx_k__sum, sizeof(__pyx_k__sum), 0, 0, 1, 1},
  {&__pyx_n_s__table, __pyx_k__table, sizeof(__pyx_k__table), 0, 0, 1, 1},
  {&__pyx_n_s__take, __pyx_k__take, sizeof(__pyx_k__take), 0, 0, 1, 1},
  {&__pyx_n_s__take_last, __pyx_k__take_last, sizeof(__pyx_k__take_last), 0, 0, 1, 1},
  {&__pyx_n_s__tiebreakers, __pyx_k__tiebreakers, sizeof(__pyx_k__tiebreakers), 0, 0, 1, 1},
  {&__pyx_n_s__ties_method, __pyx_k__ties_method, sizeof(__pyx_k__ties_method), 0, 0, 1, 1},
  {&__pyx_n_s__time, __pyx_k__time, sizeof(__pyx_k__time), 0, 0, 1, 1},
  {&__pyx_n_s__time64_to_datetime, __pyx_k__time64_to_datetime, sizeof(__pyx_k__time64_to_datetime), 0, 0, 1, 1},
  {&__pyx_n_s__time_parser, __pyx_k__time_parser, sizeof(__pyx_k__time_parser), 0, 0, 1, 1},
  {&__pyx_n_s__timedelta, __pyx_k__timedelta, sizeof(__pyx_k__timedelta), 0, 0, 1, 1},
  {&__pyx_n_s__times, __pyx_k__times, sizeof(__pyx_k__times), 0, 0, 1, 1},
  {&__pyx_n_s__timezone, __pyx_k__timezone, sizeof(__pyx_k__timezone), 0, 0, 1, 1},
  {&__pyx_n_s__to_object_array, __pyx_k__to_object_array, sizeof(__pyx_k__to_object_array), 0, 0, 1, 1},
  {&__pyx_n_s__to_period, __pyx_k__to_period, sizeof(__pyx_k__to_period), 0, 0, 1, 1},
  {&__pyx_n_s__to_pydatetime, __pyx_k__to_pydatetime, sizeof(__pyx_k__to_pydatetime), 0, 0, 1, 1},
  {&__pyx_n_s__toordinal, __pyx_k__toordinal, sizeof(__pyx_k__toordinal), 0, 0, 1, 1},
  {&__pyx_n_s__trans_cache, __pyx_k__trans_cache, sizeof(__pyx_k__trans_cache), 0, 0, 1, 1},
  {&__pyx_n_s__try_float, __pyx_k__try_float, sizeof(__pyx_k__try_float), 0, 0, 1, 1},
  {&__pyx_n_s__try_parse_dates, __pyx_k__try_parse_dates, sizeof(__pyx_k__try_parse_dates), 0, 0, 1, 1},
  {&__pyx_n_s__ts, __pyx_k__ts, sizeof(__pyx_k__ts), 0, 0, 1, 1},
  {&__pyx_n_s__ts_input, __pyx_k__ts_input, sizeof(__pyx_k__ts_input), 0, 0, 1, 1},
  {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1},
  {&__pyx_n_s__tz, __pyx_k__tz, sizeof(__pyx_k__tz), 0, 0, 1, 1},
  {&__pyx_n_s__tz1, __pyx_k__tz1, sizeof(__pyx_k__tz1), 0, 0, 1, 1},
  {&__pyx_n_s__tz2, __pyx_k__tz2, sizeof(__pyx_k__tz2), 0, 0, 1, 1},
  {&__pyx_n_s__tz_convert, __pyx_k__tz_convert, sizeof(__pyx_k__tz_convert), 0, 0, 1, 1},
  {&__pyx_n_s__tz_convert_single, __pyx_k__tz_convert_single, sizeof(__pyx_k__tz_convert_single), 0, 0, 1, 1},
  {&__pyx_n_s__tz_localize, __pyx_k__tz_localize, sizeof(__pyx_k__tz_localize), 0, 0, 1, 1},
  {&__pyx_n_s__tz_localize_check, __pyx_k__tz_localize_check, sizeof(__pyx_k__tz_localize_check), 0, 0, 1, 1},
  {&__pyx_n_s__tz_localize_to_utc, __pyx_k__tz_localize_to_utc, sizeof(__pyx_k__tz_localize_to_utc), 0, 0, 1, 1},
  {&__pyx_n_s__tzinfo, __pyx_k__tzinfo, sizeof(__pyx_k__tzinfo), 0, 0, 1, 1},
  {&__pyx_n_s__u, __pyx_k__u, sizeof(__pyx_k__u), 0, 0, 1, 1},
  {&__pyx_n_s__uint16, __pyx_k__uint16, sizeof(__pyx_k__uint16), 0, 0, 1, 1},
  {&__pyx_n_s__uint32, __pyx_k__uint32, sizeof(__pyx_k__uint32), 0, 0, 1, 1},
  {&__pyx_n_s__uint64, __pyx_k__uint64, sizeof(__pyx_k__uint64), 0, 0, 1, 1},
  {&__pyx_n_s__uint8, __pyx_k__uint8, sizeof(__pyx_k__uint8), 0, 0, 1, 1},
  {&__pyx_n_s__unicode, __pyx_k__unicode, sizeof(__pyx_k__unicode), 0, 0, 1, 1},
  {&__pyx_n_s__unicode_, __pyx_k__unicode_, sizeof(__pyx_k__unicode_), 0, 0, 1, 1},
  {&__pyx_n_s__unique, __pyx_k__unique, sizeof(__pyx_k__unique), 0, 0, 1, 1},
  {&__pyx_n_s__unique_deltas, __pyx_k__unique_deltas, sizeof(__pyx_k__unique_deltas), 0, 0, 1, 1},
  {&__pyx_n_s__uniques, __pyx_k__uniques, sizeof(__pyx_k__uniques), 0, 0, 1, 1},
  {&__pyx_n_s__us, __pyx_k__us, sizeof(__pyx_k__us), 0, 0, 1, 1},
  {&__pyx_n_s__utc, __pyx_k__utc, sizeof(__pyx_k__utc), 0, 0, 1, 1},
  {&__pyx_n_s__utc_offset_cache, __pyx_k__utc_offset_cache, sizeof(__pyx_k__utc_offset_cache), 0, 0, 1, 1},
  {&__pyx_n_s__utcfromtimestamp, __pyx_k__utcfromtimestamp, sizeof(__pyx_k__utcfromtimestamp), 0, 0, 1, 1},
  {&__pyx_n_s__val, __pyx_k__val, sizeof(__pyx_k__val), 0, 0, 1, 1},
  {&__pyx_n_s__vals, __pyx_k__vals, sizeof(__pyx_k__vals), 0, 0, 1, 1},
  {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
  {&__pyx_n_s__value_count_int64, __pyx_k__value_count_int64, sizeof(__pyx_k__value_count_int64), 0, 0, 1, 1},
  {&__pyx_n_s__values, __pyx_k__values, sizeof(__pyx_k__values), 0, 0, 1, 1},
  {&__pyx_n_s__vec_binop, __pyx_k__vec_binop, sizeof(__pyx_k__vec_binop), 0, 0, 1, 1},
  {&__pyx_n_s__vec_compare, __pyx_k__vec_compare, sizeof(__pyx_k__vec_compare), 0, 0, 1, 1},
  {&__pyx_n_s__vgetter, __pyx_k__vgetter, sizeof(__pyx_k__vgetter), 0, 0, 1, 1},
  {&__pyx_n_s__view, __pyx_k__view, sizeof(__pyx_k__view), 0, 0, 1, 1},
  {&__pyx_n_s__warn, __pyx_k__warn, sizeof(__pyx_k__warn), 0, 0, 1, 1},
  {&__pyx_n_s__week, __pyx_k__week, sizeof(__pyx_k__week), 0, 0, 1, 1},
  {&__pyx_n_s__weekday, __pyx_k__weekday, sizeof(__pyx_k__weekday), 0, 0, 1, 1},
  {&__pyx_n_s__weekofyear, __pyx_k__weekofyear, sizeof(__pyx_k__weekofyear), 0, 0, 1, 1},
  {&__pyx_n_s__width, __pyx_k__width, sizeof(__pyx_k__width), 0, 0, 1, 1},
  {&__pyx_n_s__win, __pyx_k__win, sizeof(__pyx_k__win), 0, 0, 1, 1},
  {&__pyx_n_s__window, __pyx_k__window, sizeof(__pyx_k__window), 0, 0, 1, 1},
  {&__pyx_n_s__woy, __pyx_k__woy, sizeof(__pyx_k__woy), 0, 0, 1, 1},
  {&__pyx_n_s__year, __pyx_k__year, sizeof(__pyx_k__year), 0, 0, 1, 1},
  {&__pyx_n_s__years, __pyx_k__years, sizeof(__pyx_k__years), 0, 0, 1, 1},
  {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
  {&__pyx_n_s__zeros_like, __pyx_k__zeros_like, sizeof(__pyx_k__zeros_like), 0, 0, 1, 1},
  {&__pyx_n_s__zone, __pyx_k__zone, sizeof(__pyx_k__zone), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_NameError = __Pyx_GetName(__pyx_b, __pyx_n_s__NameError); if (!__pyx_builtin_NameError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_property = __Pyx_GetName(__pyx_b, __pyx_n_s__property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AssertionError = __Pyx_GetName(__pyx_b, __pyx_n_s__AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetName(__pyx_b, __pyx_n_s__ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");

  /* "pandas/src/tseries.pyx":402
 *         it = <flatiter> PyArray_IterNew(arr)
 *         if len(arr) != n:
 *             raise ValueError('all arrays must be same length')             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
  PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));

  /* "pandas/src/tseries.pyx":419
 * 
 *     rev_indexer = np.empty(length, dtype=np.int64)
 *     rev_indexer.fill(-1)             # <<<<<<<<<<<<<<
 *     for i in range(n):
 *         idx = indexer[i]
 */
  __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_3));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));

  /* "pandas/src/tseries.pyx":514
 * 
 *     if not started:
 *         return slice(0, 0)             # <<<<<<<<<<<<<<
 *     if not finished:
 *         return slice(start, None)
 */
  __pyx_k_tuple_4 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_4, 1, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));

  /* "pandas/src/tseries.pyx":544
 *         flag = cpython.Py_NE
 *     else:
 *         raise ValueError('Unrecognized operator')             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype=bool).view(np.uint8)
 */
  __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));

  /* "pandas/src/tseries.pyx":591
 *         flag = cpython.Py_NE
 *     else:
 *         raise ValueError('Unrecognized operator')             # <<<<<<<<<<<<<<
 * 
 *     result = np.empty(n, dtype=bool).view(np.uint8)
 */
  __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":79
 *         if isinstance(ts_input, float):
 *             # to do, do we want to support this, ie with fractional seconds?
 *             raise TypeError("Cannot convert a float to datetime")             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(ts_input, basestring):
 */
  __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_13));
  PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":108
 * 
 *         try:
 *             result += self.strftime('%z')             # <<<<<<<<<<<<<<
 *             if self.tzinfo:
 *                 result += self.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 */
  __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_16));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_15));
  PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_15));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":113
 *         except ValueError:
 *             year2000 = self.replace(year=2000)
 *             result += year2000.strftime('%z')             # <<<<<<<<<<<<<<
 *             if self.tzinfo:
 *                 result += year2000.strftime(' %%Z, tz=%s' % self.tzinfo.zone)
 */
  __pyx_k_tuple_18 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_18));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_15));
  PyTuple_SET_ITEM(__pyx_k_tuple_18, 0, ((PyObject *)__pyx_kp_s_15));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":174
 *     @property
 *     def week(self):
 *         return self._get_field('woy')             # <<<<<<<<<<<<<<
 * 
 *     weekofyear = week
 */
  __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_24));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__woy));
  PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_n_s__woy));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__woy));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":180
 *     @property
 *     def quarter(self):
 *         return self._get_field('q')             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_k_tuple_25 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_25));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__q));
  PyTuple_SET_ITEM(__pyx_k_tuple_25, 0, ((PyObject *)__pyx_n_s__q));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__q));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":188
 *     @property
 *     def asm8(self):
 *         return np.int64(self.value).view('M8[ns]')             # <<<<<<<<<<<<<<
 * 
 *     def tz_localize(self, tz):
 */
  __pyx_k_tuple_27 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_27));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_26));
  PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_kp_s_26));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_26));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":206
 *             return Timestamp(self.to_pydatetime(), tz=tz)
 *         else:
 *             raise Exception('Cannot localize tz-aware Timestamp, use '             # <<<<<<<<<<<<<<
 *                             'tz_convert for conversions')
 * 
 */
  __pyx_k_tuple_29 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_29));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_28));
  PyTuple_SET_ITEM(__pyx_k_tuple_29, 0, ((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":224
 *         if self.tzinfo is None:
 *             # tz naive, use tz_localize
 *             raise Exception('Cannot convert tz-naive Timestamp, use '             # <<<<<<<<<<<<<<
 *                             'tz_localize to localize')
 *         else:
 */
  __pyx_k_tuple_31 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_31));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_30));
  PyTuple_SET_ITEM(__pyx_k_tuple_31, 0, ((PyObject *)__pyx_kp_s_30));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":311
 *         i += sz
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     if arr.descr.type_num == NPY_DATETIME:
 */
  __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
  PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":357
 * 
 *     result = np.empty(n, dtype='M8[ns]')
 *     new_values = result.view('i8')             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_k_tuple_36 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_36));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":393
 *         if self.tzinfo is None:
 *             if other.tzinfo is not None:
 *                 raise Exception('Cannot compare tz-naive and tz-aware timestamps')             # <<<<<<<<<<<<<<
 *         elif other.tzinfo is None:
 *             raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 */
  __pyx_k_tuple_39 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_39));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_38));
  PyTuple_SET_ITEM(__pyx_k_tuple_39, 0, ((PyObject *)__pyx_kp_s_38));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_38));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":395
 *                 raise Exception('Cannot compare tz-naive and tz-aware timestamps')
 *         elif other.tzinfo is None:
 *             raise Exception('Cannot compare tz-naive and tz-aware timestamps')             # <<<<<<<<<<<<<<
 * 
 *         if op == 2: # ==
 */
  __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_40));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_38));
  PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_38));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_38));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":657
 *     try:
 *         result = np.empty(n, dtype='M8[ns]')
 *         iresult = result.view('i8')             # <<<<<<<<<<<<<<
 *         for i in range(n):
 *             val = values[i]
 */
  __pyx_k_tuple_49 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_49));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_49, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":669
 *                         _check_dts_bounds(iresult[i], &_ts.dts)
 *                     else:
 *                         raise ValueError('Tz-aware datetime.datetime cannot '             # <<<<<<<<<<<<<<
 *                                          'be converted to datetime64 unless '
 *                                          'utc=True')
 */
  __pyx_k_tuple_51 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_51));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_50));
  PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, ((PyObject *)__pyx_kp_s_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_50));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":730
 *     unit = get_datetime64_unit(val)
 *     if unit == 3:
 *         raise ValueError('NumPy 1.6.1 business freq not supported')             # <<<<<<<<<<<<<<
 * 
 *     ival = get_datetime64_value(val)
 */
  __pyx_k_tuple_53 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_53));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
  PyTuple_SET_ITEM(__pyx_k_tuple_53, 0, ((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":757
 *     unit = get_datetime64_unit(arr.flat[0])
 *     if unit == 3:
 *         raise ValueError('NumPy 1.6.1 business freq not supported')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_54 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_54));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
  PyTuple_SET_ITEM(__pyx_k_tuple_54, 0, ((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":814
 *         pos = trans.searchsorted(vals[0]) - 1
 *         if pos < 0:
 *             raise ValueError('First time before start of DST info')             # <<<<<<<<<<<<<<
 * 
 *         offset = deltas[pos]
 */
  __pyx_k_tuple_56 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_56));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_55));
  PyTuple_SET_ITEM(__pyx_k_tuple_56, 0, ((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":836
 *     pos = trans.searchsorted(utc_dates[0]) - 1
 *     if pos < 0:
 *         raise ValueError('First time before start of DST info')             # <<<<<<<<<<<<<<
 * 
 *     offset = deltas[pos]
 */
  __pyx_k_tuple_57 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_57));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_55));
  PyTuple_SET_ITEM(__pyx_k_tuple_57, 0, ((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":865
 *         pos = trans.searchsorted(val) - 1
 *         if pos < 0:
 *             raise ValueError('First time before start of DST info')             # <<<<<<<<<<<<<<
 *         offset = deltas[pos]
 *         utc_date = val - offset
 */
  __pyx_k_tuple_58 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_58));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_55));
  PyTuple_SET_ITEM(__pyx_k_tuple_58, 0, ((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":879
 *     pos = trans.searchsorted(utc_date) - 1
 *     if pos < 0:
 *         raise ValueError('First time before start of DST info')             # <<<<<<<<<<<<<<
 * 
 *     offset = deltas[pos]
 */
  __pyx_k_tuple_59 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_59));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_55));
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 0, ((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_55));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":894
 *     if tz not in trans_cache:
 *         arr = np.array(tz._utc_transition_times, dtype='M8[ns]')
 *         trans_cache[tz] = arr.view('i8')             # <<<<<<<<<<<<<<
 *     return trans_cache[tz]
 * 
 */
  __pyx_k_tuple_61 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_61));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_61, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":938
 * 
 *     if not have_pytz:
 *         raise Exception("Could not find pytz module")             # <<<<<<<<<<<<<<
 * 
 *     if tz == pytz.utc or tz is None:
 */
  __pyx_k_tuple_63 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_63));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_62));
  PyTuple_SET_ITEM(__pyx_k_tuple_63, 0, ((PyObject *)__pyx_kp_s_62));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_62));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":985
 * 
 *     if not have_pytz:
 *         raise Exception("Could not find pytz module")             # <<<<<<<<<<<<<<
 * 
 *     if tz == pytz.utc or tz is None:
 */
  __pyx_k_tuple_65 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_65));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_62));
  PyTuple_SET_ITEM(__pyx_k_tuple_65, 0, ((PyObject *)__pyx_kp_s_62));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_62));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1091
 *     count = len(dtindex)
 * 
 *     sa_dtype = [('Y', 'i4'), # year             # <<<<<<<<<<<<<<
 *                 ('M', 'i4'), # month
 *                 ('D', 'i4'), # day
 */
  __pyx_k_tuple_67 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_67));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__Y));
  PyTuple_SET_ITEM(__pyx_k_tuple_67, 0, ((PyObject *)__pyx_n_s__Y));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Y));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_67, 1, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1092
 * 
 *     sa_dtype = [('Y', 'i4'), # year
 *                 ('M', 'i4'), # month             # <<<<<<<<<<<<<<
 *                 ('D', 'i4'), # day
 *                 ('h', 'i4'), # hour
 */
  __pyx_k_tuple_68 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_68));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__M));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 0, ((PyObject *)__pyx_n_s__M));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__M));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_68, 1, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1093
 *     sa_dtype = [('Y', 'i4'), # year
 *                 ('M', 'i4'), # month
 *                 ('D', 'i4'), # day             # <<<<<<<<<<<<<<
 *                 ('h', 'i4'), # hour
 *                 ('m', 'i4'), # min
 */
  __pyx_k_tuple_69 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_69));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__D));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 0, ((PyObject *)__pyx_n_s__D));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__D));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_69, 1, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1094
 *                 ('M', 'i4'), # month
 *                 ('D', 'i4'), # day
 *                 ('h', 'i4'), # hour             # <<<<<<<<<<<<<<
 *                 ('m', 'i4'), # min
 *                 ('s', 'i4'), # second
 */
  __pyx_k_tuple_70 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_70));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__h));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 0, ((PyObject *)__pyx_n_s__h));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__h));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_70, 1, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1095
 *                 ('D', 'i4'), # day
 *                 ('h', 'i4'), # hour
 *                 ('m', 'i4'), # min             # <<<<<<<<<<<<<<
 *                 ('s', 'i4'), # second
 *                 ('u', 'i4')] # microsecond
 */
  __pyx_k_tuple_71 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_71));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__m));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 0, ((PyObject *)__pyx_n_s__m));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__m));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_71, 1, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1096
 *                 ('h', 'i4'), # hour
 *                 ('m', 'i4'), # min
 *                 ('s', 'i4'), # second             # <<<<<<<<<<<<<<
 *                 ('u', 'i4')] # microsecond
 * 
 */
  __pyx_k_tuple_72 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_72));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__s));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 0, ((PyObject *)__pyx_n_s__s));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__s));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_72, 1, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1097
 *                 ('m', 'i4'), # min
 *                 ('s', 'i4'), # second
 *                 ('u', 'i4')] # microsecond             # <<<<<<<<<<<<<<
 * 
 *     out = np.empty(count, dtype=sa_dtype)
 */
  __pyx_k_tuple_73 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_73));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__u));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 0, ((PyObject *)__pyx_n_s__u));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__u));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_73, 1, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1309
 * 
 *     if month < 1 or month > 12:
 *         raise ValueError("bad month number 0; must be 1-12")             # <<<<<<<<<<<<<<
 * 
 *     days = _days_per_month_table[is_leapyear(year)][month-1]
 */
  __pyx_k_tuple_76 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_76));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_75));
  PyTuple_SET_ITEM(__pyx_k_tuple_76, 0, ((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_75));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":138
 * 
 *         if value != (<Node> (<Node> (<Node> chain[0]).next)[0]).value:
 *             raise KeyError('Not Found')             # <<<<<<<<<<<<<<
 * 
 *         # remove one link at each level
 */
  __pyx_k_tuple_78 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_78));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_77));
  PyTuple_SET_ITEM(__pyx_k_tuple_78, 0, ((PyObject *)__pyx_kp_s_77));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_77));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_78));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":839
 * 
 *     if lenidx <= 0 or lenbin <= 0:
 *         raise ValueError("Invalid length for values or for binner")             # <<<<<<<<<<<<<<
 * 
 *     # check binner fits data
 */
  __pyx_k_tuple_82 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_82));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_81));
  PyTuple_SET_ITEM(__pyx_k_tuple_82, 0, ((PyObject *)__pyx_kp_s_81));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_81));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":843
 *     # check binner fits data
 *     if values[0] < binner[0]:
 *         raise ValueError("Values falls before first bin")             # <<<<<<<<<<<<<<
 * 
 *     if values[lenidx-1] > binner[lenbin-1]:
 */
  __pyx_k_tuple_84 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_84));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_83));
  PyTuple_SET_ITEM(__pyx_k_tuple_84, 0, ((PyObject *)__pyx_kp_s_83));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_83));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":846
 * 
 *     if values[lenidx-1] > binner[lenbin-1]:
 *         raise ValueError("Values falls after last bin")             # <<<<<<<<<<<<<<
 * 
 *     bins   = np.empty(lenbin - 1, dtype=np.int64)
 */
  __pyx_k_tuple_86 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_86));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_85));
  PyTuple_SET_ITEM(__pyx_k_tuple_86, 0, ((PyObject *)__pyx_kp_s_85));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_85));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_86));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1132
 * 
 *     if out.shape[1] != 4:
 *         raise ValueError('Output array must have 4 columns')             # <<<<<<<<<<<<<<
 * 
 *     NA = np.nan
 */
  __pyx_k_tuple_88 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_88));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_87));
  PyTuple_SET_ITEM(__pyx_k_tuple_88, 0, ((PyObject *)__pyx_kp_s_87));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_87));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_88));

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1428
 *         it = <flatiter> PyArray_IterNew(arr)
 *         if len(arr) != n:
 *             raise ValueError('all arrays must be same length')             # <<<<<<<<<<<<<<
 * 
 *         for i in range(n):
 */
  __pyx_k_tuple_91 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_91));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_1));
  PyTuple_SET_ITEM(__pyx_k_tuple_91, 0, ((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_91));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":113
 * 
 *     if len(arr) == 0:
 *         return (-1,-1,None)             # <<<<<<<<<<<<<<
 * 
 *     m = arr[0]
 */
  __pyx_k_tuple_94 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_94));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_94, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_94, 1, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_k_tuple_94, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":344
 *         minp = 1
 *     elif minp < 0:
 *         raise ValueError('min_periods must be >= 0')             # <<<<<<<<<<<<<<
 *     return minp
 * 
 */
  __pyx_k_tuple_97 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_97)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_97));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_96));
  PyTuple_SET_ITEM(__pyx_k_tuple_97, 0, ((PyObject *)__pyx_kp_s_96));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_96));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":827
 * cdef double_t _get_min(object skiplist, int nobs, int minp):
 *     if nobs >= minp:
 *         return <IndexableSkiplist> skiplist.get(0)             # <<<<<<<<<<<<<<
 *     else:
 *         return NaN
 */
  __pyx_k_tuple_99 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_99));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_99, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_99));

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":885
 * 
 *     if not input.flags.c_contiguous:
 *         input = input.copy('C')             # <<<<<<<<<<<<<<
 * 
 *     buf = <float64_t*> input.data
 */
  __pyx_k_tuple_100 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_100));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__C));
  PyTuple_SET_ITEM(__pyx_k_tuple_100, 0, ((PyObject *)__pyx_n_s__C));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__C));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":20
 *         if axis == 0:
 *             if not arr.flags.f_contiguous:
 *                 arr = arr.copy('F')             # <<<<<<<<<<<<<<
 * 
 *             self.nresults = k
 */
  __pyx_k_tuple_101 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_101));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__F));
  PyTuple_SET_ITEM(__pyx_k_tuple_101, 0, ((PyObject *)__pyx_n_s__F));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__F));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_101));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":27
 *         else:
 *             if not arr.flags.c_contiguous:
 *                 arr = arr.copy('C')             # <<<<<<<<<<<<<<
 * 
 *             self.nresults = n
 */
  __pyx_k_tuple_102 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_102));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__C));
  PyTuple_SET_ITEM(__pyx_k_tuple_102, 0, ((PyObject *)__pyx_n_s__C));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__C));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":44
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')             # <<<<<<<<<<<<<<
 *             if len(dummy) != self.chunksize:
 *                 raise ValueError('Dummy array must be length %d' %
 */
  __pyx_k_tuple_104 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_104));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_103));
  PyTuple_SET_ITEM(__pyx_k_tuple_104, 0, ((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":106
 *             result[0] = res
 *         except Exception:
 *             raise ValueError('function does not reduce')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_107));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_106));
  PyTuple_SET_ITEM(__pyx_k_tuple_107, 0, ((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":126
 *         self.f = f
 *         if not series.flags.c_contiguous:
 *             series = series.copy('C')             # <<<<<<<<<<<<<<
 *         self.arr = series
 *         self.index = series.index
 */
  __pyx_k_tuple_108 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_108));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__C));
  PyTuple_SET_ITEM(__pyx_k_tuple_108, 0, ((PyObject *)__pyx_n_s__C));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__C));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":136
 *     def _check_dummy(self, dummy=None):
 *         if dummy is None:
 *             dummy = np.empty(0, dtype=self.arr.dtype)             # <<<<<<<<<<<<<<
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 */
  __pyx_k_tuple_109 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_109));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_109, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_109));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":139
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')             # <<<<<<<<<<<<<<
 *             if not dummy.flags.contiguous:
 *                 dummy = dummy.copy()
 */
  __pyx_k_tuple_110 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_110));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_103));
  PyTuple_SET_ITEM(__pyx_k_tuple_110, 0, ((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_110));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":212
 *             result = np.empty(self.ngroups, dtype='O')
 *         except Exception:
 *             raise ValueError('function does not reduce')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_k_tuple_111 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_111));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_106));
  PyTuple_SET_ITEM(__pyx_k_tuple_111, 0, ((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":234
 *         self.f = f
 *         if not series.flags.c_contiguous:
 *             series = series.copy('C')             # <<<<<<<<<<<<<<
 *         self.arr = series
 *         self.index = series.index
 */
  __pyx_k_tuple_112 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_112));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__C));
  PyTuple_SET_ITEM(__pyx_k_tuple_112, 0, ((PyObject *)__pyx_n_s__C));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__C));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_112));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":244
 *     def _check_dummy(self, dummy=None):
 *         if dummy is None:
 *             dummy = np.empty(0, dtype=self.arr.dtype)             # <<<<<<<<<<<<<<
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 */
  __pyx_k_tuple_113 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_113));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_113, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_113));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":247
 *         else:
 *             if dummy.dtype != self.arr.dtype:
 *                 raise ValueError('Dummy array must be same dtype')             # <<<<<<<<<<<<<<
 *             if not dummy.flags.contiguous:
 *                 dummy = dummy.copy()
 */
  __pyx_k_tuple_114 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_114));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_103));
  PyTuple_SET_ITEM(__pyx_k_tuple_114, 0, ((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_103));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_114));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":323
 *             result = np.empty(self.ngroups, dtype='O')
 *         except Exception:
 *             raise ValueError('function does not reduce')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_k_tuple_115 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_115));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_106));
  PyTuple_SET_ITEM(__pyx_k_tuple_115, 0, ((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_115));

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":362
 * def reduce(arr, f, axis=0, dummy=None, labels=None):
 *     if labels._has_complex_internals:
 *         raise Exception('Cannot use shortcut')             # <<<<<<<<<<<<<<
 * 
 *     reducer = Reducer(arr, f, axis=axis, dummy=dummy, labels=labels)
 */
  __pyx_k_tuple_118 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_118));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_117));
  PyTuple_SET_ITEM(__pyx_k_tuple_118, 0, ((PyObject *)__pyx_kp_s_117));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_117));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_118));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":109
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
  __pyx_k_slice_120 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_120)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_120);
  __Pyx_GIVEREF(__pyx_k_slice_120);

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":112
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_121 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_121));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_121, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_121));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":171
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
  __pyx_k_slice_123 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_123)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_123);
  __Pyx_GIVEREF(__pyx_k_slice_123);

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":174
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_124 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_124));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_124, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_124));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":238
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
  __pyx_k_tuple_126 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_126));
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_126, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_126));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":241
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_float64(values, _as)
 */
  __pyx_k_slice_127 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_127)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_127);
  __Pyx_GIVEREF(__pyx_k_slice_127);
  __pyx_k_slice_128 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_128)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_128);
  __Pyx_GIVEREF(__pyx_k_slice_128);
  __pyx_k_tuple_129 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_129));
  __Pyx_INCREF(__pyx_k_slice_127);
  PyTuple_SET_ITEM(__pyx_k_tuple_129, 0, __pyx_k_slice_127);
  __Pyx_GIVEREF(__pyx_k_slice_127);
  __Pyx_INCREF(__pyx_k_slice_128);
  PyTuple_SET_ITEM(__pyx_k_tuple_129, 1, __pyx_k_slice_128);
  __Pyx_GIVEREF(__pyx_k_slice_128);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_129));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":244
 * 
 *     values = _take_2d_float64(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_130 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_130));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_130, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_130));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":309
 *             tiebreak = TIEBREAK_FIRST_DESCENDING
 *     else:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 * 
 *     if not ascending:
 */
  __pyx_k_tuple_132 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_132));
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_132, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_132));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":312
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_int64(values, _as)
 */
  __pyx_k_slice_133 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_133)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_133);
  __Pyx_GIVEREF(__pyx_k_slice_133);
  __pyx_k_slice_134 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_134)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_134);
  __Pyx_GIVEREF(__pyx_k_slice_134);
  __pyx_k_tuple_135 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_135));
  __Pyx_INCREF(__pyx_k_slice_133);
  PyTuple_SET_ITEM(__pyx_k_tuple_135, 0, __pyx_k_slice_133);
  __Pyx_GIVEREF(__pyx_k_slice_133);
  __Pyx_INCREF(__pyx_k_slice_134);
  PyTuple_SET_ITEM(__pyx_k_tuple_135, 1, __pyx_k_slice_134);
  __Pyx_GIVEREF(__pyx_k_slice_134);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_135));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":315
 * 
 *     values = _take_2d_int64(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_136 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_136));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_136, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":366
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending:
 */
  __pyx_k_tuple_138 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_138));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__O));
  PyTuple_SET_ITEM(__pyx_k_tuple_138, 0, ((PyObject *)__pyx_n_s__O));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__O));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_138));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":395
 * 
 *     if not ascending:
 *         _as = _as[::-1]             # <<<<<<<<<<<<<<
 * 
 *     sorted_data = values.take(_as)
 */
  __pyx_k_slice_139 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_139)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_139);
  __Pyx_GIVEREF(__pyx_k_slice_139);

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":398
 * 
 *     sorted_data = values.take(_as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_140 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_140));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_140, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":419
 *                     ranks[argsorted[j]] = i + 1
 *             elif tiebreak == TIEBREAK_FIRST:
 *                 raise ValueError('first not supported for non-numeric data')             # <<<<<<<<<<<<<<
 *             sum_ranks = dups = 0
 *     return ranks
 */
  __pyx_k_tuple_142 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_142));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_141));
  PyTuple_SET_ITEM(__pyx_k_tuple_142, 0, ((PyObject *)__pyx_kp_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":476
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     if ascending:
 */
  __pyx_k_tuple_144 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_144));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__O));
  PyTuple_SET_ITEM(__pyx_k_tuple_144, 0, ((PyObject *)__pyx_n_s__O));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__O));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":491
 * 
 *     try:
 *         _as = values.argsort(1)             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         values = in_arr
 */
  __pyx_k_tuple_145 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_145));
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_145, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":504
 * 
 *     if not ascending:
 *         _as = _as[:, ::-1]             # <<<<<<<<<<<<<<
 * 
 *     values = _take_2d_object(values, _as)
 */
  __pyx_k_slice_146 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_146)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_146);
  __Pyx_GIVEREF(__pyx_k_slice_146);
  __pyx_k_slice_147 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_k_slice_147)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_147);
  __Pyx_GIVEREF(__pyx_k_slice_147);
  __pyx_k_tuple_148 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_148));
  __Pyx_INCREF(__pyx_k_slice_146);
  PyTuple_SET_ITEM(__pyx_k_tuple_148, 0, __pyx_k_slice_146);
  __Pyx_GIVEREF(__pyx_k_slice_146);
  __Pyx_INCREF(__pyx_k_slice_147);
  PyTuple_SET_ITEM(__pyx_k_tuple_148, 1, __pyx_k_slice_147);
  __Pyx_GIVEREF(__pyx_k_slice_147);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":507
 * 
 *     values = _take_2d_object(values, _as)
 *     argsorted = _as.astype('i8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_149 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_149));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_149, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":530
 *                         ranks[i, argsorted[i, z]] = j + 1
 *                 elif tiebreak == TIEBREAK_FIRST:
 *                     raise ValueError('first not supported for '             # <<<<<<<<<<<<<<
 *                                      'non-numeric data')
 *                 sum_ranks = dups = 0
 */
  __pyx_k_tuple_150 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_150));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_141));
  PyTuple_SET_ITEM(__pyx_k_tuple_150, 0, ((PyObject *)__pyx_kp_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));

  /* "/home/wesm/code/pandas/pandas/src/properties.pyx":58
 *     def __set__(self, obj, value):
 *         if len(obj) != len(value):
 *             raise AssertionError('Index length did not match values')             # <<<<<<<<<<<<<<
 *         obj._index = self._check_type(value)
 * 
 */
  __pyx_k_tuple_153 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_153));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_152));
  PyTuple_SET_ITEM(__pyx_k_tuple_153, 0, ((PyObject *)__pyx_kp_s_152));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_152));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153));

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":52
 * 
 *     if values.dtype != np.object_:
 *         values = values.astype('O')             # <<<<<<<<<<<<<<
 * 
 *     val = util.get_value_1d(values, 0)
 */
  __pyx_k_tuple_154 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_154)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_154));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__O));
  PyTuple_SET_ITEM(__pyx_k_tuple_154, 0, ((PyObject *)__pyx_n_s__O));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__O));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_154));

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":325
 *                 seen_float = 1
 *             else:
 *                 raise ValueError('Empty string encountered')             # <<<<<<<<<<<<<<
 *         elif util.is_complex_object(val):
 *             complexes[i] = val
 */
  __pyx_k_tuple_159 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_159)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_159));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_158));
  PyTuple_SET_ITEM(__pyx_k_tuple_159, 0, ((PyObject *)__pyx_kp_s_158));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_158));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_159));

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":543
 *     n = len(dates)
 *     if len(times) != n:
 *         raise ValueError('Length of dates and times must be equal')             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype='O')
 * 
 */
  __pyx_k_tuple_167 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_167));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_166));
  PyTuple_SET_ITEM(__pyx_k_tuple_167, 0, ((PyObject *)__pyx_kp_s_166));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_166));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":592
 *     n = len(years)
 *     if len(months) != n or len(days) != n:
 *         raise ValueError('Length of years/months/days must all be equal')             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype='O')
 * 
 */
  __pyx_k_tuple_169 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_169)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_169));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_168));
  PyTuple_SET_ITEM(__pyx_k_tuple_169, 0, ((PyObject *)__pyx_kp_s_168));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_168));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169));

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":613
 *     if (len(months) != n and len(days) != n and len(hours) != n and
 *         len(minutes) != n and len(seconds) != n):
 *         raise ValueError('Length of all datetime components must be equal')             # <<<<<<<<<<<<<<
 *     result = np.empty(n, dtype='O')
 * 
 */
  __pyx_k_tuple_171 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_171)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_171));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_170));
  PyTuple_SET_ITEM(__pyx_k_tuple_171, 0, ((PyObject *)__pyx_kp_s_170));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_170));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_171));

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":782
 *     if n == 0:
 *         # kludge, for Series
 *         return np.empty(0, dtype='f8')             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_175 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_175)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_175));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_k_tuple_175, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_175));

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":195
 *         # length-0 case
 *         res = np.empty(len(indexer), dtype=np.int64)
 *         res.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     return res
 */
  __pyx_k_tuple_177 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_177));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_177, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177));

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":231
 * 
 *     last_obs = np.empty(max_group, dtype=np.int64)
 *     last_obs.fill(-1)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(n):
 */
  __pyx_k_tuple_178 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_178)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_178));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_k_tuple_178, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_178));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":380
 * 
 *     cdef _get_index_values(self):
 *         return self.vgetter().view('i8')             # <<<<<<<<<<<<<<
 * 
 *     def _call_monotonic(self, values):
 */
  __pyx_k_tuple_180 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_180)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_180));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_180, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_180));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":428
 *         self._ensure_mapping_populated()
 *         if values.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(values)).astype('i4')             # <<<<<<<<<<<<<<
 *         values = np.asarray(values).view('i8')
 *         return self.mapping.lookup(values)
 */
  __pyx_k_tuple_181 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_181));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_181, 0, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_181));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":429
 *         if values.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(values)).astype('i4')
 *         values = np.asarray(values).view('i8')             # <<<<<<<<<<<<<<
 *         return self.mapping.lookup(values)
 * 
 */
  __pyx_k_tuple_182 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_182)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_182));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_182, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_182));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":434
 *     def get_pad_indexer(self, other, limit=None):
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')             # <<<<<<<<<<<<<<
 *         other = np.asarray(other).view('i8')
 *         return _algos.pad_int64(self._get_index_values(), other,
 */
  __pyx_k_tuple_183 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_183)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_183));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_183, 0, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_183));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":435
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')
 *         other = np.asarray(other).view('i8')             # <<<<<<<<<<<<<<
 *         return _algos.pad_int64(self._get_index_values(), other,
 *                                 limit=limit)
 */
  __pyx_k_tuple_184 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_184)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_184));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_184, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_184));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":441
 *     def get_backfill_indexer(self, other, limit=None):
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')             # <<<<<<<<<<<<<<
 *         other = np.asarray(other).view('i8')
 *         return _algos.backfill_int64(self._get_index_values(), other,
 */
  __pyx_k_tuple_185 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_185)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_185));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i4));
  PyTuple_SET_ITEM(__pyx_k_tuple_185, 0, ((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i4));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_185));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":442
 *         if other.dtype != 'M8[ns]':
 *             return np.repeat(-1, len(other)).astype('i4')
 *         other = np.asarray(other).view('i8')             # <<<<<<<<<<<<<<
 *         return _algos.backfill_int64(self._get_index_values(), other,
 *                                      limit=limit)
 */
  __pyx_k_tuple_186 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_186)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_186));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i8));
  PyTuple_SET_ITEM(__pyx_k_tuple_186, 0, ((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i8));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_186));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":458
 *     if issubclass(arr.dtype.type, (np.integer, np.bool_)):
 *         if util.is_float_object(value) and value != value:
 *             raise ValueError('Cannot assign nan to integer series')             # <<<<<<<<<<<<<<
 * 
 *     return value
 */
  __pyx_k_tuple_188 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_188)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_188));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_187));
  PyTuple_SET_ITEM(__pyx_k_tuple_188, 0, ((PyObject *)__pyx_kp_s_187));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_187));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_188));

  /* "numpy.pxd":216
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_k_tuple_190 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_190)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_190));
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_189));
  PyTuple_SET_ITEM(__pyx_k_tuple_190, 0, ((PyObject *)__pyx_kp_u_189));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_189));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_190));

  /* "numpy.pxd":220
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_k_tuple_192 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_192)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_192));
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_191));
  PyTuple_SET_ITEM(__pyx_k_tuple_192, 0, ((PyObject *)__pyx_kp_u_191));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_191));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_192));

  /* "numpy.pxd":258
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_k_tuple_194 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_194)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_194));
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_193));
  PyTuple_SET_ITEM(__pyx_k_tuple_194, 0, ((PyObject *)__pyx_kp_u_193));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_193));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_194));

  /* "numpy.pxd":800
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
  __pyx_k_tuple_197 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_197)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_197));
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_196));
  PyTuple_SET_ITEM(__pyx_k_tuple_197, 0, ((PyObject *)__pyx_kp_u_196));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_196));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_197));

  /* "numpy.pxd":804
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_k_tuple_198 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_198)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_198));
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_193));
  PyTuple_SET_ITEM(__pyx_k_tuple_198, 0, ((PyObject *)__pyx_kp_u_193));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_193));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_198));

  /* "numpy.pxd":824
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_k_tuple_200 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_200)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_200));
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_199));
  PyTuple_SET_ITEM(__pyx_k_tuple_200, 0, ((PyObject *)__pyx_kp_u_199));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_199));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_200));

  /* "util.pxd":32
 *         i += sz
 *     elif i >= sz or sz == 0:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     return get_value_1d(arr, i)
 */
  __pyx_k_tuple_201 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_201)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_201));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
  PyTuple_SET_ITEM(__pyx_k_tuple_201, 0, ((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_201));

  /* "util.pxd":49
 *         i += sz
 *     elif i >= sz:
 *         raise IndexError('index out of bounds')             # <<<<<<<<<<<<<<
 * 
 *     assign_value_1d(arr, i, value)
 */
  __pyx_k_tuple_202 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_202)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_202));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_34));
  PyTuple_SET_ITEM(__pyx_k_tuple_202, 0, ((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_202));
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_59 = PyInt_FromLong(59); if (unlikely(!__pyx_int_59)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_91 = PyInt_FromLong(91); if (unlikely(!__pyx_int_91)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_120 = PyInt_FromLong(120); if (unlikely(!__pyx_int_120)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_121 = PyInt_FromLong(121); if (unlikely(!__pyx_int_121)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_151 = PyInt_FromLong(151); if (unlikely(!__pyx_int_151)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_152 = PyInt_FromLong(152); if (unlikely(!__pyx_int_152)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_181 = PyInt_FromLong(181); if (unlikely(!__pyx_int_181)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_182 = PyInt_FromLong(182); if (unlikely(!__pyx_int_182)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_212 = PyInt_FromLong(212); if (unlikely(!__pyx_int_212)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_213 = PyInt_FromLong(213); if (unlikely(!__pyx_int_213)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_243 = PyInt_FromLong(243); if (unlikely(!__pyx_int_243)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_244 = PyInt_FromLong(244); if (unlikely(!__pyx_int_244)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_273 = PyInt_FromLong(273); if (unlikely(!__pyx_int_273)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_274 = PyInt_FromLong(274); if (unlikely(!__pyx_int_274)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_304 = PyInt_FromLong(304); if (unlikely(!__pyx_int_304)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_305 = PyInt_FromLong(305); if (unlikely(!__pyx_int_305)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_334 = PyInt_FromLong(334); if (unlikely(!__pyx_int_334)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_335 = PyInt_FromLong(335); if (unlikely(!__pyx_int_335)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_365 = PyInt_FromLong(365); if (unlikely(!__pyx_int_365)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_366 = PyInt_FromLong(366); if (unlikely(!__pyx_int_366)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2000 = PyInt_FromLong(2000); if (unlikely(!__pyx_int_2000)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_3600 = PyInt_FromLong(3600); if (unlikely(!__pyx_int_3600)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1000000 = PyInt_FromLong(1000000); if (unlikely(!__pyx_int_1000000)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1000000000 = PyInt_FromLong(1000000000); if (unlikely(!__pyx_int_1000000000)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initlib(void); /*proto*/
PyMODINIT_FUNC initlib(void)
#else
PyMODINIT_FUNC PyInit_lib(void); /*proto*/
PyMODINIT_FUNC PyInit_lib(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_5numpy_int32_t __pyx_t_4;
  __pyx_t_5numpy_int64_t __pyx_t_5;
  __pyx_t_5numpy_float32_t __pyx_t_6;
  __pyx_t_5numpy_float64_t __pyx_t_7;
  double __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_lib(void)");
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __pyx_binding_PyCFunctionType_USED
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("lib"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_pandas__lib) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_6pandas_3lib_ObjectVector = &__pyx_vtable_6pandas_3lib_ObjectVector;
  __pyx_vtable_6pandas_3lib_ObjectVector.append = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_ObjectVector *, PyObject *))__pyx_f_6pandas_3lib_12ObjectVector_append;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_ObjectVector) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_ObjectVector.tp_dict, __pyx_vtabptr_6pandas_3lib_ObjectVector) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "ObjectVector", (PyObject *)&__pyx_type_6pandas_3lib_ObjectVector) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_ObjectVector = &__pyx_type_6pandas_3lib_ObjectVector;
  __pyx_vtabptr_6pandas_3lib_Int64Vector = &__pyx_vtable_6pandas_3lib_Int64Vector;
  __pyx_vtable_6pandas_3lib_Int64Vector.append = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Int64Vector *, __pyx_t_5numpy_int64_t))__pyx_f_6pandas_3lib_11Int64Vector_append;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Int64Vector) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Int64Vector.tp_dict, __pyx_vtabptr_6pandas_3lib_Int64Vector) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Int64Vector", (PyObject *)&__pyx_type_6pandas_3lib_Int64Vector) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Int64Vector = &__pyx_type_6pandas_3lib_Int64Vector;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "HashTable", (PyObject *)&__pyx_type_6pandas_3lib_HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_HashTable = &__pyx_type_6pandas_3lib_HashTable;
  __pyx_vtabptr_6pandas_3lib_StringHashTable = &__pyx_vtable_6pandas_3lib_StringHashTable;
  __pyx_vtable_6pandas_3lib_StringHashTable.check_type = (int (*)(struct __pyx_obj_6pandas_3lib_StringHashTable *, PyObject *))__pyx_f_6pandas_3lib_15StringHashTable_check_type;
  __pyx_vtable_6pandas_3lib_StringHashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_StringHashTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_15StringHashTable_get_item;
  __pyx_vtable_6pandas_3lib_StringHashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_StringHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_15StringHashTable_set_item;
  __pyx_type_6pandas_3lib_StringHashTable.tp_base = __pyx_ptype_6pandas_3lib_HashTable;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_StringHashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_StringHashTable.tp_dict, __pyx_vtabptr_6pandas_3lib_StringHashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "StringHashTable", (PyObject *)&__pyx_type_6pandas_3lib_StringHashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_StringHashTable = &__pyx_type_6pandas_3lib_StringHashTable;
  __pyx_vtabptr_6pandas_3lib_Int32HashTable = &__pyx_vtable_6pandas_3lib_Int32HashTable;
  __pyx_vtable_6pandas_3lib_Int32HashTable.check_type = (int (*)(struct __pyx_obj_6pandas_3lib_Int32HashTable *, PyObject *))__pyx_f_6pandas_3lib_14Int32HashTable_check_type;
  __pyx_vtable_6pandas_3lib_Int32HashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Int32HashTable *, __pyx_t_5numpy_int32_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_14Int32HashTable_get_item;
  __pyx_vtable_6pandas_3lib_Int32HashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Int32HashTable *, __pyx_t_5numpy_int32_t, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_14Int32HashTable_set_item;
  __pyx_type_6pandas_3lib_Int32HashTable.tp_base = __pyx_ptype_6pandas_3lib_HashTable;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Int32HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Int32HashTable.tp_dict, __pyx_vtabptr_6pandas_3lib_Int32HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Int32HashTable", (PyObject *)&__pyx_type_6pandas_3lib_Int32HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Int32HashTable = &__pyx_type_6pandas_3lib_Int32HashTable;
  __pyx_vtabptr_6pandas_3lib_Int64HashTable = &__pyx_vtable_6pandas_3lib_Int64HashTable;
  __pyx_vtable_6pandas_3lib_Int64HashTable.has_key = (int (*)(struct __pyx_obj_6pandas_3lib_Int64HashTable *, __pyx_t_5numpy_int64_t))__pyx_f_6pandas_3lib_14Int64HashTable_has_key;
  __pyx_vtable_6pandas_3lib_Int64HashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Int64HashTable *, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_14Int64HashTable_get_item;
  __pyx_vtable_6pandas_3lib_Int64HashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Int64HashTable *, __pyx_t_5numpy_int64_t, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_14Int64HashTable_set_item;
  __pyx_type_6pandas_3lib_Int64HashTable.tp_base = __pyx_ptype_6pandas_3lib_HashTable;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Int64HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Int64HashTable.tp_dict, __pyx_vtabptr_6pandas_3lib_Int64HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Int64HashTable", (PyObject *)&__pyx_type_6pandas_3lib_Int64HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Int64HashTable = &__pyx_type_6pandas_3lib_Int64HashTable;
  __pyx_vtabptr_6pandas_3lib_Float64HashTable = &__pyx_vtable_6pandas_3lib_Float64HashTable;
  __pyx_vtable_6pandas_3lib_Float64HashTable.get_labels = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Float64HashTable *, PyArrayObject *, PyObject *, Py_ssize_t, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_16Float64HashTable_get_labels;
  __pyx_type_6pandas_3lib_Float64HashTable.tp_base = __pyx_ptype_6pandas_3lib_HashTable;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Float64HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Float64HashTable.tp_dict, __pyx_vtabptr_6pandas_3lib_Float64HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Float64HashTable", (PyObject *)&__pyx_type_6pandas_3lib_Float64HashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Float64HashTable = &__pyx_type_6pandas_3lib_Float64HashTable;
  __pyx_vtabptr_6pandas_3lib_PyObjectHashTable = &__pyx_vtable_6pandas_3lib_PyObjectHashTable;
  __pyx_vtable_6pandas_3lib_PyObjectHashTable.destroy = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_17PyObjectHashTable_destroy;
  __pyx_vtable_6pandas_3lib_PyObjectHashTable.get_item = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_17PyObjectHashTable_get_item;
  __pyx_vtable_6pandas_3lib_PyObjectHashTable.set_item = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *, PyObject *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_17PyObjectHashTable_set_item;
  __pyx_vtable_6pandas_3lib_PyObjectHashTable.get_labels = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_PyObjectHashTable *, PyArrayObject *, PyObject *, Py_ssize_t, __pyx_t_5numpy_int64_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_17PyObjectHashTable_get_labels;
  __pyx_type_6pandas_3lib_PyObjectHashTable.tp_base = __pyx_ptype_6pandas_3lib_HashTable;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_PyObjectHashTable.tp_dict, __pyx_vtabptr_6pandas_3lib_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "PyObjectHashTable", (PyObject *)&__pyx_type_6pandas_3lib_PyObjectHashTable) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_PyObjectHashTable = &__pyx_type_6pandas_3lib_PyObjectHashTable;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Factorizer) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Factorizer", (PyObject *)&__pyx_type_6pandas_3lib_Factorizer) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Factorizer = &__pyx_type_6pandas_3lib_Factorizer;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Int64Factorizer) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Int64Factorizer", (PyObject *)&__pyx_type_6pandas_3lib_Int64Factorizer) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Int64Factorizer = &__pyx_type_6pandas_3lib_Int64Factorizer;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_DictFactorizer) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "DictFactorizer", (PyObject *)&__pyx_type_6pandas_3lib_DictFactorizer) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_DictFactorizer = &__pyx_type_6pandas_3lib_DictFactorizer;
  __pyx_ptype_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_8datetime_datetime)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_6pandas_3lib__Timestamp = &__pyx_vtable_6pandas_3lib__Timestamp;
  __pyx_vtable_6pandas_3lib__Timestamp._get_field = (PyObject *(*)(struct __pyx_obj_6pandas_3lib__Timestamp *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_10_Timestamp__get_field;
  __pyx_type_6pandas_3lib__Timestamp.tp_base = __pyx_ptype_8datetime_datetime;
  if (PyType_Ready(&__pyx_type_6pandas_3lib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib__Timestamp.tp_dict, __pyx_vtabptr_6pandas_3lib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_Timestamp", (PyObject *)&__pyx_type_6pandas_3lib__Timestamp) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib__Timestamp = &__pyx_type_6pandas_3lib__Timestamp;
  __pyx_vtabptr_6pandas_3lib__NaT = &__pyx_vtable_6pandas_3lib__NaT;
  __pyx_vtable_6pandas_3lib__NaT.__pyx_base = *__pyx_vtabptr_6pandas_3lib__Timestamp;
  __pyx_type_6pandas_3lib__NaT.tp_base = __pyx_ptype_6pandas_3lib__Timestamp;
  if (PyType_Ready(&__pyx_type_6pandas_3lib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib__NaT.tp_dict, __pyx_vtabptr_6pandas_3lib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_NaT", (PyObject *)&__pyx_type_6pandas_3lib__NaT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib__NaT = &__pyx_type_6pandas_3lib__NaT;
  if (PyType_Ready(&__pyx_type_6pandas_3lib__TSObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_TSObject", (PyObject *)&__pyx_type_6pandas_3lib__TSObject) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib__TSObject = &__pyx_type_6pandas_3lib__TSObject;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Node) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Node", (PyObject *)&__pyx_type_6pandas_3lib_Node) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Node = &__pyx_type_6pandas_3lib_Node;
  __pyx_vtabptr_6pandas_3lib_IndexableSkiplist = &__pyx_vtable_6pandas_3lib_IndexableSkiplist;
  __pyx_vtable_6pandas_3lib_IndexableSkiplist.get = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_17IndexableSkiplist_get;
  __pyx_vtable_6pandas_3lib_IndexableSkiplist.insert = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *, double, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_17IndexableSkiplist_insert;
  __pyx_vtable_6pandas_3lib_IndexableSkiplist.remove = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexableSkiplist *, double, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_17IndexableSkiplist_remove;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_IndexableSkiplist.tp_dict, __pyx_vtabptr_6pandas_3lib_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "IndexableSkiplist", (PyObject *)&__pyx_type_6pandas_3lib_IndexableSkiplist) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_IndexableSkiplist = &__pyx_type_6pandas_3lib_IndexableSkiplist;
  if (PyType_Ready(&__pyx_type_6pandas_3lib__PandasNull) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "_PandasNull", (PyObject *)&__pyx_type_6pandas_3lib__PandasNull) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib__PandasNull = &__pyx_type_6pandas_3lib__PandasNull;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Reducer) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Reducer", (PyObject *)&__pyx_type_6pandas_3lib_Reducer) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Reducer = &__pyx_type_6pandas_3lib_Reducer;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_SeriesBinGrouper) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "SeriesBinGrouper", (PyObject *)&__pyx_type_6pandas_3lib_SeriesBinGrouper) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_SeriesBinGrouper = &__pyx_type_6pandas_3lib_SeriesBinGrouper;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_SeriesGrouper) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "SeriesGrouper", (PyObject *)&__pyx_type_6pandas_3lib_SeriesGrouper) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_SeriesGrouper = &__pyx_type_6pandas_3lib_SeriesGrouper;
  __pyx_vtabptr_6pandas_3lib_Slider = &__pyx_vtable_6pandas_3lib_Slider;
  __pyx_vtable_6pandas_3lib_Slider.advance = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_advance;
  __pyx_vtable_6pandas_3lib_Slider.set_length = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_set_length;
  __pyx_vtable_6pandas_3lib_Slider.cleanup = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_Slider *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_6Slider_cleanup;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Slider.tp_dict, __pyx_vtabptr_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Slider", (PyObject *)&__pyx_type_6pandas_3lib_Slider) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Slider = &__pyx_type_6pandas_3lib_Slider;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_cache_readonly) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "cache_readonly", (PyObject *)&__pyx_type_6pandas_3lib_cache_readonly) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_cache_readonly = &__pyx_type_6pandas_3lib_cache_readonly;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_AxisProperty) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "AxisProperty", (PyObject *)&__pyx_type_6pandas_3lib_AxisProperty) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_AxisProperty = &__pyx_type_6pandas_3lib_AxisProperty;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_SeriesIndex) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "SeriesIndex", (PyObject *)&__pyx_type_6pandas_3lib_SeriesIndex) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_SeriesIndex = &__pyx_type_6pandas_3lib_SeriesIndex;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_ValuesProperty) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "ValuesProperty", (PyObject *)&__pyx_type_6pandas_3lib_ValuesProperty) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_ValuesProperty = &__pyx_type_6pandas_3lib_ValuesProperty;
  __pyx_vtabptr_6pandas_3lib_IndexEngine = &__pyx_vtable_6pandas_3lib_IndexEngine;
  __pyx_vtable_6pandas_3lib_IndexEngine.get_value = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_11IndexEngine_get_value;
  __pyx_vtable_6pandas_3lib_IndexEngine.set_value = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyArrayObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_11IndexEngine_set_value;
  __pyx_vtable_6pandas_3lib_IndexEngine.get_loc = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_11IndexEngine_get_loc;
  __pyx_vtable_6pandas_3lib_IndexEngine._get_loc_duplicates = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *))__pyx_f_6pandas_3lib_11IndexEngine__get_loc_duplicates;
  __pyx_vtable_6pandas_3lib_IndexEngine._maybe_get_bool_indexer = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *))__pyx_f_6pandas_3lib_11IndexEngine__maybe_get_bool_indexer;
  __pyx_vtable_6pandas_3lib_IndexEngine._do_monotonic_check = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *))__pyx_f_6pandas_3lib_11IndexEngine__do_monotonic_check;
  __pyx_vtable_6pandas_3lib_IndexEngine._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *))__pyx_f_6pandas_3lib_11IndexEngine__get_index_values;
  __pyx_vtable_6pandas_3lib_IndexEngine._do_unique_check = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *))__pyx_f_6pandas_3lib_11IndexEngine__do_unique_check;
  __pyx_vtable_6pandas_3lib_IndexEngine._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *))__pyx_f_6pandas_3lib_11IndexEngine__make_hash_table;
  __pyx_vtable_6pandas_3lib_IndexEngine._check_type = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *))__pyx_f_6pandas_3lib_11IndexEngine__check_type;
  __pyx_vtable_6pandas_3lib_IndexEngine._ensure_mapping_populated = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *))__pyx_f_6pandas_3lib_11IndexEngine__ensure_mapping_populated;
  __pyx_vtable_6pandas_3lib_IndexEngine.initialize = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *))__pyx_f_6pandas_3lib_11IndexEngine_initialize;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_IndexEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_IndexEngine.tp_dict, __pyx_vtabptr_6pandas_3lib_IndexEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "IndexEngine", (PyObject *)&__pyx_type_6pandas_3lib_IndexEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_IndexEngine = &__pyx_type_6pandas_3lib_IndexEngine;
  __pyx_vtabptr_6pandas_3lib_Int64Engine = &__pyx_vtable_6pandas_3lib_Int64Engine;
  __pyx_vtable_6pandas_3lib_Int64Engine.__pyx_base = *__pyx_vtabptr_6pandas_3lib_IndexEngine;
  __pyx_vtable_6pandas_3lib_Int64Engine.__pyx_base._maybe_get_bool_indexer = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *))__pyx_f_6pandas_3lib_11Int64Engine__maybe_get_bool_indexer;
  __pyx_vtable_6pandas_3lib_Int64Engine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *))__pyx_f_6pandas_3lib_11Int64Engine__make_hash_table;
  __pyx_type_6pandas_3lib_Int64Engine.tp_base = __pyx_ptype_6pandas_3lib_IndexEngine;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Int64Engine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Int64Engine.tp_dict, __pyx_vtabptr_6pandas_3lib_Int64Engine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Int64Engine", (PyObject *)&__pyx_type_6pandas_3lib_Int64Engine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Int64Engine = &__pyx_type_6pandas_3lib_Int64Engine;
  __pyx_vtabptr_6pandas_3lib_Float64Engine = &__pyx_vtable_6pandas_3lib_Float64Engine;
  __pyx_vtable_6pandas_3lib_Float64Engine.__pyx_base = *__pyx_vtabptr_6pandas_3lib_IndexEngine;
  __pyx_vtable_6pandas_3lib_Float64Engine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *))__pyx_f_6pandas_3lib_13Float64Engine__make_hash_table;
  __pyx_type_6pandas_3lib_Float64Engine.tp_base = __pyx_ptype_6pandas_3lib_IndexEngine;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_Float64Engine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_Float64Engine.tp_dict, __pyx_vtabptr_6pandas_3lib_Float64Engine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Float64Engine", (PyObject *)&__pyx_type_6pandas_3lib_Float64Engine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_Float64Engine = &__pyx_type_6pandas_3lib_Float64Engine;
  __pyx_vtabptr_6pandas_3lib_ObjectEngine = &__pyx_vtable_6pandas_3lib_ObjectEngine;
  __pyx_vtable_6pandas_3lib_ObjectEngine.__pyx_base = *__pyx_vtabptr_6pandas_3lib_IndexEngine;
  __pyx_vtable_6pandas_3lib_ObjectEngine.__pyx_base._make_hash_table = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *))__pyx_f_6pandas_3lib_12ObjectEngine__make_hash_table;
  __pyx_type_6pandas_3lib_ObjectEngine.tp_base = __pyx_ptype_6pandas_3lib_IndexEngine;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_ObjectEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_ObjectEngine.tp_dict, __pyx_vtabptr_6pandas_3lib_ObjectEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "ObjectEngine", (PyObject *)&__pyx_type_6pandas_3lib_ObjectEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_ObjectEngine = &__pyx_type_6pandas_3lib_ObjectEngine;
  __pyx_vtabptr_6pandas_3lib_DatetimeEngine = &__pyx_vtable_6pandas_3lib_DatetimeEngine;
  __pyx_vtable_6pandas_3lib_DatetimeEngine.__pyx_base = *__pyx_vtabptr_6pandas_3lib_Int64Engine;
  __pyx_vtable_6pandas_3lib_DatetimeEngine.__pyx_base.__pyx_base.get_loc = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6pandas_3lib_14DatetimeEngine_get_loc;
  __pyx_vtable_6pandas_3lib_DatetimeEngine.__pyx_base.__pyx_base._get_index_values = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_IndexEngine *))__pyx_f_6pandas_3lib_14DatetimeEngine__get_index_values;
  __pyx_vtable_6pandas_3lib_DatetimeEngine._date_check_type = (PyObject *(*)(struct __pyx_obj_6pandas_3lib_DatetimeEngine *, PyObject *))__pyx_f_6pandas_3lib_14DatetimeEngine__date_check_type;
  __pyx_type_6pandas_3lib_DatetimeEngine.tp_base = __pyx_ptype_6pandas_3lib_Int64Engine;
  if (PyType_Ready(&__pyx_type_6pandas_3lib_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pandas_3lib_DatetimeEngine.tp_dict, __pyx_vtabptr_6pandas_3lib_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "DatetimeEngine", (PyObject *)&__pyx_type_6pandas_3lib_DatetimeEngine) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib_DatetimeEngine = &__pyx_type_6pandas_3lib_DatetimeEngine;
  if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct__try_parse_dates) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib___pyx_scope_struct__try_parse_dates = &__pyx_type_6pandas_3lib___pyx_scope_struct__try_parse_dates;
  if (PyType_Ready(&__pyx_type_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time = &__pyx_type_6pandas_3lib___pyx_scope_struct_1_try_parse_date_and_time;
  /*--- Type import code ---*/
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_8datetime_date)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_8datetime_timedelta)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "pandas/src/tseries.pyx":3
 * cimport numpy as np
 * cimport cython
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * from numpy cimport *
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":11
 * from numpy cimport NPY_FLOAT64 as NPY_float64
 * 
 * int32 = np.dtype(np.int32)             # <<<<<<<<<<<<<<
 * int64 = np.dtype(np.int64)
 * float32 = np.dtype(np.float32)
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__int32, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":12
 * 
 * int32 = np.dtype(np.int32)
 * int64 = np.dtype(np.int64)             # <<<<<<<<<<<<<<
 * float32 = np.dtype(np.float32)
 * float64 = np.dtype(np.float64)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__int64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":13
 * int32 = np.dtype(np.int32)
 * int64 = np.dtype(np.int64)
 * float32 = np.dtype(np.float32)             # <<<<<<<<<<<<<<
 * float64 = np.dtype(np.float64)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__float32, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":14
 * int64 = np.dtype(np.int64)
 * float32 = np.dtype(np.float32)
 * float64 = np.dtype(np.float64)             # <<<<<<<<<<<<<<
 * 
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__float64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":16
 * float64 = np.dtype(np.float64)
 * 
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min             # <<<<<<<<<<<<<<
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min
 * cdef np.float32_t MINfloat32 = np.NINF
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_3lib_MINint32 = __pyx_t_4;

  /* "pandas/src/tseries.pyx":17
 * 
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min             # <<<<<<<<<<<<<<
 * cdef np.float32_t MINfloat32 = np.NINF
 * cdef np.float64_t MINfloat64 = np.NINF
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_3lib_MINint64 = __pyx_t_5;

  /* "pandas/src/tseries.pyx":18
 * cdef np.int32_t MINint32 = np.iinfo(np.int32).min
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min
 * cdef np.float32_t MINfloat32 = np.NINF             # <<<<<<<<<<<<<<
 * cdef np.float64_t MINfloat64 = np.NINF
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__NINF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_3lib_MINfloat32 = __pyx_t_6;

  /* "pandas/src/tseries.pyx":19
 * cdef np.int64_t MINint64 = np.iinfo(np.int64).min
 * cdef np.float32_t MINfloat32 = np.NINF
 * cdef np.float64_t MINfloat64 = np.NINF             # <<<<<<<<<<<<<<
 * 
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__NINF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_3lib_MINfloat64 = __pyx_t_7;

  /* "pandas/src/tseries.pyx":21
 * cdef np.float64_t MINfloat64 = np.NINF
 * 
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max             # <<<<<<<<<<<<<<
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max
 * cdef np.float32_t MAXfloat32 = np.inf
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_3lib_MAXint32 = __pyx_t_4;

  /* "pandas/src/tseries.pyx":22
 * 
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max             # <<<<<<<<<<<<<<
 * cdef np.float32_t MAXfloat32 = np.inf
 * cdef np.float64_t MAXfloat64 = np.inf
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__iinfo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyInt_from_py_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_3lib_MAXint64 = __pyx_t_5;

  /* "pandas/src/tseries.pyx":23
 * cdef np.int32_t MAXint32 = np.iinfo(np.int32).max
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max
 * cdef np.float32_t MAXfloat32 = np.inf             # <<<<<<<<<<<<<<
 * cdef np.float64_t MAXfloat64 = np.inf
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_3lib_MAXfloat32 = __pyx_t_6;

  /* "pandas/src/tseries.pyx":24
 * cdef np.int64_t MAXint64 = np.iinfo(np.int64).max
 * cdef np.float32_t MAXfloat32 = np.inf
 * cdef np.float64_t MAXfloat64 = np.inf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_3lib_MAXfloat64 = __pyx_t_7;

  /* "pandas/src/tseries.pyx":39
 * cimport cpython
 * 
 * isnan = np.isnan             # <<<<<<<<<<<<<<
 * cdef double NaN = <double> np.NaN
 * cdef double nan = NaN
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__isnan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__isnan, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":40
 * 
 * isnan = np.isnan
 * cdef double NaN = <double> np.NaN             # <<<<<<<<<<<<<<
 * cdef double nan = NaN
 * cdef double NAN = nan
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__NaN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_6pandas_3lib_NaN = ((double)__pyx_t_8);

  /* "pandas/src/tseries.pyx":41
 * isnan = np.isnan
 * cdef double NaN = <double> np.NaN
 * cdef double nan = NaN             # <<<<<<<<<<<<<<
 * cdef double NAN = nan
 * 
 */
  __pyx_v_6pandas_3lib_nan = __pyx_v_6pandas_3lib_NaN;

  /* "pandas/src/tseries.pyx":42
 * cdef double NaN = <double> np.NaN
 * cdef double nan = NaN
 * cdef double NAN = nan             # <<<<<<<<<<<<<<
 * 
 * from datetime import datetime as pydatetime
 */
  __pyx_v_6pandas_3lib_NAN = __pyx_v_6pandas_3lib_nan;

  /* "pandas/src/tseries.pyx":44
 * cdef double NAN = nan
 * 
 * from datetime import datetime as pydatetime             # <<<<<<<<<<<<<<
 * 
 * # this is our datetime.pxd
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__datetime));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__datetime));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pydatetime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":49
 * from datetime cimport *
 * 
 * cdef int64_t NPY_NAT = util.get_nat()             # <<<<<<<<<<<<<<
 * 
 * from khash cimport *
 */
  __pyx_v_6pandas_3lib_NPY_NAT = get_nat();

  /* "pandas/src/tseries.pyx":66
 * 
 * # import datetime C API
 * PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # initialize numpy
 */
  PyDateTime_IMPORT;

  /* "pandas/src/tseries.pyx":69
 * 
 * # initialize numpy
 * import_array()             # <<<<<<<<<<<<<<
 * import_ufunc()
 * 
 */
  import_array();

  /* "pandas/src/tseries.pyx":70
 * # initialize numpy
 * import_array()
 * import_ufunc()             # <<<<<<<<<<<<<<
 * 
 * cpdef map_indices_list(list index):
 */
  import_ufunc();

  /* "pandas/src/tseries.pyx":95
 * from libc.stdlib cimport malloc, free
 * 
 * def ismember(ndarray arr, set values):             # <<<<<<<<<<<<<<
 *     '''
 *     Checks whether
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_1ismember, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ismember, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":130
 * # datetime / io related
 * 
 * cdef int _EPOCH_ORD = 719163             # <<<<<<<<<<<<<<
 * 
 * from datetime import date as pydate
 */
  __pyx_v_6pandas_3lib__EPOCH_ORD = 719163;

  /* "pandas/src/tseries.pyx":132
 * cdef int _EPOCH_ORD = 719163
 * 
 * from datetime import date as pydate             # <<<<<<<<<<<<<<
 * 
 * cdef inline int64_t gmtime(object date):
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__date));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__date));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__date));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__date); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pydate, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":153
 *     return gmtime(dt)
 * 
 * def array_to_timestamp(ndarray[object, ndim=1] arr):             # <<<<<<<<<<<<<<
 *     cdef int i, n
 *     cdef ndarray[int64_t, ndim=1] result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_4array_to_timestamp, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__array_to_timestamp, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":165
 *     return result
 * 
 * def time64_to_datetime(ndarray[int64_t, ndim=1] arr):             # <<<<<<<<<<<<<<
 *     cdef int i, n
 *     cdef ndarray[object, ndim=1] result
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_5time64_to_datetime, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__time64_to_datetime, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pandas/src/tseries.pyx":180
 * # isnull / notnull related
 * 
 * cdef double INF = <double> np.inf             # <<<<<<<<<<<<<<
 * cdef double NEGINF = -INF
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6pandas_3lib_INF = ((double)__pyx_t_8);

  /* "pandas/src/tseries.pyx":181
 * 
 * cdef double INF = <double> np.inf
 * cdef double NEGINF = -INF             # <<<<<<<<<<<<<<
 * 
 * cpdef checknull(object val):
 */
  __pyx_v_6pandas_3lib_NEGINF = (-__pyx_v_6pandas_3lib_INF);

  /* "pandas/src/tseries.pyx":195
 *         return util._checknull(val)
 * 
 * def isscalar(object val):             # <<<<<<<<<<<<<<
 *     return np.isscalar(val) or val is None or isinstance(val, _Timestamp)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_7isscalar, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__isscalar, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":201
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def isnullobj(ndarray[object] arr):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, n
 *     cdef object val
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_8isnullobj, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__isnullobj, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":215
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def isnullobj2d(ndarray[object, ndim=2] arr):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i, j, n, m
 *     cdef object val
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_9isnullobj2d, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__isnullobj2d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":229
 *     return result.view(np.bool_)
 * 
 * def list_to_object_array(list obj):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert list to object ndarray. Seriously can't believe I had to write this
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_10list_to_object_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":249
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def fast_unique(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_11fast_unique, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fast_unique, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":270
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def fast_unique_multiple(list arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ndarray[object] buf
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_12fast_unique_multiple, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_203, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":296
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def fast_unique_multiple_list(list lists):             # <<<<<<<<<<<<<<
 *     cdef:
 *         list buf
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_13fast_unique_multiple_list, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_204, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":322
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def fast_unique_multiple_list_gen(object gen):             # <<<<<<<<<<<<<<
 *     cdef:
 *         list buf
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_14fast_unique_multiple_list_gen, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_205, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":347
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def dicts_to_array(list dicts, list columns):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, n
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_15dicts_to_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dicts_to_array, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":371
 * 
 * 
 * def fast_zip(list ndarrays):             # <<<<<<<<<<<<<<
 *     '''
 *     For zipping multiple ndarrays into an ndarray of tuples
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_16fast_zip, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fast_zip, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":412
 *     return result
 * 
 * def get_reverse_indexer(ndarray[int64_t] indexer, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_17get_reverse_indexer, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_reverse_indexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":428
 * 
 * 
 * def has_infs_f4(ndarray[float32_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(arr)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_18has_infs_f4, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__has_infs_f4, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":442
 *     return False
 * 
 * def has_infs_f8(ndarray[float64_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(arr)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_19has_infs_f8, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__has_infs_f8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":456
 *     return False
 * 
 * def convert_timestamps(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object val, f, result
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_20convert_timestamps, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__convert_timestamps, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":479
 *     return out
 * 
 * def maybe_indices_to_slice(ndarray[int64_t] indices):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indices)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_21maybe_indices_to_slice, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_206, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":492
 * 
 * 
 * def maybe_booleans_to_slice(ndarray[uint8_t] mask):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(mask)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_22maybe_booleans_to_slice, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_207, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":523
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def scalar_compare(ndarray[object] values, object val, object op):             # <<<<<<<<<<<<<<
 *     import operator
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_23scalar_compare, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__scalar_compare, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":567
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def vec_compare(ndarray[object] left, ndarray[object] right, object op):             # <<<<<<<<<<<<<<
 *     import operator
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_24vec_compare, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__vec_compare, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":619
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def scalar_binop(ndarray[object] values, object val, object op):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_25scalar_binop, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__scalar_binop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":638
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def vec_binop(ndarray[object] left, ndarray[object] right, object op):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(left)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_26vec_binop, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__vec_binop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":665
 * 
 * 
 * def value_count_int64(ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_27value_count_int64, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__value_count_int64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":9
 * cimport util
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * ONAN = np.nan
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":11
 * import numpy as np
 * 
 * ONAN = np.nan             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__nan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ONAN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":14
 * 
 * 
 * def list_to_object_array(list obj):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert list to object ndarray. Seriously can't believe I had to write this
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_28list_to_object_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_10, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":531
 *         return result
 * 
 * def value_count_int64(ndarray[int64_t] values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_29value_count_int64, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__value_count_int64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":857
 *         return self.count
 * 
 *     def factorize(self, ndarray[object] values, sort=False, na_sentinel=-1):             # <<<<<<<<<<<<<<
 *         labels, counts = self.table.get_labels(values, self.uniques,
 *                                                self.count, na_sentinel)
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_9 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":894
 *         return self.count
 * 
 *     def factorize(self, ndarray[int64_t] values, sort=False,             # <<<<<<<<<<<<<<
 *                   na_sentinel=-1):
 *         labels, counts = self.table.get_labels(values, self.uniques,
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_11 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":966
 *         return labels, counts[:count].copy()
 * 
 *     def factorize(self, ndarray[object] values, sort=False):             # <<<<<<<<<<<<<<
 *         labels, counts = self.get_labels(values)
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_12 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/hashtable.pyx":1013
 *         return self.uniques
 * 
 * def lookup2(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_30lookup2, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__lookup2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":3
 * # cython: profile=False
 * cimport numpy as np
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * from numpy cimport int32_t, int64_t, import_array, ndarray
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":12
 * from util cimport is_integer_object, is_datetime64_object
 * 
 * from datetime import timedelta             # <<<<<<<<<<<<<<
 * from dateutil.parser import parse as parse_date
 * cimport util
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__timedelta));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__timedelta));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__timedelta));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__datetime), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":13
 * 
 * from datetime import timedelta
 * from dateutil.parser import parse as parse_date             # <<<<<<<<<<<<<<
 * cimport util
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__parse));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__parse));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__parse));
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_48), ((PyObject *)__pyx_t_2), -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__parse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__parse_date, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":20
 * 
 * # initialize numpy
 * import_array()             # <<<<<<<<<<<<<<
 * #import_ufunc()
 * 
 */
  import_array();

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":24
 * 
 * # import datetime C API
 * PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # in numpy 1.7, will prob need the following:
 */
  PyDateTime_IMPORT;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":29
 * # numpy_pydatetime_import
 * 
 * try:             # <<<<<<<<<<<<<<
 *     basestring
 * except NameError: # py3
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":30
 * 
 * try:
 *     basestring             # <<<<<<<<<<<<<<
 * except NameError: # py3
 *     basestring = str
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__basestring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L9_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":31
 * try:
 *     basestring
 * except NameError: # py3             # <<<<<<<<<<<<<<
 *     basestring = str
 * 
 */
    __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_NameError);
    if (__pyx_t_12) {
      __Pyx_AddTraceback("pandas.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":32
 *     basestring
 * except NameError: # py3
 *     basestring = str             # <<<<<<<<<<<<<<
 * 
 * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None):
 */
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__basestring, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L3_exception_handled;
    }
    __pyx_L4_except_error:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    __pyx_L9_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":34
 *     basestring = str
 * 
 * def ints_to_pydatetime(ndarray[int64_t] arr, tz=None):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(arr)
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_31ints_to_pydatetime, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ints_to_pydatetime, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":71
 * # Python front end to C extension type _Timestamp
 * # This serves as the box for datetime64
 * class Timestamp(_Timestamp):             # <<<<<<<<<<<<<<
 * 
 *     def __new__(cls, object ts_input, object offset=None, tz=None):
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":73
 * class Timestamp(_Timestamp):
 * 
 *     def __new__(cls, object ts_input, object offset=None, tz=None):             # <<<<<<<<<<<<<<
 *         cdef _TSObject ts
 *         cdef _Timestamp ts_base
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp___new__, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s____new__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":104
 *         return ts_base
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         result = self._repr_base
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_1__repr__, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s____repr__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":120
 * 
 *     @property
 *     def _repr_base(self):             # <<<<<<<<<<<<<<
 *         result = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (self.year, self.month,
 *                                                   self.day, self.hour,
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_2_repr_base, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s___repr_base, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":119
 *         return '<Timestamp: %s>' % result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def _repr_base(self):
 *         result = '%d-%.2d-%.2d %.2d:%.2d:%.2d' % (self.year, self.month,
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s___repr_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s___repr_base, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":134
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         """
 *         Alias for tzinfo
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_3tz, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__tz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":133
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def tz(self):
 *         """
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__tz); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__tz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":141
 * 
 *     @property
 *     def freq(self):             # <<<<<<<<<<<<<<
 *         return self.offset
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_4freq, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__freq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":140
 *         return self.tzinfo
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def freq(self):
 *         return self.offset
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__freq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":144
 *         return self.offset
 * 
 *     def __setstate__(self, state):             # <<<<<<<<<<<<<<
 *         self.value = state[0]
 *         self.offset = state[1]
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_5__setstate__, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s____setstate__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":149
 *         self.tzinfo = state[2]
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         object_state = self.value, self.offset, self.tzinfo
 *         return (Timestamp, object_state)
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_6__reduce__, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s____reduce__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":153
 *         return (Timestamp, object_state)
 * 
 *     def to_period(self, freq=None):             # <<<<<<<<<<<<<<
 *         """
 *         Return an period of which this timestamp is an observation.
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_7to_period, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__to_period, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":165
 * 
 *     @property
 *     def dayofweek(self):             # <<<<<<<<<<<<<<
 *         return self.weekday()
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_8dayofweek, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__dayofweek, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":164
 *         return Period(self, freq=freq)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dayofweek(self):
 *         return self.weekday()
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__dayofweek); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__dayofweek, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":169
 * 
 *     @property
 *     def dayofyear(self):             # <<<<<<<<<<<<<<
 *         return self.day
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_9dayofyear, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__dayofyear, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":168
 *         return self.weekday()
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def dayofyear(self):
 *         return self.day
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__dayofyear); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__dayofyear, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":173
 * 
 *     @property
 *     def week(self):             # <<<<<<<<<<<<<<
 *         return self._get_field('woy')
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_10week, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__week, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":172
 *         return self.day
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def week(self):
 *         return self._get_field('woy')
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__week); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__week, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":176
 *         return self._get_field('woy')
 * 
 *     weekofyear = week             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__week); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__weekofyear, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":179
 * 
 *     @property
 *     def quarter(self):             # <<<<<<<<<<<<<<
 *         return self._get_field('q')
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_11quarter, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__quarter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":178
 *     weekofyear = week
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def quarter(self):
 *         return self._get_field('q')
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__quarter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__quarter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":183
 * 
 *     @property
 *     def freqstr(self):             # <<<<<<<<<<<<<<
 *         return getattr(self.offset, 'freqstr', self.offset)
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_12freqstr, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__freqstr, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":182
 *         return self._get_field('q')
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def freqstr(self):
 *         return getattr(self.offset, 'freqstr', self.offset)
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__freqstr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__freqstr, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":187
 * 
 *     @property
 *     def asm8(self):             # <<<<<<<<<<<<<<
 *         return np.int64(self.value).view('M8[ns]')
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_13asm8, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__asm8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":186
 *         return getattr(self.offset, 'freqstr', self.offset)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def asm8(self):
 *         return np.int64(self.value).view('M8[ns]')
 */
  __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s__asm8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_property, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__asm8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":190
 *         return np.int64(self.value).view('M8[ns]')
 * 
 *     def tz_localize(self, tz):             # <<<<<<<<<<<<<<
 *         """
 *         Convert naive Timestamp to local time zone
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_14tz_localize, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__tz_localize, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":209
 *                             'tz_convert for conversions')
 * 
 *     def tz_convert(self, tz):             # <<<<<<<<<<<<<<
 *         """
 *         Convert Timestamp to another time zone or localize to requested time
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_15tz_convert, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__tz_convert, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":230
 *             return Timestamp(self.value, tz=tz)
 * 
 *     def replace(self, **kwds):             # <<<<<<<<<<<<<<
 *         return Timestamp(datetime.replace(self, **kwds),
 *                          offset=self.offset)
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_16replace, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__replace, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":234
 *                          offset=self.offset)
 * 
 *     def to_pydatetime(self, warn=True):             # <<<<<<<<<<<<<<
 *         """
 *         If warn=True, issue warning if nanoseconds is nonzero
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_32 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_9Timestamp_17to_pydatetime, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__to_pydatetime, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":71
 * # Python front end to C extension type _Timestamp
 * # This serves as the box for datetime64
 * class Timestamp(_Timestamp):             # <<<<<<<<<<<<<<
 * 
 *     def __new__(cls, object ts_input, object offset=None, tz=None):
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__Timestamp)));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__Timestamp)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__Timestamp)));
  __pyx_t_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3), __pyx_n_s__Timestamp, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Timestamp, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":251
 * 
 * 
 * class NaTType(_NaT):             # <<<<<<<<<<<<<<
 * 
 *     def __new__(cls):
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":253
 * class NaTType(_NaT):
 * 
 *     def __new__(cls):             # <<<<<<<<<<<<<<
 *         cdef _NaT base
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_7NaTType___new__, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s____new__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":262
 *         return base
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'NaT'
 * 
 */
  __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_7NaTType_1__repr__, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s____repr__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":265
 *         return 'NaT'
 * 
 *     def weekday(self):             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
  __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_7NaTType_2weekday, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__weekday, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":268
 *         return -1
 * 
 *     def toordinal(self):             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
  __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pandas_3lib_7NaTType_3toordinal, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s__toordinal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":251
 * 
 * 
 * class NaTType(_NaT):             # <<<<<<<<<<<<<<
 * 
 *     def __new__(cls):
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__NaT)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__NaT)));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__NaT)));
  __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3), __pyx_n_s__NaTType, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NaTType, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":271
 *         return -1
 * 
 * fields = ['year', 'quarter', 'month', 'day', 'hour',             # <<<<<<<<<<<<<<
 *           'minute', 'second', 'microsecond', 'nanosecond',
 *           'week', 'dayofyear']
 */
  __pyx_t_3 = PyList_New(11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__year));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__year));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__year));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__quarter));
  PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__quarter));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__quarter));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__month));
  PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__month));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__month));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__day));
  PyList_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__day));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__day));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__hour));
  PyList_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_n_s__hour));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__hour));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__minute));
  PyList_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_n_s__minute));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__minute));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__second));
  PyList_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_n_s__second));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__second));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__microsecond));
  PyList_SET_ITEM(__pyx_t_3, 7, ((PyObject *)__pyx_n_s__microsecond));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__microsecond));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__nanosecond));
  PyList_SET_ITEM(__pyx_t_3, 8, ((PyObject *)__pyx_n_s__nanosecond));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__nanosecond));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__week));
  PyList_SET_ITEM(__pyx_t_3, 9, ((PyObject *)__pyx_n_s__week));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__week));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__dayofyear));
  PyList_SET_ITEM(__pyx_t_3, 10, ((PyObject *)__pyx_n_s__dayofyear));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dayofyear));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fields, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":274
 *           'minute', 'second', 'microsecond', 'nanosecond',
 *           'week', 'dayofyear']
 * for field in fields:             # <<<<<<<<<<<<<<
 *     prop = property(fget=lambda self: -1)
 *     setattr(NaTType, field, prop)
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__fields); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0;
    __pyx_t_14 = NULL;
  } else {
    __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (PyList_CheckExact(__pyx_t_2)) {
      if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++;
    } else if (PyTuple_CheckExact(__pyx_t_2)) {
      if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++;
    } else {
      __pyx_t_3 = __pyx_t_14(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__field, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":275
 *           'week', 'dayofyear']
 * for field in fields:
 *     prop = property(fget=lambda self: -1)             # <<<<<<<<<<<<<<
 *     setattr(NaTType, field, prop)
 * 
 */
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_lambda_methdef_6pandas_3lib_lambda1, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__fget), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_builtin_property, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__prop, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":276
 * for field in fields:
 *     prop = property(fget=lambda self: -1)
 *     setattr(NaTType, field, prop)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__NaTType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__field); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__prop); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = PyObject_SetAttr(__pyx_t_1, __pyx_t_3, __pyx_t_15); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":279
 * 
 * 
 * NaT = NaTType()             # <<<<<<<<<<<<<<
 * 
 * iNaT = util.get_nat()
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__NaTType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_15 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NaT, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":281
 * NaT = NaTType()
 * 
 * iNaT = util.get_nat()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_15 = __Pyx_PyInt_to_py_npy_int64(get_nat()); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__iNaT, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":287
 *     return isinstance(o, Timestamp)
 * 
 * def is_timestamp_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_32is_timestamp_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_timestamp_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":322
 * # Frequency inference
 * 
 * def unique_deltas(ndarray[int64_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(arr)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_34unique_deltas, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__unique_deltas, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":350
 * 
 * 
 * def apply_offset(ndarray[object] values, object offset):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_35apply_offset, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__apply_offset, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":462
 * 
 * 
 * def _delta_to_nanoseconds(delta):             # <<<<<<<<<<<<<<
 *     try:
 *         delta = delta.delta
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_36_delta_to_nanoseconds, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_42, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":561
 *     return obj
 * 
 * cdef int64_t _NS_LOWER_BOUND = -9223285636854775809LL             # <<<<<<<<<<<<<<
 * cdef int64_t _NS_UPPER_BOUND = -9223372036854775807LL
 * 
 */
  __pyx_v_6pandas_3lib__NS_LOWER_BOUND = -9223285636854775809;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":562
 * 
 * cdef int64_t _NS_LOWER_BOUND = -9223285636854775809LL
 * cdef int64_t _NS_UPPER_BOUND = -9223372036854775807LL             # <<<<<<<<<<<<<<
 * 
 * cdef inline _check_dts_bounds(int64_t value, pandas_datetimestruct *dts):
 */
  __pyx_v_6pandas_3lib__NS_UPPER_BOUND = -9223372036854775807;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":642
 *         raise ValueError('Unable to parse %s' % str(val))
 * 
 * def array_to_datetime(ndarray[object] values, raise_=False, dayfirst=False,             # <<<<<<<<<<<<<<
 *                       format=None, utc=None):
 *     cdef:
 */
  __pyx_t_15 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_k_46 = __pyx_t_15;
  __Pyx_GIVEREF(__pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_k_47 = __pyx_t_15;
  __Pyx_GIVEREF(__pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_38array_to_datetime, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__array_to_datetime, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":741
 * 
 * 
 * def cast_to_nanoseconds(ndarray arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = arr.size
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_39cast_to_nanoseconds, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cast_to_nanoseconds, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":769
 * 
 * 
 * def pydt_to_i8(object pydt):             # <<<<<<<<<<<<<<
 *     '''
 *     Convert to int64 representation compatible with numpy datetime64; converts
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_40pydt_to_i8, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pydt_to_i8, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":781
 *     return ts.value
 * 
 * def i8_to_pydt(int64_t i8, object tzinfo = None):             # <<<<<<<<<<<<<<
 *     '''
 *     Inverse of pydt_to_i8
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_41i8_to_pydt, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__i8_to_pydt, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":790
 * # time zone conversion helpers
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pytz
 *     UTC = pytz.utc
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":791
 * 
 * try:
 *     import pytz             # <<<<<<<<<<<<<<
 *     UTC = pytz.utc
 *     have_pytz = True
 */
      __pyx_t_15 = __Pyx_Import(((PyObject *)__pyx_n_s__pytz), 0, -1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
      __Pyx_GOTREF(__pyx_t_15);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pytz, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":792
 * try:
 *     import pytz
 *     UTC = pytz.utc             # <<<<<<<<<<<<<<
 *     have_pytz = True
 * except:
 */
      __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__pytz); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__utc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__UTC, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":793
 *     import pytz
 *     UTC = pytz.utc
 *     have_pytz = True             # <<<<<<<<<<<<<<
 * except:
 *     have_pytz = False
 */
      __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__have_pytz, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L21_try_end;
    __pyx_L14_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":794
 *     UTC = pytz.utc
 *     have_pytz = True
 * except:             # <<<<<<<<<<<<<<
 *     have_pytz = False
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("pandas.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_15, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_GOTREF(__pyx_t_3);

      /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":795
 *     have_pytz = True
 * except:
 *     have_pytz = False             # <<<<<<<<<<<<<<
 * 
 * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2):
 */
      __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_m, __pyx_n_s__have_pytz, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L15_exception_handled;
    }
    __pyx_L16_except_error:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L15_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    __pyx_L21_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":797
 *     have_pytz = False
 * 
 * def tz_convert(ndarray[int64_t] vals, object tz1, object tz2):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ndarray[int64_t] utc_dates, result, trans, deltas
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_42tz_convert, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tz_convert, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":848
 *     return result
 * 
 * def tz_convert_single(int64_t val, object tz1, object tz2):             # <<<<<<<<<<<<<<
 *     cdef:
 *         ndarray[int64_t] trans, deltas
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_43tz_convert_single, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tz_convert_single, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":885
 * 
 * 
 * trans_cache = {}             # <<<<<<<<<<<<<<
 * utc_offset_cache = {}
 * 
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__trans_cache, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":886
 * 
 * trans_cache = {}
 * utc_offset_cache = {}             # <<<<<<<<<<<<<<
 * 
 * def _get_transitions(tz):
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__utc_offset_cache, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":888
 * utc_offset_cache = {}
 * 
 * def _get_transitions(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Get UTC times of DST transitions
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_44_get_transitions, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___get_transitions, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":897
 *     return trans_cache[tz]
 * 
 * def _get_deltas(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Get UTC offsets in microseconds corresponding to DST transitions
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_45_get_deltas, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___get_deltas, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":923
 * 
 * 
 * def tz_localize_check(ndarray[int64_t] vals, object tz):             # <<<<<<<<<<<<<<
 *     """
 *     Localize tzinfo-naive DateRange to given time zone (using pytz). If
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_47tz_localize_check, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tz_localize_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":966
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def tz_localize_to_utc(ndarray[int64_t] vals, object tz):             # <<<<<<<<<<<<<<
 *     """
 *     Localize tzinfo-naive DateRange to given time zone (using pytz). If
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_48tz_localize_to_utc, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tz_localize_to_utc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1079
 * #----------------------------------------------------------------------
 * 
 * def build_field_sarray(ndarray[int64_t] dtindex):             # <<<<<<<<<<<<<<
 *     '''
 *     Datetime as int64 representation to a structured array of fields
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_49build_field_sarray, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__build_field_sarray, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1121
 *     return out
 * 
 * def get_time_micros(ndarray[int64_t] dtindex):             # <<<<<<<<<<<<<<
 *     '''
 *     Datetime as int64 representation to a structured array of fields
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_50get_time_micros, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_time_micros, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1140
 * 
 * @cython.wraparound(False)
 * def get_date_field(ndarray[int64_t] dtindex, object field):             # <<<<<<<<<<<<<<
 *     '''
 *     Given a int64-based datetime index, extract the year, month, etc.,
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_51get_date_field, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_date_field, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1266
 *     return ts_dayofweek(ts)
 * 
 * cdef int64_t DAY_NS = 86400000000000LL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_6pandas_3lib_DAY_NS = 86400000000000LL;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1269
 * 
 * 
 * def date_normalize(ndarray[int64_t] stamps):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(stamps)
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_52date_normalize, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__date_normalize, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1285
 *     return result
 * 
 * def dates_normalized(ndarray[int64_t] stamps):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(stamps)
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_53dates_normalized, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dates_normalized, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1300
 * #----------------------------------------------------------------------
 * 
 * def isleapyear(int64_t year):             # <<<<<<<<<<<<<<
 *     return is_leapyear(year)
 * 
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_54isleapyear, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__isleapyear, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/datetime.pyx":1303
 *     return is_leapyear(year)
 * 
 * def monthrange(int64_t year, int64_t month):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int64_t days
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_55monthrange, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__monthrange, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":23
 * cimport numpy as np
 * from numpy cimport *
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * from random import random
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":25
 * import numpy as np
 * 
 * from random import random             # <<<<<<<<<<<<<<
 * 
 * # initialize numpy
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__random));
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__random));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__random));
  __pyx_t_15 = __Pyx_Import(((PyObject *)__pyx_n_s__random), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__random); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__random, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":28
 * 
 * # initialize numpy
 * import_array()             # <<<<<<<<<<<<<<
 * 
 * # TODO: optimize this, make less messy
 */
  import_array();

  /* "/home/wesm/code/pandas/pandas/src/skiplist.pyx":44
 * 
 * # Singleton terminator node
 * NIL = Node(np.inf, [], [])             # <<<<<<<<<<<<<<
 * 
 * cdef class IndexableSkiplist:
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__inf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_15));
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_15));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_15));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_3 = 0;
  __pyx_t_15 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib_Node)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NIL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":5
 * 
 * @cython.boundscheck(False)
 * def arrmap(ndarray[object] index, object func):             # <<<<<<<<<<<<<<
 *     cdef int length = index.shape[0]
 *     cdef int i = 0
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_56arrmap, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__arrmap, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":17
 * 
 * @cython.boundscheck(False)
 * def groupby_func(object index, object mapper):             # <<<<<<<<<<<<<<
 *     cdef dict result = {}
 *     cdef ndarray[object] mapped_index
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_57groupby_func, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__groupby_func, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":47
 * 
 * 
 * def func_groupby_indices(object index, object mapper):             # <<<<<<<<<<<<<<
 *     return groupby_indices_naive(arrmap(index, mapper))
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_58func_groupby_indices, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_208, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":72
 * 
 * @cython.boundscheck(False)
 * def groupby_indices(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_60groupby_indices, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__groupby_indices, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":109
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def is_lexsorted(list list_of_arrays):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int i
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_61is_lexsorted, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_lexsorted, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":142
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def group_labels(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute label vector from input values and associated useful data
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_62group_labels, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_labels, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":184
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def get_unique_labels(ndarray[object] values, dict idMap):             # <<<<<<<<<<<<<<
 *     cdef int i, length
 *     cdef object idx
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_63get_unique_labels, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_unique_labels, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":198
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def groupsort_indexer(ndarray[int64_t] index, Py_ssize_t ngroups):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, loc, label, n
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_64groupsort_indexer, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__groupsort_indexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":227
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_65group_add, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_add, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":282
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_66group_prod, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_prod, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":339
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_67group_nth, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_nth, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":382
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_nth_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_68group_nth_bin, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_nth_bin, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":428
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_69group_last, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_last, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":470
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_last_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_70group_last_bin, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_last_bin, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":519
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_min(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_71group_min, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":578
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_max(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_72group_max, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_max, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":637
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_mean(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                ndarray[int64_t] counts,
 *                ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_73group_mean, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_mean, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":686
 * 
 * 
 * def group_median(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                  ndarray[int64_t] counts,
 *                  ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_74group_median, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_median, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":761
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_var(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *               ndarray[int64_t] counts,
 *               ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_75group_var, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_var, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":824
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def generate_bins_dt64(ndarray[int64_t] values, ndarray[int64_t] binner,             # <<<<<<<<<<<<<<
 *                        object closed='left'):
 *     """
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_76generate_bins_dt64, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__generate_bins_dt64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":872
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_add_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_77group_add_bin, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_add_bin, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":929
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_prod_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_78group_prod_bin, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_prod_bin, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":986
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_min_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_79group_min_bin, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_min_bin, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1049
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_max_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_80group_max_bin, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_max_bin, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1111
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_ohlc(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_81group_ohlc, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_ohlc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1186
 * # @cython.boundscheck(False)
 * # @cython.wraparound(False)
 * def group_mean_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] counts,
 *                    ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_82group_mean_bin, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_mean_bin, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1241
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def group_var_bin(ndarray[float64_t, ndim=2] out,             # <<<<<<<<<<<<<<
 *                   ndarray[int64_t] counts,
 *                   ndarray[float64_t, ndim=2] values,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_83group_var_bin, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_var_bin, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1305
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def row_bool_subset(ndarray[float64_t, ndim=2] values,             # <<<<<<<<<<<<<<
 *                     ndarray[uint8_t, cast=True] mask):
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_84row_bool_subset, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__row_bool_subset, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1326
 * 
 * 
 * def group_count(ndarray[int64_t] values, Py_ssize_t size):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_85group_count, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__group_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1336
 *     return counts
 * 
 * def lookup_values(ndarray[object] values, dict mapping):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_86lookup_values, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__lookup_values, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1346
 * 
 * 
 * def count_level_1d(ndarray[uint8_t, cast=True] mask,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] labels, Py_ssize_t max_bin):
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_87count_level_1d, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__count_level_1d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1363
 * 
 * 
 * def count_level_2d(ndarray[uint8_t, ndim=2, cast=True] mask,             # <<<<<<<<<<<<<<
 *                    ndarray[int64_t] labels, Py_ssize_t max_bin):
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_88count_level_2d, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__count_level_2d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1392
 *         return 0
 * 
 * pandas_null = _PandasNull()             # <<<<<<<<<<<<<<
 * 
 * def fast_zip_fillna(list ndarrays, fill_value=pandas_null):
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pandas_3lib__PandasNull)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pandas_null, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1394
 * pandas_null = _PandasNull()
 * 
 * def fast_zip_fillna(list ndarrays, fill_value=pandas_null):             # <<<<<<<<<<<<<<
 *     '''
 *     For zipping multiple ndarrays into an ndarray of tuples
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__pandas_null); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_90 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_89fast_zip_fillna, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fast_zip_fillna, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1441
 *     return result
 * 
 * def duplicated(ndarray[object] values, take_last=False):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_92 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_90duplicated, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__duplicated, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1470
 *     return result.view(np.bool_)
 * 
 * def generate_slices(ndarray[int64_t] labels, Py_ssize_t ngroups):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, group_size, n, lab, start
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_91generate_slices, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__generate_slices, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1495
 * 
 * 
 * def groupby_arrays(ndarray index, ndarray[int64_t] labels, sort=True):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, lab, cur, start, n = len(index)
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_93 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_92groupby_arrays, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__groupby_arrays, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/groupby.pyx":1526
 *     return result
 * 
 * def indices_fast(object index, ndarray[int64_t] labels, list keys,             # <<<<<<<<<<<<<<
 *                  list sorted_labels):
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_93indices_fast, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__indices_fast, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":28
 * 
 * 
 * def kth_smallest(ndarray[double_t] a, Py_ssize_t k):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i,j,l,m,n
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_94kth_smallest, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__kth_smallest, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":85
 * 
 * 
 * def median(ndarray arr):             # <<<<<<<<<<<<<<
 *     '''
 *     A faster median
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_95median, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__median, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":105
 * # -------------- Min, Max subsequence
 * 
 * def max_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i=0,s=0,e=0,T,n
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_96max_subseq, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__max_subseq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":133
 *     return (s, e, m)
 * 
 * def min_subseq(ndarray[double_t] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t s, e
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_97min_subseq, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__min_subseq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":145
 * # Rolling sum
 * 
 * def roll_sum(ndarray[double_t] input, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, prev, sum_x = 0
 *     cdef int nobs = 0, i
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_98roll_sum, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_sum, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":187
 * # Rolling mean
 * 
 * def roll_mean(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev, sum_x = 0
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_99roll_mean, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_mean, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":230
 * # Exponentially weighted moving average
 * 
 * def ewma(ndarray[double_t] input, double_t com, int adjust):             # <<<<<<<<<<<<<<
 *     '''
 *     Compute exponentially-weighted moving average using center-of-mass.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_100ewma, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ewma, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":284
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def nancorr(ndarray[float64_t, ndim=2] mat, cov=False):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, xi, yi, N, K
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_95 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_101nancorr, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__nancorr, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":338
 * # Rolling variance
 * 
 * def _check_minp(minp, N):             # <<<<<<<<<<<<<<
 *     if minp > N:
 *         minp = N + 1
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_102_check_minp, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___check_minp, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":347
 *     return minp
 * 
 * def roll_var(ndarray[double_t] input, int win, int minp, int ddof=1):             # <<<<<<<<<<<<<<
 *     cdef double val, prev, sum_x = 0, sum_xx = 0, nobs = 0
 *     cdef Py_ssize_t i
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_103roll_var, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_var, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":392
 * # Rolling skewness
 * 
 * def roll_skew(ndarray[double_t] input, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, prev
 *     cdef double x = 0, xx = 0, xxx = 0
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_104roll_skew, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_skew, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":453
 * 
 * 
 * def roll_kurt(ndarray[double_t] input,             # <<<<<<<<<<<<<<
 *                int win, int minp):
 *     cdef double val, prev
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_105roll_kurt, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_kurt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":568
 * from skiplist cimport *
 * 
 * def roll_median_c(ndarray[float64_t] arg, int win, int minp):             # <<<<<<<<<<<<<<
 *     cdef double val, res, prev
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_106roll_median_c, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_median_c, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":623
 *     return output
 * 
 * def roll_median_cython(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_107roll_median_cython, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_median_cython, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":659
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def roll_max2(ndarray[float64_t] a, int window, int minp):             # <<<<<<<<<<<<<<
 *     "Moving max of 1d array of dtype=float64 along axis=0 ignoring NaNs."
 *     cdef np.float64_t ai, aold
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_108roll_max2, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_max2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":732
 *     return y
 * 
 * def roll_max(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_109roll_max, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_max, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":745
 *         return NaN
 * 
 * def roll_min(ndarray input, int win, int minp):             # <<<<<<<<<<<<<<
 *     '''
 *     O(N log(window)) implementation using skip list
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_110roll_min, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_min, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":753
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def roll_min2(np.ndarray[np.float64_t, ndim=1] a, int window, int minp):             # <<<<<<<<<<<<<<
 *     "Moving min of 1d array of dtype=float64 along axis=0 ignoring NaNs."
 *     cdef np.float64_t ai, aold
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_111roll_min2, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_min2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":831
 *         return NaN
 * 
 * def roll_quantile(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                   int minp, double quantile):
 *     '''
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_112roll_quantile, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_quantile, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/moments.pyx":878
 *     return output
 * 
 * def roll_generic(ndarray[float64_t, cast=True] input, int win,             # <<<<<<<<<<<<<<
 *                  int minp, object func):
 *     cdef ndarray[double_t] output, counts, bufarr
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_113roll_generic, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__roll_generic, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":1
 * def ordered_left_join(ndarray[object] left, ndarray[object] right):             # <<<<<<<<<<<<<<
 *     # cdef dict right_map = map_indices_buf(right)
 *     # return merge_indexer(left, right_map)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_114ordered_left_join, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ordered_left_join, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":35
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_2d(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                  ndarray[float64_t, ndim=2] lvalues,
 *                  ndarray[float64_t, ndim=2] rvalues,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_115left_join_2d, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__left_join_2d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":70
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def left_join_1d(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                  ndarray[float64_t] lvalues,
 *                  ndarray[float64_t] rvalues,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_116left_join_1d, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__left_join_1d, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reindex.pyx":102
 * @cython.wraparound(False)
 * @cython.boundscheck(False)
 * def take_join_contiguous(ndarray[float64_t, ndim=2] lvalues,             # <<<<<<<<<<<<<<
 *                          ndarray[float64_t, ndim=2] rvalues,
 *                          ndarray[int32_t] lindexer,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_117take_join_contiguous, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_209, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":2
 * from numpy cimport *
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * cdef class Reducer:
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/reduce.pyx":360
 *         self.buf.data = self.orig_data
 * 
 * def reduce(arr, f, axis=0, dummy=None, labels=None):             # <<<<<<<<<<<<<<
 *     if labels._has_complex_internals:
 *         raise Exception('Cannot use shortcut')
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_118reduce, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__reduce, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":1
 * cdef float64_t FP_ERR = 1e-13             # <<<<<<<<<<<<<<
 * 
 * cimport util
 */
  __pyx_v_6pandas_3lib_FP_ERR = 1e-13;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":6
 * 
 * cdef:
 *     int TIEBREAK_AVERAGE = 0             # <<<<<<<<<<<<<<
 *     int TIEBREAK_MIN = 1
 *     int TIEBREAK_MAX = 2
 */
  __pyx_v_6pandas_3lib_TIEBREAK_AVERAGE = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":7
 * cdef:
 *     int TIEBREAK_AVERAGE = 0
 *     int TIEBREAK_MIN = 1             # <<<<<<<<<<<<<<
 *     int TIEBREAK_MAX = 2
 *     int TIEBREAK_FIRST = 3
 */
  __pyx_v_6pandas_3lib_TIEBREAK_MIN = 1;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":8
 *     int TIEBREAK_AVERAGE = 0
 *     int TIEBREAK_MIN = 1
 *     int TIEBREAK_MAX = 2             # <<<<<<<<<<<<<<
 *     int TIEBREAK_FIRST = 3
 *     int TIEBREAK_FIRST_DESCENDING = 4
 */
  __pyx_v_6pandas_3lib_TIEBREAK_MAX = 2;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":9
 *     int TIEBREAK_MIN = 1
 *     int TIEBREAK_MAX = 2
 *     int TIEBREAK_FIRST = 3             # <<<<<<<<<<<<<<
 *     int TIEBREAK_FIRST_DESCENDING = 4
 * 
 */
  __pyx_v_6pandas_3lib_TIEBREAK_FIRST = 3;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":10
 *     int TIEBREAK_MAX = 2
 *     int TIEBREAK_FIRST = 3
 *     int TIEBREAK_FIRST_DESCENDING = 4             # <<<<<<<<<<<<<<
 * 
 * tiebreakers = {
 */
  __pyx_v_6pandas_3lib_TIEBREAK_FIRST_DESCENDING = 4;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":12
 *     int TIEBREAK_FIRST_DESCENDING = 4
 * 
 * tiebreakers = {             # <<<<<<<<<<<<<<
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":13
 * 
 * tiebreakers = {
 *     'average' : TIEBREAK_AVERAGE,             # <<<<<<<<<<<<<<
 *     'min' : TIEBREAK_MIN,
 *     'max' : TIEBREAK_MAX,
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_6pandas_3lib_TIEBREAK_AVERAGE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__average), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":14
 * tiebreakers = {
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,             # <<<<<<<<<<<<<<
 *     'max' : TIEBREAK_MAX,
 *     'first' : TIEBREAK_FIRST
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_6pandas_3lib_TIEBREAK_MIN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__min), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":15
 *     'average' : TIEBREAK_AVERAGE,
 *     'min' : TIEBREAK_MIN,
 *     'max' : TIEBREAK_MAX,             # <<<<<<<<<<<<<<
 *     'first' : TIEBREAK_FIRST
 * }
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_6pandas_3lib_TIEBREAK_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__max), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":17
 *     'max' : TIEBREAK_MAX,
 *     'first' : TIEBREAK_FIRST
 * }             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyInt_FromLong(__pyx_v_6pandas_3lib_TIEBREAK_FIRST); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__first), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__tiebreakers, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":73
 * 
 * 
 * def rank_1d_float64(object in_arr, ties_method='average', ascending=True):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_119 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_119rank_1d_float64, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rank_1d_float64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":141
 * 
 * 
 * def rank_1d_int64(object in_arr, ties_method='average', ascending=True):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_122 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_120rank_1d_int64, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rank_1d_int64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":201
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',
 *                     ascending=True):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_125 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":200
 * 
 * 
 * def rank_2d_float64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True):
 *     """
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_121rank_2d_float64, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rank_2d_float64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":280
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',
 *                     ascending=True):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_131 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":279
 * 
 * 
 * def rank_2d_int64(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True):
 *     """
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_122rank_2d_int64, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rank_2d_int64, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":348
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',
 *                     ascending=True):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_137 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":347
 * 
 * 
 * def rank_1d_generic(object in_arr, bint retry=1, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True):
 *     """
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_123rank_1d_generic, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rank_1d_generic, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":429
 *         return left != right
 * 
 * _return_false = lambda self, other: False             # <<<<<<<<<<<<<<
 * _return_true = lambda self, other: True
 * 
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_lambda_methdef_6pandas_3lib_lambda2, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___return_false, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":430
 * 
 * _return_false = lambda self, other: False
 * _return_true = lambda self, other: True             # <<<<<<<<<<<<<<
 * 
 * class Infinity(object):
 */
  __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_lambda_methdef_6pandas_3lib_lambda3, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___return_true, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":432
 * _return_true = lambda self, other: True
 * 
 * class Infinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_false
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":434
 * class Infinity(object):
 * 
 *     __lt__ = _return_false             # <<<<<<<<<<<<<<
 *     __le__ = _return_false
 *     __eq__ = _return_false
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_false); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____lt__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":435
 * 
 *     __lt__ = _return_false
 *     __le__ = _return_false             # <<<<<<<<<<<<<<
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_false); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____le__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":436
 *     __lt__ = _return_false
 *     __le__ = _return_false
 *     __eq__ = _return_false             # <<<<<<<<<<<<<<
 *     __ne__ = _return_true
 *     __gt__ = _return_true
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_false); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____eq__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":437
 *     __le__ = _return_false
 *     __eq__ = _return_false
 *     __ne__ = _return_true             # <<<<<<<<<<<<<<
 *     __gt__ = _return_true
 *     __ge__ = _return_true
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_true); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____ne__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":438
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 *     __gt__ = _return_true             # <<<<<<<<<<<<<<
 *     __ge__ = _return_true
 *     __cmp__ = _return_false
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_true); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____gt__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":439
 *     __ne__ = _return_true
 *     __gt__ = _return_true
 *     __ge__ = _return_true             # <<<<<<<<<<<<<<
 *     __cmp__ = _return_false
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_true); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____ge__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":440
 *     __gt__ = _return_true
 *     __ge__ = _return_true
 *     __cmp__ = _return_false             # <<<<<<<<<<<<<<
 * 
 * class NegInfinity(object):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_false); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____cmp__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":432
 * _return_true = lambda self, other: True
 * 
 * class Infinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_false
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  __pyx_t_15 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2), __pyx_n_s__Infinity, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Infinity, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":442
 *     __cmp__ = _return_false
 * 
 * class NegInfinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_true
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":444
 * class NegInfinity(object):
 * 
 *     __lt__ = _return_true             # <<<<<<<<<<<<<<
 *     __le__ = _return_true
 *     __eq__ = _return_false
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_true); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____lt__, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":445
 * 
 *     __lt__ = _return_true
 *     __le__ = _return_true             # <<<<<<<<<<<<<<
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_true); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____le__, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":446
 *     __lt__ = _return_true
 *     __le__ = _return_true
 *     __eq__ = _return_false             # <<<<<<<<<<<<<<
 *     __ne__ = _return_true
 *     __gt__ = _return_false
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_false); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____eq__, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":447
 *     __le__ = _return_true
 *     __eq__ = _return_false
 *     __ne__ = _return_true             # <<<<<<<<<<<<<<
 *     __gt__ = _return_false
 *     __ge__ = _return_false
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_true); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____ne__, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":448
 *     __eq__ = _return_false
 *     __ne__ = _return_true
 *     __gt__ = _return_false             # <<<<<<<<<<<<<<
 *     __ge__ = _return_false
 *     __cmp__ = _return_true
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_false); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____gt__, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":449
 *     __ne__ = _return_true
 *     __gt__ = _return_false
 *     __ge__ = _return_false             # <<<<<<<<<<<<<<
 *     __cmp__ = _return_true
 * 
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_false); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____ge__, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":450
 *     __gt__ = _return_false
 *     __ge__ = _return_false
 *     __cmp__ = _return_true             # <<<<<<<<<<<<<<
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___return_true); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____cmp__, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":442
 *     __cmp__ = _return_false
 * 
 * class NegInfinity(object):             # <<<<<<<<<<<<<<
 * 
 *     __lt__ = _return_true
 */
  __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_15));
  __Pyx_INCREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  __pyx_t_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_15), ((PyObject *)__pyx_t_2), __pyx_n_s__NegInfinity, __pyx_n_s_163); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__NegInfinity, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":453
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',
 *                     ascending=True):             # <<<<<<<<<<<<<<
 *     """
 *     Fast NaN-friendly version of scipy.stats.rankdata
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_143 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/stats.pyx":452
 *     __cmp__ = _return_true
 * 
 * def rank_2d_generic(object in_arr, axis=0, ties_method='average',             # <<<<<<<<<<<<<<
 *                     ascending=True):
 *     """
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_124rank_2d_generic, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rank_2d_generic, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":3
 * cimport util
 * 
 * _TYPE_MAP = {             # <<<<<<<<<<<<<<
 *     np.int8: 'integer',
 *     np.int16: 'integer',
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":4
 * 
 * _TYPE_MAP = {
 *     np.int8: 'integer',             # <<<<<<<<<<<<<<
 *     np.int16: 'integer',
 *     np.int32: 'integer',
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__integer)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":5
 * _TYPE_MAP = {
 *     np.int8: 'integer',
 *     np.int16: 'integer',             # <<<<<<<<<<<<<<
 *     np.int32: 'integer',
 *     np.int64: 'integer',
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_n_s__integer)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":6
 *     np.int8: 'integer',
 *     np.int16: 'integer',
 *     np.int32: 'integer',             # <<<<<<<<<<<<<<
 *     np.int64: 'integer',
 *     np.uint8: 'integer',
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int32); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__integer)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":7
 *     np.int16: 'integer',
 *     np.int32: 'integer',
 *     np.int64: 'integer',             # <<<<<<<<<<<<<<
 *     np.uint8: 'integer',
 *     np.uint16: 'integer',
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_n_s__integer)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":8
 *     np.int32: 'integer',
 *     np.int64: 'integer',
 *     np.uint8: 'integer',             # <<<<<<<<<<<<<<
 *     np.uint16: 'integer',
 *     np.uint32: 'integer',
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uint8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__integer)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":9
 *     np.int64: 'integer',
 *     np.uint8: 'integer',
 *     np.uint16: 'integer',             # <<<<<<<<<<<<<<
 *     np.uint32: 'integer',
 *     np.uint64: 'integer',
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__uint16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_n_s__integer)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":10
 *     np.uint8: 'integer',
 *     np.uint16: 'integer',
 *     np.uint32: 'integer',             # <<<<<<<<<<<<<<
 *     np.uint64: 'integer',
 *     np.float32: 'floating',
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uint32); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__integer)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":11
 *     np.uint16: 'integer',
 *     np.uint32: 'integer',
 *     np.uint64: 'integer',             # <<<<<<<<<<<<<<
 *     np.float32: 'floating',
 *     np.float64: 'floating',
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__uint64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_n_s__integer)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":12
 *     np.uint32: 'integer',
 *     np.uint64: 'integer',
 *     np.float32: 'floating',             # <<<<<<<<<<<<<<
 *     np.float64: 'floating',
 *     np.complex128: 'complex',
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float32); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__floating)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":13
 *     np.uint64: 'integer',
 *     np.float32: 'floating',
 *     np.float64: 'floating',             # <<<<<<<<<<<<<<
 *     np.complex128: 'complex',
 *     np.complex128: 'complex',
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_n_s__floating)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":14
 *     np.float32: 'floating',
 *     np.float64: 'floating',
 *     np.complex128: 'complex',             # <<<<<<<<<<<<<<
 *     np.complex128: 'complex',
 *     np.string_: 'string',
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__complex128); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__complex)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":15
 *     np.float64: 'floating',
 *     np.complex128: 'complex',
 *     np.complex128: 'complex',             # <<<<<<<<<<<<<<
 *     np.string_: 'string',
 *     np.unicode_: 'unicode',
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__complex128); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_n_s__complex)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":16
 *     np.complex128: 'complex',
 *     np.complex128: 'complex',
 *     np.string_: 'string',             # <<<<<<<<<<<<<<
 *     np.unicode_: 'unicode',
 *     np.bool_: 'boolean',
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__string_); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__string)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":17
 *     np.complex128: 'complex',
 *     np.string_: 'string',
 *     np.unicode_: 'unicode',             # <<<<<<<<<<<<<<
 *     np.bool_: 'boolean',
 *     np.datetime64 : 'datetime64'
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__unicode_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_n_s__unicode)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":18
 *     np.string_: 'string',
 *     np.unicode_: 'unicode',
 *     np.bool_: 'boolean',             # <<<<<<<<<<<<<<
 *     np.datetime64 : 'datetime64'
 * }
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__bool_); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__boolean)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":19
 *     np.unicode_: 'unicode',
 *     np.bool_: 'boolean',
 *     np.datetime64 : 'datetime64'             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__datetime64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_n_s__datetime64)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___TYPE_MAP, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":22
 * }
 * 
 * try:             # <<<<<<<<<<<<<<
 *     _TYPE_MAP[np.float128] = 'floating'
 *     _TYPE_MAP[np.complex256] = 'complex'
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":23
 * 
 * try:
 *     _TYPE_MAP[np.float128] = 'floating'             # <<<<<<<<<<<<<<
 *     _TYPE_MAP[np.complex256] = 'complex'
 *     _TYPE_MAP[np.float16] = 'floating'
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___TYPE_MAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__float128); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyObject_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__floating)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":24
 * try:
 *     _TYPE_MAP[np.float128] = 'floating'
 *     _TYPE_MAP[np.complex256] = 'complex'             # <<<<<<<<<<<<<<
 *     _TYPE_MAP[np.float16] = 'floating'
 *     _TYPE_MAP[np.datetime64] = 'datetime64'
 */
      __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___TYPE_MAP); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__complex256); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyObject_SetItem(__pyx_t_15, __pyx_t_1, ((PyObject *)__pyx_n_s__complex)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":25
 *     _TYPE_MAP[np.float128] = 'floating'
 *     _TYPE_MAP[np.complex256] = 'complex'
 *     _TYPE_MAP[np.float16] = 'floating'             # <<<<<<<<<<<<<<
 *     _TYPE_MAP[np.datetime64] = 'datetime64'
 * except AttributeError:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___TYPE_MAP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__float16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (PyObject_SetItem(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_n_s__floating)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "/home/wesm/code/pandas/pandas/src/inference.pyx":26
 *     _TYPE_MAP[np.complex256] = 'complex'
 *     _TYPE_MAP[np.float16] = 'floating'
 *     _TYPE_MAP[np.datetime64] = 'datetime64'             # <<<<<<<<<<<<<<
 * except AttributeError:
 *     pass
 */
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___TYPE_MAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__datetime64); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyObject_SetItem(__pyx_t_2, __pyx_t_15, ((PyObject *)__pyx_n_s__datetime64)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L31_try_end;
    __pyx_L24_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;

    /* "/home/wesm/code/pandas/pandas/src/inference.pyx":27
 *     _TYPE_MAP[np.float16] = 'floating'
 *     _TYPE_MAP[np.datetime64] = 'datetime64'
 * except AttributeError:             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
    __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_12) {
      PyErr_Restore(0,0,0);
      goto __pyx_L25_exception_handled;
    }
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L25_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    __pyx_L31_try_end:;
  }

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":30
 *     pass
 * 
 * def infer_dtype(object _values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_125infer_dtype, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__infer_dtype, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":98
 *     return 'mixed'
 * 
 * def infer_dtype_list(list values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_126infer_dtype_list, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__infer_dtype_list, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":113
 *     return PyTime_Check(o)
 * 
 * def is_bool_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_127is_bool_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_bool_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":134
 *         return False
 * 
 * def is_integer(object o):             # <<<<<<<<<<<<<<
 *     return util.is_integer_object(o)
 * 
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_128is_integer, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_integer, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":137
 *     return util.is_integer_object(o)
 * 
 * def is_integer_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_129is_integer_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_integer_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":158
 *         return False
 * 
 * def is_float_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_130is_float_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_float_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":179
 *         return False
 * 
 * def is_string_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_131is_string_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_string_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":200
 *         return False
 * 
 * def is_unicode_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_132is_unicode_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_unicode_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":222
 * 
 * 
 * def is_datetime_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_133is_datetime_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_datetime_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":232
 * 
 * 
 * def is_datetime64_array(ndarray values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_134is_datetime64_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_datetime64_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":241
 *     return True
 * 
 * def is_date_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_135is_date_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_date_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":250
 *     return True
 * 
 * def is_time_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     if n == 0:
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_136is_time_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_time_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":259
 *     return True
 * 
 * def is_period_array(ndarray[object] values):             # <<<<<<<<<<<<<<
 *     cdef int i, n = len(values)
 *     from pandas import Period
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_137is_period_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__is_period_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":270
 *     return True
 * 
 * def extract_ordinals(ndarray[object] values, freq):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(values)
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_138extract_ordinals, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__extract_ordinals, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":287
 * 
 * def maybe_convert_numeric(ndarray[object] values, set na_values,
 *                           convert_empty=True):             # <<<<<<<<<<<<<<
 *     '''
 *     Type inference function-- convert strings to numeric (potentially) and
 */
  __pyx_t_15 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_k_157 = __pyx_t_15;
  __Pyx_GIVEREF(__pyx_t_15);
  __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":286
 * 
 * 
 * def maybe_convert_numeric(ndarray[object] values, set na_values,             # <<<<<<<<<<<<<<
 *                           convert_empty=True):
 *     '''
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_139maybe_convert_numeric, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_210, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":345
 *         return ints
 * 
 * def maybe_convert_objects(ndarray[object] objects, bint try_float=0,             # <<<<<<<<<<<<<<
 *                           bint safe=0, bint convert_datetime=0):
 *     '''
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_140maybe_convert_objects, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_89, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":489
 * 
 * 
 * def convert_sql_column(x):             # <<<<<<<<<<<<<<
 *     return maybe_convert_objects(x, try_float=1)
 * 
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_141convert_sql_column, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__convert_sql_column, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":493
 * 
 * def try_parse_dates(ndarray[object] values, parser=None,
 *                     dayfirst=False):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */
  __pyx_t_15 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_k_162 = __pyx_t_15;
  __Pyx_GIVEREF(__pyx_t_15);
  __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":492
 *     return maybe_convert_objects(x, try_float=1)
 * 
 * def try_parse_dates(ndarray[object] values, parser=None,             # <<<<<<<<<<<<<<
 *                     dayfirst=False):
 *     cdef:
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_142try_parse_dates, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__try_parse_dates, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":534
 * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times,
 *                             date_parser=None, time_parser=None,
 *                             dayfirst=False):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */
  __pyx_t_15 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_k_165 = __pyx_t_15;
  __Pyx_GIVEREF(__pyx_t_15);
  __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":532
 *     return result
 * 
 * def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times,             # <<<<<<<<<<<<<<
 *                             date_parser=None, time_parser=None,
 *                             dayfirst=False):
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_143try_parse_date_and_time, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_211, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":582
 * 
 * 
 * def try_parse_year_month_day(ndarray[object] years, ndarray[object] months,             # <<<<<<<<<<<<<<
 *                              ndarray[object] days):
 *     cdef:
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_144try_parse_year_month_day, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_212, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":600
 *     return result
 * 
 * def try_parse_datetime_components(ndarray[object] years, ndarray[object] months,             # <<<<<<<<<<<<<<
 *     ndarray[object] days, ndarray[object] hours, ndarray[object] minutes,
 *     ndarray[object] seconds):
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_145try_parse_datetime_components, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_213, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":623
 * 
 * def sanitize_objects(ndarray[object] values, set na_values,
 *                      convert_empty=True):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */
  __pyx_t_15 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_k_172 = __pyx_t_15;
  __Pyx_GIVEREF(__pyx_t_15);
  __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":622
 *     return result
 * 
 * def sanitize_objects(ndarray[object] values, set na_values,             # <<<<<<<<<<<<<<
 *                      convert_empty=True):
 *     cdef:
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_146sanitize_objects, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sanitize_objects, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":645
 *     return na_count
 * 
 * def maybe_convert_bool(ndarray[object] arr):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_147maybe_convert_bool, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__maybe_convert_bool, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":667
 * 
 * 
 * def map_infer(ndarray arr, object f, bint convert=1):             # <<<<<<<<<<<<<<
 *     '''
 *     Substitute for np.vectorize with pandas-friendly dtype inference
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_148map_infer, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__map_infer, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":703
 *     return result
 * 
 * def to_object_array(list rows):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, n, k, tmp
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_149to_object_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__to_object_array, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":727
 *     return result
 * 
 * def tuples_to_object_array(ndarray[object] tuples):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, n, k, tmp
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_150tuples_to_object_array, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_214, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":743
 *     return result
 * 
 * def to_object_array_tuples(list rows):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, n, k, tmp
 */
  __pyx_t_15 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_151to_object_array_tuples, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_215, __pyx_t_15) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/inference.pyx":774
 * 
 * 
 * def fast_multiget(dict mapping, ndarray keys, default=np.nan):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(keys)
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__nan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_k_174 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_152fast_multiget, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__fast_multiget, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":1
 * import time             # <<<<<<<<<<<<<<
 * 
 * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right,
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__time), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":3
 * import time
 * 
 * def inner_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                Py_ssize_t max_groups):
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_153inner_join, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__inner_join, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":54
 * 
 * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,
 *                     Py_ssize_t max_groups, sort=True):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, j, k, count = 0
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_176 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":53
 *             _get_result_indexer(right_sorter, right_indexer))
 * 
 * def left_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                     Py_ssize_t max_groups, sort=True):
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_154left_outer_join, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__left_outer_join, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":122
 * 
 * 
 * def full_outer_join(ndarray[int64_t] left, ndarray[int64_t] right,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t max_groups):
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_155full_outer_join, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__full_outer_join, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":186
 * 
 * 
 * def _get_result_indexer(sorter, indexer):             # <<<<<<<<<<<<<<
 *     if indexer.dtype != np.int_:
 *         indexer = indexer.astype(np.int_)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_156_get_result_indexer, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___get_result_indexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":201
 * 
 * 
 * def ffill_indexer(ndarray[int64_t] indexer):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, n = len(indexer)
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_157ffill_indexer, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ffill_indexer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":221
 * 
 * 
 * def ffill_by_group(ndarray[int64_t] indexer, ndarray[int64_t] group_ids,             # <<<<<<<<<<<<<<
 *                    int64_t max_group):
 *     cdef:
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_158ffill_by_group, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ffill_by_group, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":247
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * def join_sorter(ndarray[int64_t] index, Py_ssize_t ngroups):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t i, loc, label, n
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_159join_sorter, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__join_sorter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/join.pyx":272
 *     return result, counts
 * 
 * def _big_join_sorter(index):             # <<<<<<<<<<<<<<
 *     pass
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_160_big_join_sorter, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___big_join_sorter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":8
 * cimport numpy as cnp
 * 
 * cnp.import_array()             # <<<<<<<<<<<<<<
 * cnp.import_ufunc()
 * 
 */
  import_array();

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":9
 * 
 * cnp.import_array()
 * cnp.import_ufunc()             # <<<<<<<<<<<<<<
 * 
 * cimport util
 */
  import_ufunc();

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":13
 * cimport util
 * 
 * import numpy as np             # <<<<<<<<<<<<<<
 * 
 * import _algos
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":15
 * import numpy as np
 * 
 * import _algos             # <<<<<<<<<<<<<<
 * 
 * # include "hashtable.pyx"
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s___algos), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___algos, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":23
 *     void PyDateTime_IMPORT()
 * 
 * PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "Python.h":
 */
  PyDateTime_IMPORT;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":41
 *             or PyList_Check(val))
 * 
 * def get_value_at(ndarray arr, object loc):             # <<<<<<<<<<<<<<
 *     return util.get_value_at(arr, loc)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_161get_value_at, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_value_at, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":44
 *     return util.get_value_at(arr, loc)
 * 
 * def set_value_at(ndarray arr, object loc, object val):             # <<<<<<<<<<<<<<
 *     return util.set_value_at(arr, loc, val)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6pandas_3lib_162set_value_at, NULL, __pyx_n_s_163); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__set_value_at, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":49
 * 
 * # Don't populate hash tables in monotonic indexes larger than this
 * cdef int _SIZE_CUTOFF = 1000000             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_6pandas_3lib__SIZE_CUTOFF = 1000000;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":334
 *                                          limit=limit)
 * 
 * _pad_functions = {             # <<<<<<<<<<<<<<
 *     'object' : _algos.pad_object,
 *     'int64' : _algos.pad_int64,
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":335
 * 
 * _pad_functions = {
 *     'object' : _algos.pad_object,             # <<<<<<<<<<<<<<
 *     'int64' : _algos.pad_int64,
 *     'float64' : _algos.pad_float64
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__pad_object); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__object), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":336
 * _pad_functions = {
 *     'object' : _algos.pad_object,
 *     'int64' : _algos.pad_int64,             # <<<<<<<<<<<<<<
 *     'float64' : _algos.pad_float64
 * }
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__pad_int64); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__int64), __pyx_t_15) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":337
 *     'object' : _algos.pad_object,
 *     'int64' : _algos.pad_int64,
 *     'float64' : _algos.pad_float64             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__pad_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__float64), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___pad_functions, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":340
 * }
 * 
 * _backfill_functions = {             # <<<<<<<<<<<<<<
 *     'object': _algos.backfill_object,
 *     'int64': _algos.backfill_int64,
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":341
 * 
 * _backfill_functions = {
 *     'object': _algos.backfill_object,             # <<<<<<<<<<<<<<
 *     'int64': _algos.backfill_int64,
 *     'float64': _algos.backfill_float64
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__backfill_object); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__object), __pyx_t_15) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":342
 * _backfill_functions = {
 *     'object': _algos.backfill_object,
 *     'int64': _algos.backfill_int64,             # <<<<<<<<<<<<<<
 *     'float64': _algos.backfill_float64
 * }
 */
  __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__backfill_int64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__int64), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/wesm/code/pandas/pandas/src/engines.pyx":343
 *     'object': _algos.backfill_object,
 *     'int64': _algos.backfill_int64,
 *     'float64': _algos.backfill_float64             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___algos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__backfill_float64); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__float64), __pyx_t_15) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___backfill_functions, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "pandas/src/tseries.pyx":1
 * cimport numpy as np             # <<<<<<<<<<<<<<
 * cimport cython
 * import numpy as np
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "util.pxd":63
 *     return not cnp.PyArray_Check(val) and (val is None or val != val)
 * 
 * cdef inline bint _checknan(object val):             # <<<<<<<<<<<<<<
 *     return not cnp.PyArray_Check(val) and val != val
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_15);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pandas.lib", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pandas.lib");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */

#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;

    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;

    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}


static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
  unsigned int n = 1;
  return *(unsigned char*)(&n) != 0;
}

typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
} __Pyx_BufFmt_Context;

static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}

static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t < '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}

static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}

static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case 'b': return "'char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 0: return "end";
    default: return "unparseable format string";
  }
}

static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}

static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'B': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}

typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif

static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}

static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c': case 'b': case 'h': case 'i': case 'l': case 'q': return 'I';
    case 'B': case 'H': case 'I': case 'L': case 'Q': return 'U';
    case 'f': case 'd': case 'g': return (is_complex ? 'C' : 'R');
    case 'O': return 'O';
    case 'P': return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}

static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}

static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset;
  if (ctx->enc_type == 0) return 0;
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;

    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
    }

    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        /* special case -- treat as struct rather than complex number */
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }

      __Pyx_BufFmt_RaiseExpected(ctx);
      return -1;
    }

    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %"PY_FORMAT_SIZE_T"d but %"PY_FORMAT_SIZE_T"d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }

    ctx->fmt_offset += size;

    --ctx->enc_count; /* Consume from buffer string */

    /* Done checking, move to next field, pushing or popping struct stack if needed */
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break; /* breaks both loops as ctx->enc_count == 0 */
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue; /* empty struct */
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}

static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case 10:
      case 13:
        ++ts;
        break;
      case '<':
        if (!__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_IsLittleEndian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T': /* substruct */
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
        }
        break;
      case '}': /* end of substruct; either repeat or move on */
        ++ts;
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }        /* fall through */
      case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O':
        if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
            ctx->enc_packmode == ctx->new_packmode) {
          /* Continue pooling same type */
          ctx->enc_count += ctx->new_count;
        } else {
          /* New type */
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_count = ctx->new_count;
          ctx->enc_packmode = ctx->new_packmode;
          ctx->enc_type = *ts;
          ctx->is_complex = got_Z;
        }
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ParseNumber(&ts);
          if (number == -1) { /* First char was not a digit */
            PyErr_Format(PyExc_ValueError,
                         "Does not understand character buffer dtype format string ('%c')", *ts);
            return NULL;
          }
          ctx->new_count = (size_t)number; 
        }
    }
  }
}

static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
  buf->buf = NULL;
  buf->obj = NULL;
  buf->strides = __Pyx_zeros;
  buf->shape = __Pyx_zeros;
  buf->suboffsets = __Pyx_minusones;
}

static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack) {
  if (obj == Py_None || obj == NULL) {
    __Pyx_ZeroBuffer(buf);
    return 0;
  }
  buf->buf = NULL;
  if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
  if (buf->ndim != nd) {
    PyErr_Format(PyExc_ValueError,
                 "Buffer has wrong number of dimensions (expected %d, got %d)",
                 nd, buf->ndim);
    goto fail;
  }
  if (!cast) {
    __Pyx_BufFmt_Context ctx;
    __Pyx_BufFmt_Init(&ctx, stack, dtype);
    if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
  }
  if ((unsigned)buf->itemsize != dtype->size) {
    PyErr_Format(PyExc_ValueError,
      "Item size of buffer (%"PY_FORMAT_SIZE_T"d byte%s) does not match size of '%s' (%"PY_FORMAT_SIZE_T"d byte%s)",
      buf->itemsize, (buf->itemsize > 1) ? "s" : "",
      dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
    goto fail;
  }
  if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
  return 0;
fail:;
  __Pyx_ZeroBuffer(buf);
  return -1;
}

static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
  if (info->buf == NULL) return;
  if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
  __Pyx_ReleaseBuffer(info);
}

static void __Pyx_RaiseBufferFallbackError(void) {
  PyErr_Format(PyExc_ValueError,
     "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
}

static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}


static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %"PY_FORMAT_SIZE_T"d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected);
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else if (PyErr_Occurred()) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable");
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    /* cause is unused */
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }

    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

#else /* Python 3+ */

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;

    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (!PyExceptionClass_Check(type)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }

    if (cause) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        if (!value) {
            value = PyObject_CallObject(type, NULL);
        }
        PyException_SetCause(value, fixed_cause);
    }

    PyErr_SetObject(type, value);

    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }

bad:
    return;
}
#endif

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}



static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #else
        if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
        #endif
            goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_mod___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t a, __pyx_t_5numpy_int64_t b) {
    __pyx_t_5numpy_int64_t r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

static CYTHON_INLINE Py_ssize_t __Pyx_mod_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
    if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) {
        return PyFloat_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}

static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int64(npy_int64 val) {
    const npy_int64 neg_one = (npy_int64)-1, const_zero = (npy_int64)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(npy_int64) == sizeof(char))  ||
        (sizeof(npy_int64) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(npy_int64) == sizeof(int)) ||
               (sizeof(npy_int64) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(npy_int64) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
                                     little, !is_unsigned);
    }
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
  #if PY_VERSION_HEX >= 0x02060000
  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
  #endif
  if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pf_5numpy_7ndarray___getbuffer__(obj, view, flags);
  else {
  PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
  return -1;
    }
}

static void __Pyx_ReleaseBuffer(Py_buffer *view) {
  PyObject* obj = view->obj;
  if (obj) {
    #if PY_VERSION_HEX >= 0x02060000
    if (PyObject_CheckBuffer(obj)) {PyBuffer_Release(view); return;}
    #endif
    if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pf_5numpy_7ndarray_1__releasebuffer__(obj, view);
    Py_DECREF(obj);
    view->obj = NULL;
  }
}

#endif

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        PyObject *py_level = PyInt_FromLong(level);
        if (!py_level)
            goto bad;
        module = PyObject_CallFunctionObjArgs(py_import,
            name, global_dict, empty_dict, list, py_level, NULL);
        Py_DECREF(py_level);
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject* x) {
    const npy_int32 neg_one = (npy_int32)-1, const_zero = (npy_int32)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(npy_int32) == sizeof(char)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(npy_int32) == sizeof(short)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(npy_int32) == sizeof(int)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(npy_int32) == sizeof(long)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(npy_int32) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (npy_int32)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (npy_int32)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        npy_int32 val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        return (npy_int32)-1;
    }
}

static CYTHON_INLINE npy_int64 __Pyx_PyInt_from_py_npy_int64(PyObject* x) {
    const npy_int64 neg_one = (npy_int64)-1, const_zero = (npy_int64)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(npy_int64) == sizeof(char)) {
        if (is_unsigned)
            return (npy_int64)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (npy_int64)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(npy_int64) == sizeof(short)) {
        if (is_unsigned)
            return (npy_int64)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (npy_int64)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(npy_int64) == sizeof(int)) {
        if (is_unsigned)
            return (npy_int64)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (npy_int64)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(npy_int64) == sizeof(long)) {
        if (is_unsigned)
            return (npy_int64)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (npy_int64)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(npy_int64) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (npy_int64)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (npy_int64)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        npy_int64 val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        return (npy_int64)-1;
    }
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
    /* Default metaclass */
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, (char *)"__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;

    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;

    /* Python2 __metaclass__ */
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}


static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) {
    __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType);
    if (op == NULL)
        return NULL;
    op->func.m_ml = ml;
    Py_XINCREF(self);
    op->func.m_self = self;
    Py_XINCREF(module);
    op->func.m_module = module;
    PyObject_GC_Track(op);
    return (PyObject *)op;
}

static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) {
    PyObject_GC_UnTrack(m);
    Py_XDECREF(m->func.m_self);
    Py_XDECREF(m->func.m_module);
    PyObject_GC_Del(m);
}

static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) {
    if (obj == Py_None)
            obj = NULL;
    return PyMethod_New(func, obj, type);
}

static int __pyx_binding_PyCFunctionType_init(void) {
    __pyx_binding_PyCFunctionType_type = PyCFunction_Type;
    __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method");
    __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc;
    __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get;
    if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) {
        return -1;
    }
    __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type;
    return 0;

}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_uint32(npy_uint32 val) {
    const npy_uint32 neg_one = (npy_uint32)-1, const_zero = (npy_uint32)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(npy_uint32) == sizeof(char))  ||
        (sizeof(npy_uint32) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(npy_uint32) == sizeof(int)) ||
               (sizeof(npy_uint32) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(npy_uint32) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(npy_uint32),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE npy_uint32 __Pyx_PyInt_from_py_npy_uint32(PyObject* x) {
    const npy_uint32 neg_one = (npy_uint32)-1, const_zero = (npy_uint32)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(npy_uint32) == sizeof(char)) {
        if (is_unsigned)
            return (npy_uint32)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (npy_uint32)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(npy_uint32) == sizeof(short)) {
        if (is_unsigned)
            return (npy_uint32)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (npy_uint32)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(npy_uint32) == sizeof(int)) {
        if (is_unsigned)
            return (npy_uint32)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (npy_uint32)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(npy_uint32) == sizeof(long)) {
        if (is_unsigned)
            return (npy_uint32)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (npy_uint32)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(npy_uint32) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (npy_uint32)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (npy_uint32)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        npy_uint32 val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        return (npy_uint32)-1;
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32 val) {
    const npy_int32 neg_one = (npy_int32)-1, const_zero = (npy_int32)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(npy_int32) == sizeof(char))  ||
        (sizeof(npy_int32) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(npy_int32) == sizeof(int)) ||
               (sizeof(npy_int32) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(npy_int32) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = PyObject_GetAttr(o, n);
    if (!r) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

#if PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}

static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    PyObject* v;
    int i;

    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                return -1;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            return -1;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            return -1;
        PyFile_SoftSpace(f, 0);
    }
    return 0;
}

#else /* Python 3 has a print function */

static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItemString(kwargs, "file", stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItemString(kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}

#endif

#if PY_MAJOR_VERSION < 3

static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    return 0;
    /* the line below is just to avoid compiler
     * compiler warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}

#else /* Python 3 has a print function */

static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_New(1);
    if (unlikely(!arg_tuple))
        return -1;
    Py_INCREF(o);
    PyTuple_SET_ITEM(arg_tuple, 0, o);
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}

#endif

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
    if (s1 == s2) {   /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        if (PyBytes_GET_SIZE(s1) != PyBytes_GET_SIZE(s2)) {
            return (equals == Py_NE);
        } else if (PyBytes_GET_SIZE(s1) == 1) {
            if (equals == Py_EQ)
                return (PyBytes_AS_STRING(s1)[0] == PyBytes_AS_STRING(s2)[0]);
            else
                return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]);
        } else {
            int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), (size_t)PyBytes_GET_SIZE(s1));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
    if (s1 == s2) {   /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */
        return (equals == Py_EQ);
    } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) {
        if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) {
            return (equals == Py_NE);
        } else if (PyUnicode_GET_SIZE(s1) == 1) {
            if (equals == Py_EQ)
                return (PyUnicode_AS_UNICODE(s1)[0] == PyUnicode_AS_UNICODE(s2)[0]);
            else
                return (PyUnicode_AS_UNICODE(s1)[0] != PyUnicode_AS_UNICODE(s2)[0]);
        } else {
            int result = PyUnicode_Compare(s1, s2);
            if ((result == -1) && unlikely(PyErr_Occurred()))
                return -1;
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyUnicode_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyUnicode_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

static __pyx_t_double_complex __Pyx_PyComplex_As___pyx_t_double_complex(PyObject* o) {
    Py_complex cval;
    if (PyComplex_CheckExact(o))
        cval = ((PyComplexObject *)o)->cval;
    else
        cval = PyComplex_AsCComplex(o);
    return __pyx_t_double_complex_from_parts(
               (double)cval.real,
               (double)cval.imag);
}

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

static CYTHON_INLINE npy_uint8 __Pyx_PyInt_from_py_npy_uint8(PyObject* x) {
    const npy_uint8 neg_one = (npy_uint8)-1, const_zero = (npy_uint8)0;
    const int is_unsigned = const_zero < neg_one;
    if (sizeof(npy_uint8) == sizeof(char)) {
        if (is_unsigned)
            return (npy_uint8)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (npy_uint8)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(npy_uint8) == sizeof(short)) {
        if (is_unsigned)
            return (npy_uint8)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (npy_uint8)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(npy_uint8) == sizeof(int)) {
        if (is_unsigned)
            return (npy_uint8)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (npy_uint8)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(npy_uint8) == sizeof(long)) {
        if (is_unsigned)
            return (npy_uint8)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (npy_uint8)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(npy_uint8) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (npy_uint8)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (npy_uint8)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        npy_uint8 val;
        PyObject *v = __Pyx_PyNumber_Int(x);
        #if PY_VERSION_HEX < 0x03000000
        if (likely(v) && !PyLong_Check(v)) {
            PyObject *tmp = v;
            v = PyNumber_Long(tmp);
            Py_DECREF(tmp);
        }
        #endif
        if (likely(v)) {
            int one = 1; int is_little = (int)*(unsigned char *)&one;
            unsigned char *bytes = (unsigned char *)&val;
            int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                          bytes, sizeof(val),
                                          is_little, !is_unsigned);
            Py_DECREF(v);
            if (likely(!ret))
                return val;
        }
        return (npy_uint8)-1;
    }
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];

    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(class_name);
    #else
    py_name = PyUnicode_FromString(class_name);
    #endif
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && ((PyTypeObject *)result)->tp_basicsize > (Py_ssize_t)size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if (((PyTypeObject *)result)->tp_basicsize != (Py_ssize_t)size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;

    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(name);
    #else
    py_name = PyUnicode_FromString(name);
    #endif
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
                               int __pyx_lineno, const char *__pyx_filename) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
